From 331d33ac77762def3a2932de4685b7409b84a7dd Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Mon, 5 Sep 2022 23:35:24 -0400 Subject: [PATCH 1/2] Add rename option to volumes --- NewHorizons/Builder/ShipLog/RevealBuilder.cs | 5 +++++ NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs | 5 +++++ NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs | 5 +++++ NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs | 5 +++++ NewHorizons/Builder/Volumes/VolumeBuilder.cs | 5 +++++ NewHorizons/External/Modules/VolumesModule.cs | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/NewHorizons/Builder/ShipLog/RevealBuilder.cs b/NewHorizons/Builder/ShipLog/RevealBuilder.cs index 59662218..3bfcdd69 100644 --- a/NewHorizons/Builder/ShipLog/RevealBuilder.cs +++ b/NewHorizons/Builder/ShipLog/RevealBuilder.cs @@ -42,6 +42,11 @@ namespace NewHorizons.Builder.ShipLog revealTriggerVolume.SetActive(false); revealTriggerVolume.transform.parent = sector?.transform ?? planetGO.transform; + if (!string.IsNullOrEmpty(info.rename)) + { + revealTriggerVolume.name = info.rename; + } + if (!string.IsNullOrEmpty(info.parentPath)) { var newParent = planetGO.transform.Find(info.parentPath); diff --git a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs index 2952f590..bbb201d8 100644 --- a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs @@ -20,6 +20,11 @@ namespace NewHorizons.Builder.Volumes go.transform.parent = sector?.transform ?? planetGO.transform; + if (!string.IsNullOrEmpty(info.rename)) + { + go.name = info.rename; + } + if (!string.IsNullOrEmpty(info.parentPath)) { var newParent = planetGO.transform.Find(info.parentPath); diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index d52b4352..705570d5 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -18,6 +18,11 @@ namespace NewHorizons.Builder.Volumes go.transform.parent = sector?.transform ?? planetGO.transform; + if (!string.IsNullOrEmpty(info.rename)) + { + go.name = info.rename; + } + if (!string.IsNullOrEmpty(info.parentPath)) { var newParent = planetGO.transform.Find(info.parentPath); diff --git a/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs b/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs index 496a9ea7..13386e79 100644 --- a/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs @@ -22,6 +22,11 @@ namespace NewHorizons.Builder.Volumes go.transform.parent = sector?.transform ?? planetGO.transform; + if (!string.IsNullOrEmpty(info.rename)) + { + go.name = info.rename; + } + if (!string.IsNullOrEmpty(info.parentPath)) { var newParent = planetGO.transform.Find(info.parentPath); diff --git a/NewHorizons/Builder/Volumes/VolumeBuilder.cs b/NewHorizons/Builder/Volumes/VolumeBuilder.cs index afeffd73..966c3c25 100644 --- a/NewHorizons/Builder/Volumes/VolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/VolumeBuilder.cs @@ -14,6 +14,11 @@ namespace NewHorizons.Builder.Volumes go.transform.parent = sector?.transform ?? planetGO.transform; + if (!string.IsNullOrEmpty(info.rename)) + { + go.name = info.rename; + } + if (!string.IsNullOrEmpty(info.parentPath)) { var newParent = planetGO.transform.Find(info.parentPath); diff --git a/NewHorizons/External/Modules/VolumesModule.cs b/NewHorizons/External/Modules/VolumesModule.cs index a3c810a0..49bbc542 100644 --- a/NewHorizons/External/Modules/VolumesModule.cs +++ b/NewHorizons/External/Modules/VolumesModule.cs @@ -71,6 +71,11 @@ namespace NewHorizons.External.Modules /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). /// public string parentPath; + + /// + /// An optional rename of this volume. + /// + public string rename; } [JsonObject] From 70f07c20a907dda2e28950d531e091cd00e1788b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Sep 2022 03:37:40 +0000 Subject: [PATCH 2/2] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index b1a756cd..18185e87 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2468,6 +2468,10 @@ "type": "string", "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." }, + "rename": { + "type": "string", + "description": "An optional rename of this volume." + }, "audio": { "type": "string", "description": "The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." @@ -2541,6 +2545,10 @@ "type": "string", "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." }, + "rename": { + "type": "string", + "description": "An optional rename of this volume." + }, "type": { "description": "The type of hazard for this volume.", "default": "general", @@ -2618,6 +2626,10 @@ "parentPath": { "type": "string", "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this volume." } } }, @@ -2638,6 +2650,10 @@ "type": "string", "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." }, + "rename": { + "type": "string", + "description": "An optional rename of this volume." + }, "target": { "description": "What the notification will show for.", "default": "all", @@ -2700,6 +2716,10 @@ "type": "string", "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." }, + "rename": { + "type": "string", + "description": "An optional rename of this volume." + }, "maxAngle": { "type": "number", "description": "The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only)",