From 9ae75a693ebde5e07f5dbb1f203484bb286bdfff Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Thu, 5 Sep 2024 17:31:59 +0100 Subject: [PATCH] Add GetModelNames method --- project/code/LGS/ResourcePathManager.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/project/code/LGS/ResourcePathManager.cs b/project/code/LGS/ResourcePathManager.cs index 7c71c00..84c8e83 100644 --- a/project/code/LGS/ResourcePathManager.cs +++ b/project/code/LGS/ResourcePathManager.cs @@ -142,6 +142,25 @@ public class ResourcePathManager return null; } + public List GetModelNames(string campaignName) + { + if (!_initialised) return null; + + if (campaignName == null || campaignName == "") + { + var names = new List(_omResources.objectPathMap.Keys); + names.Sort(); + return names; + } + else if (_fmResources.TryGetValue(campaignName, out var campaign)) + { + var names = new List(campaign.objectPathMap.Keys); + names.Sort(); + return names; + } + return null; + } + // TODO: OMs fail to find a path, but FMs using OM textures do find them // The OMs still fail even if I put them in a folder with FMs that work=?? public string GetTexturePath(string campaignName, string textureName)