Skip to content

Commit 75ecfd9

Browse files
committed
Improve interaction of Phobos briefing features and potential spawner custom mission logic
1 parent 218c199 commit 75ecfd9

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

docs/AI-Scripting-and-Mapping.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ Ranking.OverParMessage= ; CSF entry key
7878

7979
### Show briefing dialog on startup
8080

81-
- You can now have the briefing dialog screen show up on singleplayer campaign mission startup by setting `ShowBriefing` to true in map file's `[Basic]` section, or in the map file's section in `missionmd.ini` (latter takes precedence over former if available). This can be disabled by user by setting `ShowBriefing` to false in `RA2MD.INI`.
82-
- `BriefingTheme` (In order of precedence from highest to lowest: `missionmd.ini`, map file, side entry in `rulesmd.ini`) can be used to define a custom theme to play on this briefing screen. If not set, the loading screen theme will keep playing until the scenario starts properly.
81+
- You can now have the briefing dialog screen show up on singleplayer campaign mission startup by setting `ShowBriefing` to true in map file's `[Basic]` section, or in the map file's section in `missionmd.ini` (former takes precedence if available). This can be disabled by user by setting `ShowBriefing` to false in `RA2MD.INI`.
82+
- `BriefingTheme` (In order of precedence from highest to lowest: map file, `missionmd.ini`, side entry in `rulesmd.ini`) can be used to define a custom theme to play on this briefing screen. If not set, the loading screen theme will keep playing until the scenario starts properly.
8383
- String labels for the startup briefing dialog screen's resume button as well as the button's status bar text can be customized by setting `ShowBriefingResumeButtonLabel` and `ShowBriefingResumeButtonStatusLabel` respectively. They default to the same labels used by the briefing screen dialog when opened otherwise.
8484

8585
In `missionmd.ini`:

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ You can use the migration utility (can be found on [Phobos supplementaries repo]
2121

2222
#### From post-0.3 devbuilds
2323

24+
- Parsing priority of `ShowBriefing` and `BriefingTheme` between map file and `missionmd.ini` has been switched (from latter taking priority over former to vice-versa) due to technical limitations and compatibility issues with spawner DLL.
2425
- Game will now produce fatal error with an error message if any of the files listed in `[$Include]` in any INI file do not exist.
2526
- Aircraft with weapons that have `Strafing.Shots` < 5 will now keep flying after last shot like those with `Strafing.Shots` >= 5 do. This delay can now be customized explicitly by setting `Strafing.EndDelay` on the weapon.
2627
- Selecting weapons other than primary against walls based on `Wall=true` on Warhead etc. now requires `[CombatDamage] -> AllowWeaponSelectAgainstWalls` to be set to true first.

src/Ext/Scenario/Body.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ void ScenarioExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
145145
ini_missionmd.ReadString(scenarioName, "Ranking.OverParTitle", pThis->OverParTitle, pThis->OverParTitle);
146146
ini_missionmd.ReadString(scenarioName, "Ranking.OverParMessage", pThis->OverParMessage, pThis->OverParMessage);
147147

148-
this->ShowBriefing = ini_missionmd.ReadBool(scenarioName, "ShowBriefing", pINI->ReadBool(GameStrings::Basic, "ShowBriefing", this->ShowBriefing));
149-
this->BriefingTheme = ini_missionmd.ReadTheme(scenarioName, "BriefingTheme", pINI->ReadTheme(GameStrings::Basic, "BriefingTheme", this->BriefingTheme));
150-
148+
this->ShowBriefing = pINI->ReadBool(GameStrings::Basic, "ShowBriefing", this->ShowBriefing);
149+
this->BriefingTheme = pINI->ReadTheme(GameStrings::Basic, "BriefingTheme", this->BriefingTheme);
151150
}
152151
}
153152

src/Ext/Scenario/Hooks.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <Helpers/Macro.h>
33
#include <Utilities/Debug.h>
44

5-
DEFINE_HOOK(0x6870D7, ReadScenario_LoadingScreens, 0x5)
5+
DEFINE_HOOK(0x6870D7, ReadScenario_MissionINI, 0x5)
66
{
77
enum { SkipGameCode = 0x6873AB };
88

@@ -12,17 +12,24 @@ DEFINE_HOOK(0x6870D7, ReadScenario_LoadingScreens, 0x5)
1212
auto const scenarioName = pScenario->FileName;
1313
auto const defaultsSection = "Defaults";
1414

15-
pScenario->LS640BriefLocX = pINI->ReadInteger(scenarioName, "LS640BriefLocX", pINI->ReadInteger(defaultsSection, "DefaultLS640BriefLocX", 0));
16-
pScenario->LS640BriefLocY = pINI->ReadInteger(scenarioName, "LS640BriefLocY", pINI->ReadInteger(defaultsSection, "DefaultLS640BriefLocY", 0));
17-
pScenario->LS800BriefLocX = pINI->ReadInteger(scenarioName, "LS800BriefLocX", pINI->ReadInteger(defaultsSection, "DefaultLS800BriefLocX", 0));
18-
pScenario->LS800BriefLocY = pINI->ReadInteger(scenarioName, "LS800BriefLocY", pINI->ReadInteger(defaultsSection, "DefaultLS800BriefLocY", 0));
19-
pINI->ReadString(defaultsSection, "DefaultLS640BkgdName", pScenario->LS640BkgdName, pScenario->LS640BkgdName, 64);
15+
CCINIClass ini_missionmd {};
16+
ini_missionmd.LoadFromFile(GameStrings::MISSIONMD_INI);
17+
18+
pScenario->LS640BriefLocX = pINI->ReadInteger(scenarioName, "LS640BriefLocX", ini_missionmd.ReadInteger(defaultsSection, "DefaultLS640BriefLocX", 0));
19+
pScenario->LS640BriefLocY = pINI->ReadInteger(scenarioName, "LS640BriefLocY", ini_missionmd.ReadInteger(defaultsSection, "DefaultLS640BriefLocY", 0));
20+
pScenario->LS800BriefLocX = pINI->ReadInteger(scenarioName, "LS800BriefLocX", ini_missionmd.ReadInteger(defaultsSection, "DefaultLS800BriefLocX", 0));
21+
pScenario->LS800BriefLocY = pINI->ReadInteger(scenarioName, "LS800BriefLocY", ini_missionmd.ReadInteger(defaultsSection, "DefaultLS800BriefLocY", 0));
22+
ini_missionmd.ReadString(defaultsSection, "DefaultLS640BkgdName", pScenario->LS640BkgdName, pScenario->LS640BkgdName, 64);
2023
pINI->ReadString(scenarioName, "LS640BkgdName", pScenario->LS640BkgdName, pScenario->LS640BkgdName, 64);
21-
pINI->ReadString(defaultsSection, "DefaultLS800BkgdName", pScenario->LS800BkgdName, pScenario->LS800BkgdName, 64);
24+
ini_missionmd.ReadString(defaultsSection, "DefaultLS800BkgdName", pScenario->LS800BkgdName, pScenario->LS800BkgdName, 64);
2225
pINI->ReadString(scenarioName, "LS800BkgdName", pScenario->LS800BkgdName, pScenario->LS800BkgdName, 64);
23-
pINI->ReadString(defaultsSection, "DefaultLS800BkgdPal", pScenario->LS800BkgdPal, pScenario->LS800BkgdPal, 64);
26+
ini_missionmd.ReadString(defaultsSection, "DefaultLS800BkgdPal", pScenario->LS800BkgdPal, pScenario->LS800BkgdPal, 64);
2427
pINI->ReadString(scenarioName, "LS800BkgdPal", pScenario->LS800BkgdPal, pScenario->LS800BkgdPal, 64);
2528

29+
auto const pScenarioExt = ScenarioExt::Global();
30+
pScenarioExt->ShowBriefing = pINI->ReadBool(scenarioName, "ShowBriefing", pScenarioExt->ShowBriefing);
31+
pScenarioExt->BriefingTheme = pINI->ReadTheme(scenarioName, "BriefingTheme", pScenarioExt->BriefingTheme);
32+
2633
return SkipGameCode;
2734
}
2835

0 commit comments

Comments
 (0)