From 77ea90013afb0ede62e4762707f745f7b59a0016 Mon Sep 17 00:00:00 2001 From: Kerbiter Date: Thu, 17 Aug 2023 13:21:19 +0300 Subject: [PATCH] Support Ra2Mode in campaign through RequiredAddon=false --- DXMainClient/DXGUI/Generic/CampaignSelector.cs | 4 ++++ DXMainClient/Domain/Mission.cs | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/DXMainClient/DXGUI/Generic/CampaignSelector.cs b/DXMainClient/DXGUI/Generic/CampaignSelector.cs index 6bd0e77ea..9aae7c6bf 100644 --- a/DXMainClient/DXGUI/Generic/CampaignSelector.cs +++ b/DXMainClient/DXGUI/Generic/CampaignSelector.cs @@ -284,7 +284,11 @@ private void LaunchMission(Mission mission) spawnStreamWriter.WriteLine("CampaignID=" + mission.Index); spawnStreamWriter.WriteLine("GameSpeed=" + UserINISettings.Instance.GameSpeed); +#if YR || ARES + spawnStreamWriter.WriteLine("Ra2Mode=" + !mission.RequiredAddon); +#else spawnStreamWriter.WriteLine("Firestorm=" + mission.RequiredAddon); +#endif spawnStreamWriter.WriteLine("CustomLoadScreen=" + LoadingScreenController.GetLoadScreenName(mission.Side.ToString())); spawnStreamWriter.WriteLine("IsSinglePlayer=Yes"); spawnStreamWriter.WriteLine("SidebarHack=" + ClientConfiguration.Instance.SidebarHack); diff --git a/DXMainClient/Domain/Mission.cs b/DXMainClient/Domain/Mission.cs index 0ddcc1cfc..b587fcfc5 100644 --- a/DXMainClient/Domain/Mission.cs +++ b/DXMainClient/Domain/Mission.cs @@ -26,7 +26,13 @@ public Mission(IniFile iniFile, string sectionName, int index) .FromIniString() .L10N($"INI:Missions:{sectionName}:LongDescription"); FinalMovie = iniFile.GetStringValue(sectionName, nameof(FinalMovie), "none"); - RequiredAddon = iniFile.GetBooleanValue(sectionName, nameof(RequiredAddon), false); + RequiredAddon = iniFile.GetBooleanValue(sectionName, nameof(RequiredAddon), +#if YR || ARES + true // In case of YR this toggles Ra2Mode instead which should not be default +#else + false +#endif + ); Enabled = iniFile.GetBooleanValue(sectionName, nameof(Enabled), true); BuildOffAlly = iniFile.GetBooleanValue(sectionName, nameof(BuildOffAlly), false); PlayerAlwaysOnNormalDifficulty = iniFile.GetBooleanValue(sectionName, nameof(PlayerAlwaysOnNormalDifficulty), false);