From 6c49034e1e8b68d8b623db9b4b5da1c3ab714caa Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 18 Jul 2023 02:10:32 -0400 Subject: [PATCH] Allow system images to be in systems or planets folders Fixes #637 --- .../Components/ShipLog/ShipLogStarChartMode.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs index afdf5f2e..cae4a4b9 100644 --- a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs +++ b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs @@ -134,9 +134,18 @@ namespace NewHorizons.Components.ShipLog } else { - var path = Path.Combine("planets", uniqueID + ".png"); + var mod = Main.SystemDict[uniqueID].Mod; + + var path = Path.Combine("systems", uniqueID + ".png"); + + // Else check the old location + if (!File.Exists(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, path))) + { + path = Path.Combine("planets", uniqueID + ".png"); + } + NHLogger.LogVerbose($"ShipLogStarChartManager - Trying to load {path}"); - texture = ImageUtilities.GetTexture(Main.SystemDict[uniqueID].Mod, path); + texture = ImageUtilities.GetTexture(mod, path); } } catch (Exception) { }