From ad704d9bf600afa4699f16aaa4b727088a3c5cec Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 22 Mar 2023 22:13:49 -0700 Subject: [PATCH 01/17] TranslatorTextBuilder: dont do auto spiral if any property is specified --- .../TranslatorText/TranslatorTextBuilder.cs | 12 +++++----- NewHorizons/External/Modules/PropModule.cs | 22 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 2c096bd86..3c9ca9b07 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -522,14 +522,12 @@ internal static void RefreshArcs(NomaiWallText nomaiWallText, GameObject convers var arcInfo = info.arcInfo[j]; var arc = arranger.spirals[j]; - if (arcInfo.position != null) arc.transform.localPosition = new Vector3(arcInfo.position.x, arcInfo.position.y, 0); - - if (arcInfo.zRotation != null) arc.transform.localRotation = Quaternion.Euler(0, 0, arcInfo.zRotation.Value); - - if (arcInfo.mirror != null) + if (arcInfo.position != null || arcInfo.zRotation != null || arcInfo.mirror != null) { - if (arcInfo.mirror.Value) arc.transform.localScale = new Vector3(-1, 1, 1); - else arc.transform.localScale = new Vector3(1, 1, 1); + var pos = (Vector2)(arcInfo.position ?? Vector2.zero); + arc.transform.localPosition = new Vector3(pos.x, pos.y, 0); + arc.transform.localRotation = Quaternion.Euler(0, 0, arcInfo.zRotation.GetValueOrDefault()); + arc.transform.localScale = arcInfo.mirror.GetValueOrDefault() ? new Vector3(-1, 1, 1) : new Vector3(1, 1, 1); } } diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 8ed805bd1..78b12b35d 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -610,30 +610,30 @@ public enum NomaiTextArcType } /// - /// Whether to flip the spiral from left-curling to right-curling or vice versa. If not specified, will use auto spiral generated value. + /// The type of text to display. /// - public bool? mirror; - + [DefaultValue("adult")] public NomaiTextArcType type = NomaiTextArcType.Adult; + /// - /// The local position of this object on the wall. If not specified, will use auto spiral generated value. + /// The local position of this object on the wall. If specified, auto spiral will not touch this arc. /// public MVector2 position; /// - /// The type of text to display. + /// The z euler angle for this arc. If specified, auto spiral will not touch this arc. /// - [DefaultValue("adult")] public NomaiTextArcType type = NomaiTextArcType.Adult; + [Range(0f, 360f)] public float? zRotation; /// - /// Which variation of the chosen type to place. If not specified, a random variation will be selected based on the seed provided in the parent module. + /// Whether to flip the spiral from left-curling to right-curling or vice versa. If specified, auto spiral will not touch this arc. /// - [Obsolete("only used in old nomai text")] - [DefaultValue(-1)] public int variation = -1; + public bool? mirror; /// - /// The z euler angle for this arc. If not specified, will use auto spiral generated value. + /// Which variation of the chosen type to place. If not specified, a random variation will be selected based on the seed provided in the parent module. /// - [Range(0f, 360f)] public float? zRotation; + [Obsolete("only used in old nomai text")] + [DefaultValue(-1)] public int variation = -1; } [JsonObject] From ad7ae299f229f6221d3482f5e067761fed150190 Mon Sep 17 00:00:00 2001 From: Ben C Date: Thu, 23 Mar 2023 05:17:36 +0000 Subject: [PATCH 02/17] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 50 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 6b56c515e..28d56ac29 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1471,45 +1471,31 @@ "type": "object", "additionalProperties": false, "properties": { - "mirror": { - "type": [ - "boolean", - "null" - ], - "description": "Whether to flip the spiral from left-curling to right-curling or vice versa. If not specified, will use auto spiral generated value." - }, - "position": { - "description": "The local position of this object on the wall. If not specified, will use auto spiral generated value.", - "$ref": "#/definitions/MVector2" - }, "type": { "description": "The type of text to display.", "default": "adult", "$ref": "#/definitions/NomaiTextArcType" }, + "position": { + "description": "The local position of this object on the wall. If specified, auto spiral will not touch this arc.", + "$ref": "#/definitions/MVector2" + }, "zRotation": { "type": [ "null", "number" ], - "description": "The z euler angle for this arc. If not specified, will use auto spiral generated value.", + "description": "The z euler angle for this arc. If specified, auto spiral will not touch this arc.", "format": "float", "maximum": 360.0, "minimum": 0.0 - } - } - }, - "MVector2": { - "type": "object", - "additionalProperties": false, - "properties": { - "x": { - "type": "number", - "format": "float" }, - "y": { - "type": "number", - "format": "float" + "mirror": { + "type": [ + "boolean", + "null" + ], + "description": "Whether to flip the spiral from left-curling to right-curling or vice versa. If specified, auto spiral will not touch this arc." } } }, @@ -1527,6 +1513,20 @@ "stranger" ] }, + "MVector2": { + "type": "object", + "additionalProperties": false, + "properties": { + "x": { + "type": "number", + "format": "float" + }, + "y": { + "type": "number", + "format": "float" + } + } + }, "NomaiTextType": { "type": "string", "description": "", From 3e681fea60ca4e28299289d7032b7c6f2b216729 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 22 Mar 2023 22:28:52 -0700 Subject: [PATCH 03/17] use better whiteboard --- .../Builder/Props/TranslatorText/TranslatorTextBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 3c9ca9b07..338da77d6 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -355,7 +355,7 @@ public static GameObject Make(GameObject planetGO, Sector sector, PropModule.Tra alignRadial = info.alignRadial, isRelativeToParent = info.isRelativeToParent, parentPath = info.parentPath, - path = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District2/Interactables_HangingCity_District2/VisibleFrom_HangingCity/Props_NOM_Whiteboard (1)", + path = "TimberHearth_Body/Sector_TH/Sector_NomaiMines/Interactables_NomaiMines/Props_NOM_Whiteboard/Props_NOM_Whiteboard (1)", position = info.position, rename = info.rename ?? "Props_NOM_Whiteboard", rotation = info.rotation, From 83d86ff4858e8a1f477fa1f45b94a4eda38a9f35 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 13:07:20 -0700 Subject: [PATCH 04/17] kill ignoresun entirely fuck it --- NewHorizons/Builder/Props/DetailBuilder.cs | 4 ++++ .../Builder/Props/TranslatorText/TranslatorTextBuilder.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index e4e59795e..8ea3d9430 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -3,6 +3,7 @@ using NewHorizons.External.Modules; using NewHorizons.Handlers; using NewHorizons.Utility; +using NewHorizons.Utility.OWUtilities; using OWML.Common; using System; using System.Collections.Generic; @@ -103,6 +104,9 @@ public static GameObject Make(GameObject go, Sector sector, GameObject prefab, P var isTorch = prop.GetComponent() != null; isItem = false; + // IgnoreSun is just a shadow casting optimization for BH so we can get rid of it + if (go.layer == Layer.IgnoreSun) go.layer = Layer.Default; + foreach (var component in prop.GetComponentsInChildren(true)) { // Components can come through as null here (yes, really), diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 338da77d6..3c9ca9b07 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -355,7 +355,7 @@ public static GameObject Make(GameObject planetGO, Sector sector, PropModule.Tra alignRadial = info.alignRadial, isRelativeToParent = info.isRelativeToParent, parentPath = info.parentPath, - path = "TimberHearth_Body/Sector_TH/Sector_NomaiMines/Interactables_NomaiMines/Props_NOM_Whiteboard/Props_NOM_Whiteboard (1)", + path = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District2/Interactables_HangingCity_District2/VisibleFrom_HangingCity/Props_NOM_Whiteboard (1)", position = info.position, rename = info.rename ?? "Props_NOM_Whiteboard", rotation = info.rotation, From f9d9733fccd3d947b33ee8300940c670e924ef81 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 13:30:48 -0700 Subject: [PATCH 05/17] oops --- NewHorizons/Builder/Props/DetailBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 8ea3d9430..5cfa4ac6a 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -105,7 +105,7 @@ public static GameObject Make(GameObject go, Sector sector, GameObject prefab, P isItem = false; // IgnoreSun is just a shadow casting optimization for BH so we can get rid of it - if (go.layer == Layer.IgnoreSun) go.layer = Layer.Default; + if (prop.layer == Layer.IgnoreSun) prop.layer = Layer.Default; foreach (var component in prop.GetComponentsInChildren(true)) { From 6e49af5abcac402607a1aeb0a56d628db4812b10 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 13:07:20 -0700 Subject: [PATCH 06/17] kill ignoresun entirely fuck it --- NewHorizons/Builder/Props/DetailBuilder.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 5cfa4ac6a..2b0b46f3a 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -279,8 +279,13 @@ private static bool FixUnsectoredComponent(Component component) private static void FixComponent(Component component, GameObject planetGO) { // Fix other components + // IgnoreSun is just a shadow casting optimization for BH so we can get rid of it + if (component is Transform && component.gameObject.layer == Layer.IgnoreSun) + { + component.gameObject.layer = Layer.Default; + } // I forget why this is here - if (component is GhostIK or GhostEffects) + else if (component is GhostIK or GhostEffects) { Component.DestroyImmediate(component); return; From 5f65bb5360f6d9c6831b1a15f75e8987233342e9 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 13:32:55 -0700 Subject: [PATCH 07/17] grrrrr --- NewHorizons/Builder/Props/DetailBuilder.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 2b0b46f3a..bb10ba295 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -104,9 +104,6 @@ public static GameObject Make(GameObject go, Sector sector, GameObject prefab, P var isTorch = prop.GetComponent() != null; isItem = false; - // IgnoreSun is just a shadow casting optimization for BH so we can get rid of it - if (prop.layer == Layer.IgnoreSun) prop.layer = Layer.Default; - foreach (var component in prop.GetComponentsInChildren(true)) { // Components can come through as null here (yes, really), From b134e123892cb2591acfcb95ad38ad4884206159 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 13:37:33 -0700 Subject: [PATCH 08/17] use simplified call to detail info thing --- .../Builder/Props/TranslatorText/TranslatorTextBuilder.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 3c9ca9b07..49185247e 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -350,15 +350,10 @@ public static GameObject Make(GameObject planetGO, Sector sector, PropModule.Tra } case PropModule.NomaiTextType.Whiteboard: { - var whiteboardInfo = new PropModule.DetailInfo() + var whiteboardInfo = new PropModule.DetailInfo(info) { - alignRadial = info.alignRadial, - isRelativeToParent = info.isRelativeToParent, - parentPath = info.parentPath, path = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District2/Interactables_HangingCity_District2/VisibleFrom_HangingCity/Props_NOM_Whiteboard (1)", - position = info.position, rename = info.rename ?? "Props_NOM_Whiteboard", - rotation = info.rotation, }; var whiteboardObject = DetailBuilder.Make(planetGO, sector, whiteboardInfo); From 97c869bd16c3c505a18f93d8fcd1c3d9000aec56 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 14:18:04 -0700 Subject: [PATCH 09/17] FireOnNextUpdate my beloved --- .../Props/TranslatorText/TranslatorTextBuilder.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 49185247e..213f3605a 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -1,3 +1,4 @@ +using HarmonyLib; using NewHorizons.External.Modules; using NewHorizons.Handlers; using NewHorizons.Utility; @@ -276,12 +277,16 @@ public static GameObject Make(GameObject planetGO, Sector sector, PropModule.Tra cairnObject.SetActive(true); // Make it do the thing when it finishes being knocked over - foreach (var rock in cairnObject.GetComponent()._rocks) + // idk why, but sometimes stuff is null here, so just wait a frame to let it initialize + Delay.FireOnNextUpdate(() => { - rock._returning = false; - rock._owCollider.SetActivation(true); - rock.enabled = false; - } + foreach (var rock in cairnObject.GetComponent()._rocks) + { + rock._returning = false; + rock._owCollider.SetActivation(true); + rock.enabled = false; + } + }); // So we can actually knock it over cairnObject.GetComponent().enabled = true; From 572702bac070c01126ad2b2772c9faccdddc44d9 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 14:22:27 -0700 Subject: [PATCH 10/17] comment --- NewHorizons/Builder/Props/DetailBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index bb10ba295..a280a4a3e 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -276,7 +276,7 @@ private static bool FixUnsectoredComponent(Component component) private static void FixComponent(Component component, GameObject planetGO) { // Fix other components - // IgnoreSun is just a shadow casting optimization for BH so we can get rid of it + // IgnoreSun is just a shadow casting optimization for caves and stuff so we can get rid of it if (component is Transform && component.gameObject.layer == Layer.IgnoreSun) { component.gameObject.layer = Layer.Default; From 687151c36bd1ea905667ec09ac5a63b5f490d881 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 16:00:41 -0700 Subject: [PATCH 11/17] potentially fix cull group map bug --- NewHorizons/Builder/Props/DetailBuilder.cs | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index a280a4a3e..c19407096 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -119,7 +119,7 @@ public static GameObject Make(GameObject go, Sector sector, GameObject prefab, P { if (FixUnsectoredComponent(component)) continue; } - else FixSectoredComponent(component, sector, isTorch); + else FixSectoredComponent(component, sector, isTorch, detail.keepLoaded); FixComponent(component, go); } @@ -214,10 +214,7 @@ public static GameObject Make(GameObject go, Sector sector, GameObject prefab, P /// /// Fix components that have sectors. Has a specific fix if there is a VisionTorchItem on the object. /// - /// - /// - /// - private static void FixSectoredComponent(Component component, Sector sector, bool isTorch = false) + private static void FixSectoredComponent(Component component, Sector sector, bool isTorch, bool keepLoaded) { // fix Sector stuff, eg SectorCullGroup (without this, props that have a SectorCullGroup component will become invisible inappropriately) if (component is ISectorGroup sectorGroup) @@ -225,6 +222,14 @@ private static void FixSectoredComponent(Component component, Sector sector, boo sectorGroup.SetSector(sector); } + // keepLoaded should remove existing groups + // renderers/colliders get enabled later so we dont have to do that here + if (keepLoaded && component is SectorCullGroup or SectorCollisionGroup or SectorLightsCullGroup) + { + Component.DestroyImmediate(component); + return; + } + // Not doing else if here because idk if any of the classes below implement ISectorGroup if (component is Sector s) @@ -235,6 +240,12 @@ private static void FixSectoredComponent(Component component, Sector sector, boo else if (component is SectorCullGroup sectorCullGroup) { sectorCullGroup._controllingProxy = null; + + // fixes sector cull group deactivating renderers on map view enter and fast foward + // TODO: does this actually work? what? how? + sectorCullGroup._inMapView = false; + sectorCullGroup._isFastForwarding = false; + sectorCullGroup.SetVisible(sectorCullGroup.ShouldBeVisible(), true, false); } else if(component is SectoredMonoBehaviour behaviour) @@ -265,7 +276,7 @@ private static void FixSectoredComponent(Component component, Sector sector, boo /// private static bool FixUnsectoredComponent(Component component) { - if (component is FogLight or SectoredMonoBehaviour) + if (component is FogLight or SectoredMonoBehaviour or ISectorGroup) { GameObject.DestroyImmediate(component); return true; @@ -340,15 +351,6 @@ private static void FixComponent(Component component, GameObject planetGO) else if (component is Renderer renderer && component.gameObject.GetComponent() == null) renderer.enabled = true; else if(component is Shape shape) shape.enabled = true; - // fixes sector cull group deactivating renderers on map view enter and fast foward - // TODO: does this actually work? what? how? - else if(component is SectorCullGroup sectorCullGroup) - { - sectorCullGroup._inMapView = false; - sectorCullGroup._isFastForwarding = false; - sectorCullGroup.SetVisible(sectorCullGroup.ShouldBeVisible(), true, false); - } - // If it's not a moving anglerfish make sure the anim controller is regular else if(component is AnglerfishAnimController && component.GetComponentInParent() == null) { From 9910323ebc02af10d0a35cb8431572ba3246acab Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 16:02:45 -0700 Subject: [PATCH 12/17] move this up so it returns early --- NewHorizons/Builder/Props/DetailBuilder.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index c19407096..d56aa17d0 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -216,12 +216,6 @@ public static GameObject Make(GameObject go, Sector sector, GameObject prefab, P /// private static void FixSectoredComponent(Component component, Sector sector, bool isTorch, bool keepLoaded) { - // fix Sector stuff, eg SectorCullGroup (without this, props that have a SectorCullGroup component will become invisible inappropriately) - if (component is ISectorGroup sectorGroup) - { - sectorGroup.SetSector(sector); - } - // keepLoaded should remove existing groups // renderers/colliders get enabled later so we dont have to do that here if (keepLoaded && component is SectorCullGroup or SectorCollisionGroup or SectorLightsCullGroup) @@ -229,6 +223,12 @@ private static void FixSectoredComponent(Component component, Sector sector, boo Component.DestroyImmediate(component); return; } + + // fix Sector stuff, eg SectorCullGroup (without this, props that have a SectorCullGroup component will become invisible inappropriately) + if (component is ISectorGroup sectorGroup) + { + sectorGroup.SetSector(sector); + } // Not doing else if here because idk if any of the classes below implement ISectorGroup From b4340a93f71c20d22fd85b0ef442187f6182b01d Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 16:26:44 -0700 Subject: [PATCH 13/17] silly space --- NewHorizons/Builder/Props/DetailBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index d56aa17d0..291201dd7 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -229,7 +229,7 @@ private static void FixSectoredComponent(Component component, Sector sector, boo { sectorGroup.SetSector(sector); } - + // Not doing else if here because idk if any of the classes below implement ISectorGroup if (component is Sector s) From 95aea5ebc47d7e6829bec2c2c837e45bd960a8fc Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 17:12:35 -0700 Subject: [PATCH 14/17] remove silly unused field --- .../External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs b/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs index 6e704f368..305283af6 100644 --- a/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs +++ b/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs @@ -10,10 +10,5 @@ public class NomaiWarpTransmitterInfo : NomaiWarpPadInfo /// In degrees. Gives a margin of error for alignments. /// [DefaultValue(5f)] public float alignmentWindow = 5f; - - /// - /// Is this transmitter upsidedown? Means alignment will be checked facing the other way. - /// - public bool upsideDown = false; } } From 9fdeea8e98670b69fb6b81e9ac40a7e3cdecf387 Mon Sep 17 00:00:00 2001 From: Ben C Date: Fri, 24 Mar 2023 00:15:13 +0000 Subject: [PATCH 15/17] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 28d56ac29..f531c387a 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2527,10 +2527,6 @@ "description": "In degrees. Gives a margin of error for alignments.", "format": "float", "default": 5.0 - }, - "upsideDown": { - "type": "boolean", - "description": "Is this transmitter upsidedown? Means alignment will be checked facing the other way." } } }, From 6a97137cefdb91fb3009c62af575325c1a3cb6d6 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 23 Mar 2023 17:31:10 -0700 Subject: [PATCH 16/17] add it back and make it used --- NewHorizons/Builder/Props/WarpPadBuilder.cs | 2 ++ .../External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/NewHorizons/Builder/Props/WarpPadBuilder.cs b/NewHorizons/Builder/Props/WarpPadBuilder.cs index f106dc57e..c4de76793 100644 --- a/NewHorizons/Builder/Props/WarpPadBuilder.cs +++ b/NewHorizons/Builder/Props/WarpPadBuilder.cs @@ -113,6 +113,8 @@ public static void Make(GameObject planetGO, Sector sector, NomaiWarpTransmitter transmitter._alignmentWindow = info.alignmentWindow; + transmitter._upsideDown = info.flipAlignment; + transmitter.GetComponent().enabled = true; transmitterObject.SetActive(true); diff --git a/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs b/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs index 305283af6..3a1dd55ca 100644 --- a/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs +++ b/NewHorizons/External/Modules/WarpPad/NomaiWarpTransmitterInfo.cs @@ -10,5 +10,10 @@ public class NomaiWarpTransmitterInfo : NomaiWarpPadInfo /// In degrees. Gives a margin of error for alignments. /// [DefaultValue(5f)] public float alignmentWindow = 5f; + + /// + /// This makes the alignment happen if the destination planet is BELOW you rather than above. + /// + public bool flipAlignment; } } From 891a2e353d32304531974dae0668901bfab1be3f Mon Sep 17 00:00:00 2001 From: Ben C Date: Fri, 24 Mar 2023 00:37:22 +0000 Subject: [PATCH 17/17] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index f531c387a..b21da199d 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2527,6 +2527,10 @@ "description": "In degrees. Gives a margin of error for alignments.", "format": "float", "default": 5.0 + }, + "flipAlignment": { + "type": "boolean", + "description": "This makes the alignment happen if the destination planet is BELOW you rather than above." } } },