Skip to content

Commit

Permalink
Support Ra2Mode in campaign through RequiredAddon=false
Browse files Browse the repository at this point in the history
  • Loading branch information
Metadorius authored Aug 17, 2023
1 parent da6aa4d commit 77ea900
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions DXMainClient/DXGUI/Generic/CampaignSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion DXMainClient/Domain/Mission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 77ea900

Please sign in to comment.