From 68f2a851f4085bb1f26bd73928577985418e41b7 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 25 Aug 2024 09:21:55 +0100 Subject: [PATCH] path manager now returns alphabetically sorted lists --- project/code/LGS/ResourcePathManager.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/project/code/LGS/ResourcePathManager.cs b/project/code/LGS/ResourcePathManager.cs index 50f0cdb..7d2952b 100644 --- a/project/code/LGS/ResourcePathManager.cs +++ b/project/code/LGS/ResourcePathManager.cs @@ -84,11 +84,13 @@ public class ResourcePathManager return false; } - public string[] GetCampaignNames() + public List GetCampaignNames() { if (!_initialised) return null; - return _fmResources.Keys.ToArray(); + var names = new List(_fmResources.Keys); + names.Sort(); + return names; } public string GetMissionPath(string missionName) @@ -114,20 +116,24 @@ public class ResourcePathManager return null; } - public string[] GetMissionNames() + public List GetMissionNames() { if (!_initialised) return null; - return _omResources.missionPathMap.Keys.ToArray(); + var names = new List(_omResources.missionPathMap.Keys); + names.Sort(); + return names; } - public string[] GetMissionNames(string campaignName) + public List GetMissionNames(string campaignName) { if (!_initialised) return null; if (_fmResources.TryGetValue(campaignName, out var campaign)) { - return campaign.missionPathMap.Keys.ToArray(); + var names = new List(campaign.missionPathMap.Keys); + names.Sort(); + return names; } return null; }