move mission names to XML file
This commit is contained in:
parent
e3e67b0849
commit
df6b5bf10d
@ -1,70 +1,49 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Xml;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EDJournal {
|
namespace EDJournal {
|
||||||
public class HumanReadableMissionName {
|
public class HumanReadableMissionName {
|
||||||
/* TODO: make this a file at some point for easier editing.
|
private static Dictionary<string, string> humanreadable = null;
|
||||||
*/
|
|
||||||
private static readonly Dictionary<string, string> humanreadable = new Dictionary<string, string> {
|
private static void LoadMissions() {
|
||||||
{ "Mission_Assassinate_name", "Assassination" },
|
try {
|
||||||
{ "Mission_AltruismCredits_Bust_name", "Donate Credits (Bust)" },
|
string dir = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
{ "Mission_AltruismCredits_name", "Donate Credits" },
|
string file = Path.Combine(dir, "MissionNames.xml");
|
||||||
{ "Mission_Collect_Bust_name", "Provide (Bust)" },
|
|
||||||
{ "Mission_Collect_CivilLiberty_name", "Provide (Civil Liberty)" },
|
XmlDocument document = new XmlDocument();
|
||||||
{ "Mission_Collect_CivilUnrest_name", "Provide (Civil Unrest)" },
|
|
||||||
{ "Mission_Collect_Famine_name", "Provide (Famine)" },
|
using (FileStream stream = new FileStream(file, FileMode.Open)) {
|
||||||
{ "Mission_Collect_Industrial_name", "Provide (Industrial)" },
|
document.Load(stream);
|
||||||
{ "Mission_Collect_name", "Provide" },
|
XmlNode missions = document.DocumentElement;
|
||||||
{ "Mission_Courier_Democracy_name", "Courier (Democracy)" },
|
|
||||||
{ "Mission_Courier_Elections_name", "Courier (Elections)" },
|
if (missions == null || missions.Name != "Missions") {
|
||||||
{ "Mission_Courier_Expansion_name", "Courier (Expansion)" },
|
throw new ApplicationException("Invalid XML");
|
||||||
{ "Mission_Courier_Famine_name", "Courier (Famine)" },
|
}
|
||||||
{ "Mission_Courier_Lockdown_name", "Courier (Lockdown)" },
|
|
||||||
{ "Mission_Courier_name", "Courier" },
|
humanreadable = new Dictionary<string, string>();
|
||||||
{ "Mission_Courier_RankEmp_name", "Courier (Empire)" },
|
|
||||||
{ "Mission_Delivery_Agriculture_name", "Delivery (Agriculture)" },
|
foreach (XmlNode mission in missions.ChildNodes) {
|
||||||
{ "Mission_Delivery_Boom_name", "Delivery (Boom)" },
|
string mission_key = mission.Attributes["Name"]?.Value;
|
||||||
{ "Mission_Delivery_Democracy_name", "Delivery (Democracy)" },
|
string mission_name = mission.InnerText;
|
||||||
{ "Mission_Delivery_Investment_name", "Delivery (Investment)" },
|
|
||||||
{ "Mission_Delivery_name", "Delivery" },
|
if (mission_key == null || mission_name == null) {
|
||||||
{ "Mission_Delivery_RankEmp_name", "Delivery (Imperial Rank)" },
|
continue;
|
||||||
{ "Mission_Delivery_Retreat_name", "Delivery (Retreat)" },
|
}
|
||||||
{ "Mission_Hack_BLOPS_Boom_name", "Hack Surface Installation (Boom)" },
|
|
||||||
{ "Mission_Hack_BLOPS_Expansion_name", "Hack Surface Installation (Expansion)" },
|
humanreadable.Add(mission_key, mission_name);
|
||||||
{ "Mission_HackMegaship_name", "Hack Megaship" },
|
}
|
||||||
{ "Mission_LongDistanceExpedition_name", "Long Distance Expedition" },
|
}
|
||||||
{ "Mission_Massacre_Conflict_CivilWar_name", "Massacre (Civil War)" },
|
} catch (Exception) {
|
||||||
{ "Mission_Massacre_name", "Massacre" },
|
humanreadable = null;
|
||||||
{ "Mission_Massacre_RankEmp_name", "Massacre (Imperial Navy)" },
|
}
|
||||||
{ "Mission_MassacreWing_Legal_Bust_name", "Massacre (Wing) (Bust)" },
|
}
|
||||||
{ "Mission_MassacreWing_name", "Massacre (Wing)" },
|
|
||||||
{ "Mission_OnFoot_Collect_MB_name", "On Foot Collection" },
|
|
||||||
{ "Mission_OnFoot_Onslaught_MB_name", "On Foot Onslaught" },
|
|
||||||
{ "Mission_OnFoot_Onslaught_Offline_MB_name", "On Foot Onslaught (Offline)" },
|
|
||||||
{ "Mission_OnFoot_ProductionHeist_Covert_MB_name", "On Foot Production Heist (Covert)" },
|
|
||||||
{ "Mission_OnFoot_Reboot_MB_name", "On Foot Reboot" },
|
|
||||||
{ "Mission_OnFoot_RebootRestore_MB_name", "On Foot Reboot/Restore" },
|
|
||||||
{ "Mission_OnFoot_Sabotage_Production_Covert_MB_name", "On Foot Sabotage Production (Covert)" },
|
|
||||||
{ "Mission_OnFoot_Salvage_MB_name", "On Foot Salvage" },
|
|
||||||
{ "Mission_PassengerVIP_name", "Passenger (VIP)" },
|
|
||||||
{ "Mission_PassengerVIP_Scientist_FAMINE_name", "Passenger (VIP) (Famine)" },
|
|
||||||
{ "Mission_Rescue_Planet_name", "Planet Rescue" },
|
|
||||||
{ "MISSION_Salvage_CivilUnrest_name", "Salvage (Civil Unrest)" },
|
|
||||||
{ "MISSION_Salvage_Expansion_name", "Salvage (Expansion)" },
|
|
||||||
{ "MISSION_Salvage_Illegal_name", "Salvage (Illegal)" },
|
|
||||||
{ "Mission_Salvage_name", "Salvage" },
|
|
||||||
{ "Mission_Salvage_RankEmp_name", "Salvage (Imperial Navy)" },
|
|
||||||
{ "MISSION_Salvage_Retreat_name", "Salvage (Retreat)" },
|
|
||||||
{ "MISSION_Scan_name", "Scan" },
|
|
||||||
{ "Mission_Sightseeing_Criminal_FAMINE_name", "Sightseeing (Criminal) (Famine)" },
|
|
||||||
{ "Mission_Sightseeing_name", "Sightseeing" },
|
|
||||||
};
|
|
||||||
|
|
||||||
public static string MakeHumanReadableName(string name) {
|
public static string MakeHumanReadableName(string name) {
|
||||||
if (name == null) {
|
LoadMissions();
|
||||||
|
|
||||||
|
if (humanreadable == null || name == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
65
MissionNames.xml
Normal file
65
MissionNames.xml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Missions>
|
||||||
|
<Mission Name="Chain_RegainFooting_name">Regain Footing (Chain)</Mission>
|
||||||
|
<Mission Name="Mission_Altruism_name">Donate</Mission>
|
||||||
|
<Mission Name="Mission_AltruismCredits_Bust_name">Donate Credits (Bust)</Mission>
|
||||||
|
<Mission Name="Mission_AltruismCredits_name">Donate Credits</Mission>
|
||||||
|
<Mission Name="Mission_Assassinate_Legal_Corporate_name">Corporate Assassination (Legal)</Mission>
|
||||||
|
<Mission Name="Mission_Assassinate_name">Assassination</Mission>
|
||||||
|
<Mission Name="Mission_Collect_Bust_name">Provide (Bust)</Mission>
|
||||||
|
<Mission Name="Mission_Collect_CivilLiberty_name">Provide (Civil Liberty)</Mission>
|
||||||
|
<Mission Name="Mission_Collect_CivilUnrest_name">Provide (Civil Unrest)</Mission>
|
||||||
|
<Mission Name="Mission_Collect_Famine_name">Provide (Famine)</Mission>
|
||||||
|
<Mission Name="Mission_Collect_Industrial_name">Provide (Industrial)</Mission>
|
||||||
|
<Mission Name="Mission_Collect_name">Provide</Mission>
|
||||||
|
<Mission Name="Mission_Courier_Democracy_name">Courier (Democracy)</Mission>
|
||||||
|
<Mission Name="Mission_Courier_Elections_name">Courier (Elections)</Mission>
|
||||||
|
<Mission Name="Mission_Courier_Expansion_name">Courier (Expansion)</Mission>
|
||||||
|
<Mission Name="Mission_Courier_Famine_name">Courier (Famine)</Mission>
|
||||||
|
<Mission Name="Mission_Courier_Lockdown_name">Courier (Lockdown)</Mission>
|
||||||
|
<Mission Name="Mission_Courier_name">Courier</Mission>
|
||||||
|
<Mission Name="Mission_Courier_RankEmp_name">Courier (Empire)</Mission>
|
||||||
|
<Mission Name="Mission_Delivery_Agriculture_name">Delivery (Agriculture)</Mission>
|
||||||
|
<Mission Name="Mission_Delivery_Boom_name">Delivery (Boom)</Mission>
|
||||||
|
<Mission Name="Mission_Delivery_Democracy_name">Delivery (Democracy)</Mission>
|
||||||
|
<Mission Name="Mission_Delivery_Investment_name">Delivery (Investment)</Mission>
|
||||||
|
<Mission Name="Mission_Delivery_name">Delivery</Mission>
|
||||||
|
<Mission Name="Mission_Delivery_RankEmp_name">Delivery (Imperial Rank)</Mission>
|
||||||
|
<Mission Name="Mission_Delivery_Retreat_name">Delivery (Retreat)</Mission>
|
||||||
|
<Mission Name="Mission_Hack_BLOPS_Boom_name">Hack Surface Installation (Boom)</Mission>
|
||||||
|
<Mission Name="Mission_Hack_BLOPS_Expansion_name">Hack Surface Installation (Expansion)</Mission>
|
||||||
|
<Mission Name="MISSION_Hack_BLOPS_name">Hack Surface Installation</Mission>
|
||||||
|
<Mission Name="Mission_HackMegaship_name">Hack Megaship</Mission>
|
||||||
|
<Mission Name="Mission_LongDistanceExpedition_name">Long Distance Expedition</Mission>
|
||||||
|
<Mission Name="Mission_Massacre_Conflict_CivilWar_name">Massacre (Civil War)</Mission>
|
||||||
|
<Mission Name="Mission_Massacre_name">Massacre</Mission>
|
||||||
|
<Mission Name="Mission_Massacre_RankEmp_name">Massacre (Imperial Navy)</Mission>
|
||||||
|
<Mission Name="Mission_MassacreWing_Legal_Bust_name">Massacre (Wing) (Bust)</Mission>
|
||||||
|
<Mission Name="Mission_MassacreWing_name">Massacre (Wing)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Assassination_MB_name">On Foot Assassination</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_AssassinationIllegal_MB_name">On Foot Assassination (Illegal)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Collect_Contact_MB_name">On Foot Collect</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Collect_MB_name">On Foot Collection</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Delivery_Contact_MB_name">On Foot Delivery (Contact)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Heist_POI_MB_name">On Foot Heist (POI)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Onslaught_MB_name">On Foot Onslaught</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Onslaught_Offline_MB_name">On Foot Onslaught (Offline)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_ProductionHeist_Covert_MB_name">On Foot Production Heist (Covert)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_ProductionHeist_MB_name">On Foot Production Heist</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Reboot_MB_name">On Foot Reboot</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_RebootRestore_MB_name">On Foot Reboot/Restore</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Sabotage_Production_Covert_MB_name">On Foot Sabotage Production (Covert)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Salvage_MB_name">On Foot Salvage</Mission>
|
||||||
|
<Mission Name="Mission_PassengerVIP_name">Passenger (VIP)</Mission>
|
||||||
|
<Mission Name="Mission_PassengerVIP_Scientist_FAMINE_name">Passenger (VIP) (Famine)</Mission>
|
||||||
|
<Mission Name="Mission_Rescue_Planet_name">Planet Rescue</Mission>
|
||||||
|
<Mission Name="MISSION_Salvage_CivilUnrest_name">Salvage (Civil Unrest)</Mission>
|
||||||
|
<Mission Name="MISSION_Salvage_Expansion_name">Salvage (Expansion)</Mission>
|
||||||
|
<Mission Name="MISSION_Salvage_Illegal_name">Salvage (Illegal)</Mission>
|
||||||
|
<Mission Name="Mission_Salvage_name">Salvage</Mission>
|
||||||
|
<Mission Name="Mission_Salvage_RankEmp_name">Salvage (Imperial Navy)</Mission>
|
||||||
|
<Mission Name="MISSION_Salvage_Retreat_name">Salvage (Retreat)</Mission>
|
||||||
|
<Mission Name="MISSION_Scan_name">Scan</Mission>
|
||||||
|
<Mission Name="Mission_Sightseeing_Criminal_FAMINE_name">Sightseeing (Criminal) (Famine)</Mission>
|
||||||
|
<Mission Name="Mission_Sightseeing_name">Sightseeing</Mission>
|
||||||
|
</Missions>
|
@ -37,6 +37,8 @@
|
|||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BountyEntry.cs" />
|
<Compile Include="BountyEntry.cs" />
|
||||||
@ -77,6 +79,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="LICENCE.txt" />
|
<Content Include="LICENCE.txt" />
|
||||||
|
<Content Include="MissionNames.xml">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user