From 746c84228da58e1198c4c4485ff73e0846b99e7c Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Fri, 7 Jun 2024 13:51:18 -0400 Subject: [PATCH 1/5] Fix NRE in NHSupernovaPlanetEffectController --- .../Components/Props/NHSupernovaPlanetEffectController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs b/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs index 0f87cca32..7b08bddd5 100644 --- a/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs +++ b/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs @@ -188,7 +188,11 @@ public void Update() { for (int i = 0; i < _ambientLight.Length; i++) { - _ambientLight[i].intensity = _ambientLightOrigIntensity[i] * (1f - collapseProgress); + var ambientLight = _ambientLight[i]; + if (ambientLight != null) + { + ambientLight.intensity = _ambientLightOrigIntensity[i] * (1f - collapseProgress); + } } } From 08e5fa2876da6b39d215676698e08b2b109b7ede Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 12 Jun 2024 20:37:07 -0400 Subject: [PATCH 2/5] Map mode position outsider compat --- NewHorizons/Builder/ShipLog/MapModeBuilder.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs index 15b753bc2..22039b4cd 100644 --- a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs @@ -31,6 +31,19 @@ public static ShipLogAstroObject[][] ConstructMapMode(string systemName, GameObj foreach (var shipLogAstroObject in currentNav.SelectMany(x => x)) { var astroObject = Locator.GetAstroObject(AstroObject.StringIDToAstroObjectName(shipLogAstroObject._id)); + if (astroObject == null) + { + // Outsider compat + if (shipLogAstroObject._id == "POWER_STATION") + { + astroObject = GameObject.FindObjectsOfType().FirstOrDefault(x => x._customName == "Power Station"); + } + else + { + NHLogger.LogError($"Couldn't find stock (?) astro object [{shipLogAstroObject?._id}]"); + continue; + } + } _astroObjectToShipLog[astroObject.gameObject] = shipLogAstroObject; } From abfb3246d6dced6bfbfa1da54c70b3a11615f4de Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 12 Jun 2024 20:37:17 -0400 Subject: [PATCH 3/5] 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 205ce96a1..1a7cdab3f 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Clay, Trifid, and friends", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.21.1", + "version": "1.21.2", "owmlVersion": "2.12.1", "dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "PacificEngine.OW_CommonResources" ], From dc3f10ba33aae33f6639d6c809d1f916aedbcd12 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 12 Jun 2024 20:51:26 -0400 Subject: [PATCH 4/5] Try stopping duplicate system cards --- .../Components/ShipLog/ShipLogStarChartMode.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs index 57d48c35d..2c1828d17 100644 --- a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs +++ b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs @@ -34,10 +34,13 @@ public class ShipLogStarChartMode : ShipLogMode private int _nextCardIndex; + private HashSet _systemCards = new(); + private void Awake() { // Prompts Locator.GetPromptManager().AddScreenPrompt(_warpPrompt, PromptPosition.UpperLeft, false); + _systemCards.Clear(); } public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource) @@ -70,8 +73,15 @@ public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptL public void AddSystemCard(string uniqueID) { - var card = CreateCard(uniqueID, root.transform, new Vector2(_nextCardIndex++ * 200, 0)); - _starSystemCards.Add(card); + if (!_systemCards.Contains(uniqueID)) + { + var card = CreateCard(uniqueID, root.transform, new Vector2(_nextCardIndex++ * 200, 0)); + _starSystemCards.Add(card); + } + else + { + NHLogger.LogWarning($"Tried making duplicate system card {uniqueID}"); + } } public void OnDestroy() From 7dbf7c1e15e06bab9ecf67759b891bb2b340ca16 Mon Sep 17 00:00:00 2001 From: Ben C Date: Wed, 12 Jun 2024 22:15:24 -0400 Subject: [PATCH 5/5] Update all the actions --- .github/workflows/build.yaml | 10 +++++----- .github/workflows/docs_build.yml | 6 +++--- .github/workflows/release_build.yml | 4 ++-- .github/workflows/update_schemas.yml | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 87a087a78..5a040682c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,10 +29,10 @@ jobs: schemas_changed: ${{ steps.changed_files.outputs.files_changed }} steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 # Disable Strong Name Verification to let us pull a switch-a-roo - name: Disable strong name validation @@ -51,19 +51,19 @@ jobs: run: rm .\NewHorizons\bin\${{ inputs.build_type }}\NewHorizons.xml - name: Upload Mod Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: xen.NewHorizons.${{ inputs.build_type }} path: .\NewHorizons\bin\${{ inputs.build_type }} - name: Upload Schemas Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: NewHorizons-Schemas-${{ inputs.build_type }} path: .\NewHorizons\Schemas - name: Verify Changed Schemas - uses: tj-actions/verify-changed-files@v17 + uses: tj-actions/verify-changed-files@v20 id: changed_files with: files: NewHorizons/Schemas/** diff --git a/.github/workflows/docs_build.yml b/.github/workflows/docs_build.yml index 7511a4bbf..af14ae809 100644 --- a/.github/workflows/docs_build.yml +++ b/.github/workflows/docs_build.yml @@ -29,10 +29,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download Schemas if: ${{ inputs.schemas_artifact != 'null' }} - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.schemas_artifact }} path: NewHorizons/Schemas @@ -55,4 +55,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index d27381cc2..c2aab5038 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: Read Manifest id: read-manifest uses: notiz-dev/github-action-json-property@release @@ -66,7 +66,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download Asset - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: xen.NewHorizons.Release path: xen.NewHorizons diff --git a/.github/workflows/update_schemas.yml b/.github/workflows/update_schemas.yml index 9f9a41947..f570ec90f 100644 --- a/.github/workflows/update_schemas.yml +++ b/.github/workflows/update_schemas.yml @@ -18,12 +18,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.SCHEMAS_TOKEN }} - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.artifact_name }} path: NewHorizons/Schemas/