From 7db8e1c4efb2b79c5b9e6b8f58ac409b66d943fc Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Fri, 16 Sep 2022 22:15:55 -0500 Subject: [PATCH 01/22] Audio volume setting --- NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs | 1 + NewHorizons/External/Modules/VolumesModule.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs index bbb201d8..c85f2e74 100644 --- a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs @@ -46,6 +46,7 @@ namespace NewHorizons.Builder.Volumes var owAudioSource = go.AddComponent(); owAudioSource._audioSource = audioSource; owAudioSource.loop = info.loop; + owAudioSource.SetMaxVolume(info.volume); owAudioSource.SetTrack((OWAudioMixer.TrackName)Enum.Parse(typeof(OWAudioMixer.TrackName), Enum.GetName(typeof(AudioMixerTrackName), info.track))); AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod); diff --git a/NewHorizons/External/Modules/VolumesModule.cs b/NewHorizons/External/Modules/VolumesModule.cs index 49bbc542..fedecc86 100644 --- a/NewHorizons/External/Modules/VolumesModule.cs +++ b/NewHorizons/External/Modules/VolumesModule.cs @@ -134,6 +134,11 @@ namespace NewHorizons.External.Modules /// Whether to loop this audio while in this audio volume or just play it once /// [DefaultValue(true)] public bool loop = true; + + /// + /// The loudness of the audio + /// + [DefaultValue(1f)] public float volume = 1f; } [JsonObject] From f04171ec83aa1d6df438a888c25c65543755ead2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Sep 2022 03:18:00 +0000 Subject: [PATCH 02/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index a3d243d1..f68205be 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2501,6 +2501,12 @@ "type": "boolean", "description": "Whether to loop this audio while in this audio volume or just play it once", "default": true + }, + "volume": { + "type": "number", + "description": "The loudness of the audio", + "format": "float", + "default": 1.0 } } }, From 9be2bed1f057047f4cd044b449e3b659c4e52c72 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Sat, 17 Sep 2022 09:58:22 -0400 Subject: [PATCH 03/22] Add range attribute --- NewHorizons/External/Modules/VolumesModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NewHorizons/External/Modules/VolumesModule.cs b/NewHorizons/External/Modules/VolumesModule.cs index fedecc86..9211f495 100644 --- a/NewHorizons/External/Modules/VolumesModule.cs +++ b/NewHorizons/External/Modules/VolumesModule.cs @@ -4,6 +4,7 @@ using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; @@ -138,7 +139,9 @@ namespace NewHorizons.External.Modules /// /// The loudness of the audio /// - [DefaultValue(1f)] public float volume = 1f; + [Range(0f, 1f)] + [DefaultValue(1f)] + public float volume = 1f; } [JsonObject] From 129fbf3a4fa670bba202f70513a1de9b8e295ec5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Sep 2022 14:00:40 +0000 Subject: [PATCH 04/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index f68205be..fe2a15b1 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2506,7 +2506,9 @@ "type": "number", "description": "The loudness of the audio", "format": "float", - "default": 1.0 + "default": 1.0, + "maximum": 1.0, + "minimum": 0.0 } } }, From 2904af39d1153e1c6a137562bcdb8fe17f78e9d4 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Sat, 17 Sep 2022 10:55:01 -0500 Subject: [PATCH 05/22] Detail stretch --- NewHorizons/Builder/Props/DetailBuilder.cs | 2 +- NewHorizons/External/Modules/PropModule.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 660956b6..5e4ab8e1 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -98,7 +98,7 @@ namespace NewHorizons.Builder.Props prop.transform.rotation = go.transform.TransformRotation(rot); } - prop.transform.localScale = detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale; + prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale); prop.SetActive(true); diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 1644192d..4051e58f 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -200,6 +200,11 @@ namespace NewHorizons.External.Modules /// [DefaultValue(1f)] public float scale = 1f; + /// + /// Scale each axis of the prop. Overrides `scale`. + /// + public MVector3 stretch; + /// /// If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is /// From 1ce208c77801b21ec433ad4dd0cac31af80187c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Sep 2022 15:57:01 +0000 Subject: [PATCH 06/22] 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 fe2a15b1..3fdc9ce5 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1049,6 +1049,10 @@ "format": "float", "default": 1.0 }, + "stretch": { + "description": "Scale each axis of the prop. Overrides `scale`.", + "$ref": "#/definitions/MVector3" + }, "quantumGroupID": { "type": "string", "description": "If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is" From 2cee9ebd426318525a098372c7e0a66706fabe59 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 17 Sep 2022 11:42:45 -0700 Subject: [PATCH 07/22] add stretch to scatter --- NewHorizons/Builder/Props/ScatterBuilder.cs | 1 + NewHorizons/External/Modules/PropModule.cs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/ScatterBuilder.cs b/NewHorizons/Builder/Props/ScatterBuilder.cs index a92ebd9b..dffcc47a 100644 --- a/NewHorizons/Builder/Props/ScatterBuilder.cs +++ b/NewHorizons/Builder/Props/ScatterBuilder.cs @@ -69,6 +69,7 @@ namespace NewHorizons.Builder.Props var detailInfo = new PropModule.DetailInfo() { scale = propInfo.scale, + stretch = propInfo.stretch, keepLoaded = propInfo.keepLoaded }; var scatterPrefab = DetailBuilder.Make(go, sector, prefab, detailInfo); diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 4051e58f..807aa9d6 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -123,7 +123,12 @@ namespace NewHorizons.External.Modules /// /// Scale this prop once it is placed /// - public float scale = 1f; + [DefaultValue(1f)] public float scale = 1f; + + /// + /// Scale each axis of the prop. Overrides `scale`. + /// + public MVector3 stretch; /// /// The number used as entropy for scattering the props From 50f2dc16251f19d4a0d35c0a5e93429d7bcfca7b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Sep 2022 18:44:44 +0000 Subject: [PATCH 08/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 3fdc9ce5..75424b21 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1376,7 +1376,12 @@ "scale": { "type": "number", "description": "Scale this prop once it is placed", - "format": "float" + "format": "float", + "default": 1.0 + }, + "stretch": { + "description": "Scale each axis of the prop. Overrides `scale`.", + "$ref": "#/definitions/MVector3" }, "seed": { "type": "integer", From 22601881648c6592423160f608807fe066969762 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Sat, 17 Sep 2022 19:33:21 -0400 Subject: [PATCH 09/22] Log missing decal path --- NewHorizons/Builder/Props/RemoteBuilder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/RemoteBuilder.cs b/NewHorizons/Builder/Props/RemoteBuilder.cs index b82ec0e5..0448e565 100644 --- a/NewHorizons/Builder/Props/RemoteBuilder.cs +++ b/NewHorizons/Builder/Props/RemoteBuilder.cs @@ -106,7 +106,9 @@ namespace NewHorizons.Builder.Props var id = RemoteHandler.GetPlatformID(info.id); - var decal = ImageUtilities.GetTexture(mod, info.decalPath, false, false); + Texture2D decal = Texture2D.whiteTexture; + if (!string.IsNullOrWhiteSpace(info.decalPath)) decal = ImageUtilities.GetTexture(mod, info.decalPath, false, false); + else Logger.LogError($"Missing decal path on [{info.id}] for [{go.name}]"); if (info.platform != null) { From 07ad15afff6a12ff6e0c245f40985eb2826dc179 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sun, 18 Sep 2022 20:56:47 -0700 Subject: [PATCH 10/22] bruh --- NewHorizons/Builder/Props/DetailBuilder.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 5e4ab8e1..6cb415a2 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -1,3 +1,4 @@ +using NewHorizons.Builder.General; using NewHorizons.External.Configs; using NewHorizons.External.Modules; using NewHorizons.Handlers; @@ -100,6 +101,7 @@ namespace NewHorizons.Builder.Props prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale); + if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector); prop.SetActive(true); if (prop == null) return null; From b5f5a4cabc72e93861a7553ac5b10415c64b161c Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 19 Sep 2022 00:09:38 -0400 Subject: [PATCH 11/22] Update manifest.json --- NewHorizons/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 015d57e4..6fb4c0d4 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.6.0", + "version": "1.6.1", "owmlVersion": "2.6.0", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ], From 6f55b8da3f64b7eddcce97a84259c24ff88c1214 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 30 Sep 2022 22:24:54 -0400 Subject: [PATCH 12/22] Backwards compat for certain mods broken by keepLoaded = false --- NewHorizons/Utility/NewHorizonBody.cs | 29 ++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Utility/NewHorizonBody.cs b/NewHorizons/Utility/NewHorizonBody.cs index fbbc7de6..7b5a7dc3 100644 --- a/NewHorizons/Utility/NewHorizonBody.cs +++ b/NewHorizons/Utility/NewHorizonBody.cs @@ -1,5 +1,6 @@ -using NewHorizons.External.Configs; +using NewHorizons.External.Configs; using OWML.Common; +using System.Linq; using UnityEngine; namespace NewHorizons.Utility { @@ -17,5 +18,31 @@ namespace NewHorizons.Utility public string RelativePath; public GameObject Object; + + #region Migration + private static readonly string[] _keepLoadedModsList = new string[] + { + "CreativeNameTxt.theirhomeworld", + "Roggsy.enterthewarioverse", + "Jammer.jammerlore", + "ErroneousCreationist.solarneighbourhood", + "ErroneousCreationist.incursionfinaldawn" + }; + + private void Migrate() + { + // Some old mods get really broken by this change in 1.6.1 + if (_keepLoadedModsList.Contains(Mod.ModHelper.Manifest.UniqueName)) + { + if (Config?.Props?.details != null) + { + foreach (var detail in Config.Props.details) + { + detail.keepLoaded = true; + } + } + } + } + #region Migration } } From d7730436d4347fcbb5988df41e8b28d1807c8e23 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 30 Sep 2022 22:30:13 -0400 Subject: [PATCH 13/22] Whoops --- NewHorizons/Utility/NewHorizonBody.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Utility/NewHorizonBody.cs b/NewHorizons/Utility/NewHorizonBody.cs index 7b5a7dc3..03cf0085 100644 --- a/NewHorizons/Utility/NewHorizonBody.cs +++ b/NewHorizons/Utility/NewHorizonBody.cs @@ -11,6 +11,8 @@ namespace NewHorizons.Utility Config = config; Mod = mod; RelativePath = relativePath; + + Migrate(); } public PlanetConfig Config; @@ -43,6 +45,6 @@ namespace NewHorizons.Utility } } } - #region Migration + #endregion Migration } } From d1da5c3791e80f7d3c4fcb9355e8a26e68f46586 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 30 Sep 2022 22:30:26 -0400 Subject: [PATCH 14/22] Remove stupid null check, only set active at the end --- NewHorizons/Builder/Props/DetailBuilder.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 6cb415a2..4929dade 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -102,9 +102,6 @@ namespace NewHorizons.Builder.Props prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale); if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector); - prop.SetActive(true); - - if (prop == null) return null; if (detail.removeChildren != null) { @@ -161,6 +158,8 @@ namespace NewHorizons.Builder.Props } } + prop.SetActive(true); + return prop; } From 24eedc887addf67617d257e770a92f699291b978 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 30 Sep 2022 19:31:31 -0700 Subject: [PATCH 15/22] you dont need it here HAHA --- NewHorizons/Utility/NewHorizonBody.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Utility/NewHorizonBody.cs b/NewHorizons/Utility/NewHorizonBody.cs index 03cf0085..fc9f53bd 100644 --- a/NewHorizons/Utility/NewHorizonBody.cs +++ b/NewHorizons/Utility/NewHorizonBody.cs @@ -45,6 +45,6 @@ namespace NewHorizons.Utility } } } - #endregion Migration + #endregion } } From db2d1aebcd1ba4c2539bf4c6f955738c3fbc4146 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 30 Sep 2022 19:33:06 -0700 Subject: [PATCH 16/22] move group builder down here too --- NewHorizons/Builder/Props/DetailBuilder.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 4929dade..4aa2fc42 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -101,8 +101,6 @@ namespace NewHorizons.Builder.Props prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale); - if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector); - if (detail.removeChildren != null) { var detailPath = prop.transform.GetPath(); @@ -158,6 +156,7 @@ namespace NewHorizons.Builder.Props } } + if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector); prop.SetActive(true); return prop; From 70467b76a1d375f4cef6ae0e07e55e8bce3561c1 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 30 Sep 2022 22:45:39 -0400 Subject: [PATCH 17/22] Fixed #393 --- .../Utility/DebugUtilities/DebugRaycaster.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs b/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs index 16f502e8..6f4e23fa 100644 --- a/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs +++ b/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs @@ -19,24 +19,31 @@ namespace NewHorizons.Utility.DebugUtilities private ScreenPrompt _raycastPrompt; - private void Awake() + private void Start() { _rb = this.GetRequiredComponent(); - _raycastPrompt = new ScreenPrompt(TranslationHandler.GetTranslation("DEBUG_RAYCAST", TranslationHandler.TextType.UI) + " ", ImageUtilities.GetButtonSprite(KeyCode.P)); - - Locator.GetPromptManager().AddScreenPrompt(_raycastPrompt, PromptPosition.UpperRight, false); + if (_raycastPrompt == null) + { + _raycastPrompt = new ScreenPrompt(TranslationHandler.GetTranslation("DEBUG_RAYCAST", TranslationHandler.TextType.UI) + " ", ImageUtilities.GetButtonSprite(KeyCode.P)); + Locator.GetPromptManager().AddScreenPrompt(_raycastPrompt, PromptPosition.UpperRight, false); + } } private void OnDestroy() { - Locator.GetPromptManager()?.RemoveScreenPrompt(_raycastPrompt, PromptPosition.UpperRight); + if (_raycastPrompt != null) + { + Locator.GetPromptManager()?.RemoveScreenPrompt(_raycastPrompt, PromptPosition.UpperRight); + } } private void Update() { UpdatePromptVisibility(); + if (!Main.Debug) return; + if (Keyboard.current == null) return; if (Keyboard.current[Key.P].wasReleasedThisFrame) @@ -48,7 +55,10 @@ namespace NewHorizons.Utility.DebugUtilities public void UpdatePromptVisibility() { - _raycastPrompt.SetVisibility(!OWTime.IsPaused() && Main.Debug); + if (_raycastPrompt != null) + { + _raycastPrompt.SetVisibility(!OWTime.IsPaused() && Main.Debug); + } } From 63f87e4c6d3c3ed092a17ea7dc1137f6fefb864d Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 30 Sep 2022 19:46:36 -0700 Subject: [PATCH 18/22] sort arcs by path to hopefully prevent future updates from breaking everything --- NewHorizons/Builder/Props/NomaiTextBuilder.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 981f447d..5528f6c9 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -48,7 +48,11 @@ namespace NewHorizons.Builder.Props private static void InitPrefabs() { // Just take every scroll and get the first arc - var existingArcs = GameObject.FindObjectsOfType().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray(); + var existingArcs = GameObject.FindObjectsOfType() + .Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject) + .Where(x => x != null) + .OrderBy(x => x.transform.GetPath()) + .ToArray(); _arcPrefabs = new List(); _childArcPrefabs = new List(); foreach (var existingArc in existingArcs) @@ -67,7 +71,11 @@ namespace NewHorizons.Builder.Props } } - var existingGhostArcs = GameObject.FindObjectsOfType().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray(); + var existingGhostArcs = GameObject.FindObjectsOfType() + .Select(x => x?._textLine?.gameObject) + .Where(x => x != null) + .OrderBy(x => x.transform.GetPath()) + .ToArray(); _ghostArcPrefabs = new List(); foreach (var existingArc in existingGhostArcs) { From ecc51a32f3325ce7dfd5711b3179117ce528a53f Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 30 Sep 2022 19:49:04 -0700 Subject: [PATCH 19/22] add missing parenthesis here lol --- NewHorizons/Utility/SearchUtilities.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Utility/SearchUtilities.cs b/NewHorizons/Utility/SearchUtilities.cs index 97cb4a5e..99cd2cdb 100644 --- a/NewHorizons/Utility/SearchUtilities.cs +++ b/NewHorizons/Utility/SearchUtilities.cs @@ -119,7 +119,7 @@ namespace NewHorizons.Utility var name = names.Last(); if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}"); - // 3: find resource to include inactive objects (but skip prefabs + // 3: find resource to include inactive objects (but skip prefabs) go = Resources.FindObjectsOfTypeAll() .FirstOrDefault(x => x.name == name && x.scene.name != null); if (go) From 7ce78d2ed034471e2fa9eaf19f201d0b8a1dc031 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 30 Sep 2022 19:51:59 -0700 Subject: [PATCH 20/22] comment --- NewHorizons/Builder/Props/NomaiTextBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 5528f6c9..84f15073 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -51,7 +51,7 @@ namespace NewHorizons.Builder.Props var existingArcs = GameObject.FindObjectsOfType() .Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject) .Where(x => x != null) - .OrderBy(x => x.transform.GetPath()) + .OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things .ToArray(); _arcPrefabs = new List(); _childArcPrefabs = new List(); @@ -74,7 +74,7 @@ namespace NewHorizons.Builder.Props var existingGhostArcs = GameObject.FindObjectsOfType() .Select(x => x?._textLine?.gameObject) .Where(x => x != null) - .OrderBy(x => x.transform.GetPath()) + .OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things .ToArray(); _ghostArcPrefabs = new List(); foreach (var existingArc in existingGhostArcs) From 6c8d2ede891fc5f7cebd1aa4274cd8be5b026a39 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 30 Sep 2022 20:45:39 -0700 Subject: [PATCH 21/22] use path.combine for linux --- NewHorizons/Builder/ShipLog/RumorModeBuilder.cs | 2 +- NewHorizons/Main.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs b/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs index 9e82ae8b..740731ec 100644 --- a/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs @@ -206,7 +206,7 @@ namespace NewHorizons.Builder.ShipLog private static Sprite GetEntrySprite(string entryId, NewHorizonsBody body, bool logError) { - string relativePath = body.Config.ShipLog.spriteFolder + "/" + entryId + ".png"; + string relativePath = Path.Combine(body.Config.ShipLog.spriteFolder, entryId + ".png"); try { Texture2D newTexture = ImageUtilities.GetTexture(body.Mod, relativePath); diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 96e670d7..c33f4350 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -571,11 +571,11 @@ namespace NewHorizons } } // Has to go before translations for achievements - if (File.Exists(folder + "addon-manifest.json")) + if (File.Exists(Path.Combine(folder, "addon-manifest.json"))) { LoadAddonManifest("addon-manifest.json", mod); } - if (Directory.Exists(folder + @"translations\")) + if (Directory.Exists(Path.Combine(folder, "translations"))) { LoadTranslations(folder, mod); } @@ -603,15 +603,15 @@ namespace NewHorizons var foundFile = false; foreach (TextTranslation.Language language in Enum.GetValues(typeof(TextTranslation.Language))) { - if (language == TextTranslation.Language.UNKNOWN || language == TextTranslation.Language.TOTAL) continue; + if (language is TextTranslation.Language.UNKNOWN or TextTranslation.Language.TOTAL) continue; - var relativeFile = $"translations/{language.ToString().ToLower()}.json"; + var relativeFile = Path.Combine("translations", language.ToString().ToLower() + ".json"); - if (File.Exists($"{folder}{relativeFile}")) + if (File.Exists(Path.Combine(folder, relativeFile))) { Logger.LogVerbose($"Registering {language} translation from {mod.ModHelper.Manifest.Name} from {relativeFile}"); - var config = new TranslationConfig($"{folder}{relativeFile}"); + var config = new TranslationConfig(Path.Combine(folder, relativeFile)); foundFile = true; From b3a9a4690c31738552fc5108533956d1a232a2cb Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 30 Sep 2022 20:50:45 -0700 Subject: [PATCH 22/22] use schema --- NewHorizons/Assets/addon-manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/NewHorizons/Assets/addon-manifest.json b/NewHorizons/Assets/addon-manifest.json index 9d8fd2a8..da53675c 100644 --- a/NewHorizons/Assets/addon-manifest.json +++ b/NewHorizons/Assets/addon-manifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/addon_manifest_schema.json", "credits": [ "xen#Mod Director\n#Programmer", "Bwc9876#Mod Manager\n#Programmer\n#Dev Ops",