From a330856fc882f55472ced3b72da1cc83a2fa7660 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Jul 2022 20:58:41 -0700 Subject: [PATCH 1/4] enable le sphere shape so it all works --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index e7417503..237335bb 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -236,7 +236,9 @@ namespace NewHorizons.Builder.Body fog._fogDensity *= scale; var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume"); - volumesShape.GetComponent().radius *= scale; + var sphereShape = volumesShape.GetComponent(); + sphereShape.enabled = true; // this starts disabled for some fucking reason + sphereShape.radius *= scale; // Change fog color if (body.Config.Bramble.dimension.fogTint != null) From d597d8f200319cddff00d1828b45a6e6801a1d4b Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Jul 2022 21:35:29 -0700 Subject: [PATCH 2/4] dont make dumb copies of the arc prefabs --- NewHorizons/Builder/Props/NomaiTextBuilder.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 8f71830c..94bdb871 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -45,31 +45,25 @@ 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 arcs = GameObject.FindObjectsOfType().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray(); _arcPrefabs = new List(); _childArcPrefabs = new List(); - foreach (var existingArc in existingArcs) + foreach (var arc in arcs) { - if (existingArc.GetComponent().material.name.Contains("Child")) + if (arc.GetComponent().material.name.Contains("Child")) { - var arc = existingArc.InstantiateInactive(); - arc.name = "Arc (Child)"; _childArcPrefabs.Add(arc); } else { - var arc = existingArc.InstantiateInactive(); - arc.name = "Arc"; _arcPrefabs.Add(arc); } } - var existingGhostArcs = GameObject.FindObjectsOfType().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray(); + var ghostArcs = GameObject.FindObjectsOfType().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray(); _ghostArcPrefabs = new List(); - foreach (var existingArc in existingGhostArcs) + foreach (var arc in ghostArcs) { - var arc = existingArc.InstantiateInactive(); - arc.name = "Arc"; _ghostArcPrefabs.Add(arc); } From d5101daec9f5f82b9878292810bcfa152834442a Mon Sep 17 00:00:00 2001 From: Ben C Date: Fri, 15 Jul 2022 01:23:16 -0400 Subject: [PATCH 3/4] Change SubtitlesHandler.cs to use FixedUpdate --- NewHorizons/Handlers/SubtitlesHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Handlers/SubtitlesHandler.cs b/NewHorizons/Handlers/SubtitlesHandler.cs index 737c6b0b..7255933c 100644 --- a/NewHorizons/Handlers/SubtitlesHandler.cs +++ b/NewHorizons/Handlers/SubtitlesHandler.cs @@ -87,7 +87,7 @@ namespace NewHorizons.Handlers possibleSubtitles.Add(sprite); } - public void Update() + public void FixedUpdate() { CheckForEOTE(); From 93101794bdf70d24b5af06332b001b04dffa14d8 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Jul 2022 22:34:15 -0700 Subject: [PATCH 4/4] just increment subtitle index by one instead of doing random stuff --- NewHorizons/Handlers/SubtitlesHandler.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/NewHorizons/Handlers/SubtitlesHandler.cs b/NewHorizons/Handlers/SubtitlesHandler.cs index 7255933c..d1cc0b00 100644 --- a/NewHorizons/Handlers/SubtitlesHandler.cs +++ b/NewHorizons/Handlers/SubtitlesHandler.cs @@ -26,8 +26,6 @@ namespace NewHorizons.Handlers public Sprite eoteSprite; public int subtitleIndex; - public System.Random randomizer; - public static readonly int PAUSE_TIMER_MAX = 50; public int pauseTimer = PAUSE_TIMER_MAX; @@ -45,8 +43,6 @@ namespace NewHorizons.Handlers public void Start() { - randomizer = new System.Random(); - GetComponent().alpha = 1; graphic = GetComponent(); image = GetComponent(); @@ -132,14 +128,7 @@ namespace NewHorizons.Handlers public void ChangeSubtitle() { - // to pick a new random subtitle without requiring retries, we generate a random offset less than the length of the possible subtitles array - // we then add that offset to the current index, modulo NUMBER_OF_POSSIBLE_SUBTITLES - // since the offset can never be NUMBER_OF_POSSIBLE_SUBTITLES, it will never wrap all the way back around to the initial subtitleIndex - - // note, this makes the code more confusing, but Random.Next(min, max) generates a random number on the range [min, max) - // that is, the below code will generate numbers up to and including Count-1, not Count. - var newIndexOffset = randomizer.Next(1, possibleSubtitles.Count); - subtitleIndex = (subtitleIndex + newIndexOffset) % possibleSubtitles.Count; + subtitleIndex = (subtitleIndex + 1) % possibleSubtitles.Count; image.sprite = possibleSubtitles[subtitleIndex]; }