Skip to content

Commit

Permalink
Allow toggling showing briefing on mission start in user settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Starkku committed Apr 9, 2024
1 parent 1e18c16 commit 01b4ab2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/AI-Scripting-and-Mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Ranking.OverParMessage= ; CSF entry key

### Show briefing dialog on startup

- 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).
- 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`.
- `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.
- 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.

Expand Down Expand Up @@ -100,6 +100,12 @@ ShowBriefingResumeButtonLabel=GUI:Resume ; CSF entry key
ShowBriefingResumeButtonStatusLabel=STT:BriefingButtonReturn ; CSF entry key
```

In `Ra2MD.ini`:
```ini
[Phobos]
ShowBriefing=true ; boolean
```

## Script Actions

### `10000-10999` Ingame Actions
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/Hooks.UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ DEFINE_HOOK(0x683E41, ScenarioClass_Start_ShowBriefing, 0x6)
GET_STACK(bool, showBriefing, STACK_OFFSET(0xFC, -0xE9));

// Don't show briefing dialog for non-campaign games etc.
if (!ScenarioExt::Global()->ShowBriefing || !showBriefing || !SessionClass::IsCampaign())
if (!Phobos::Config::ShowBriefing || !ScenarioExt::Global()->ShowBriefing || !showBriefing || !SessionClass::IsCampaign())
return 0;

BriefingTemp::ShowBriefing = true;
Expand Down
2 changes: 2 additions & 0 deletions src/Phobos.INI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ bool Phobos::Config::SkirmishUnlimitedColors = false;
bool Phobos::Config::ShowDesignatorRange = false;
bool Phobos::Config::SaveVariablesOnScenarioEnd = false;
bool Phobos::Config::SaveGameOnScenarioStart = true;
bool Phobos::Config::ShowBriefing = true;

bool Phobos::Misc::CustomGS = false;
int Phobos::Misc::CustomGS_ChangeInterval[7] = { -1, -1, -1, -1, -1, -1, -1 };
Expand All @@ -59,6 +60,7 @@ DEFINE_HOOK(0x5FACDF, OptionsClass_LoadSettings_LoadPhobosSettings, 0x5)
Phobos::Config::RealTimeTimers_Adaptive = CCINIClass::INI_RA2MD->ReadBool("Phobos", "RealTimeTimers.Adaptive", false);
Phobos::Config::DigitalDisplay_Enable = CCINIClass::INI_RA2MD->ReadBool("Phobos", "DigitalDisplay.Enable", false);
Phobos::Config::SaveGameOnScenarioStart = CCINIClass::INI_RA2MD->ReadBool("Phobos", "SaveGameOnScenarioStart", true);
Phobos::Config::ShowBriefing = CCINIClass::INI_RA2MD->ReadBool("Phobos", "ShowBriefing", true);

CCINIClass* pINI_UIMD = CCINIClass::LoadINIFile(GameStrings::UIMD_INI);

Expand Down
1 change: 1 addition & 0 deletions src/Phobos.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Phobos
static bool ShowDesignatorRange;
static bool SaveVariablesOnScenarioEnd;
static bool SaveGameOnScenarioStart;
static bool ShowBriefing;
};

class Misc
Expand Down

0 comments on commit 01b4ab2

Please sign in to comment.