path manager now returns alphabetically sorted lists

This commit is contained in:
Jarrod Doyle 2024-08-25 09:21:55 +01:00
parent 3d41441f2a
commit 68f2a851f4
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 12 additions and 6 deletions

View File

@ -84,11 +84,13 @@ public class ResourcePathManager
return false; return false;
} }
public string[] GetCampaignNames() public List<string> GetCampaignNames()
{ {
if (!_initialised) return null; if (!_initialised) return null;
return _fmResources.Keys.ToArray(); var names = new List<string>(_fmResources.Keys);
names.Sort();
return names;
} }
public string GetMissionPath(string missionName) public string GetMissionPath(string missionName)
@ -114,20 +116,24 @@ public class ResourcePathManager
return null; return null;
} }
public string[] GetMissionNames() public List<string> GetMissionNames()
{ {
if (!_initialised) return null; if (!_initialised) return null;
return _omResources.missionPathMap.Keys.ToArray(); var names = new List<string>(_omResources.missionPathMap.Keys);
names.Sort();
return names;
} }
public string[] GetMissionNames(string campaignName) public List<string> GetMissionNames(string campaignName)
{ {
if (!_initialised) return null; if (!_initialised) return null;
if (_fmResources.TryGetValue(campaignName, out var campaign)) if (_fmResources.TryGetValue(campaignName, out var campaign))
{ {
return campaign.missionPathMap.Keys.ToArray(); var names = new List<string>(campaign.missionPathMap.Keys);
names.Sort();
return names;
} }
return null; return null;
} }