diff --git a/docs/AI-Scripting-and-Mapping.md b/docs/AI-Scripting-and-Mapping.md index f23f26aff6..29aac42aaf 100644 --- a/docs/AI-Scripting-and-Mapping.md +++ b/docs/AI-Scripting-and-Mapping.md @@ -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. @@ -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 diff --git a/src/Misc/Hooks.UI.cpp b/src/Misc/Hooks.UI.cpp index 8afd4f7c71..01a1f24deb 100644 --- a/src/Misc/Hooks.UI.cpp +++ b/src/Misc/Hooks.UI.cpp @@ -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; diff --git a/src/Phobos.INI.cpp b/src/Phobos.INI.cpp index 68b9586dfa..cfe8ba463f 100644 --- a/src/Phobos.INI.cpp +++ b/src/Phobos.INI.cpp @@ -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 }; @@ -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); diff --git a/src/Phobos.h b/src/Phobos.h index 6090d14a48..ce57102e09 100644 --- a/src/Phobos.h +++ b/src/Phobos.h @@ -80,6 +80,7 @@ class Phobos static bool ShowDesignatorRange; static bool SaveVariablesOnScenarioEnd; static bool SaveGameOnScenarioStart; + static bool ShowBriefing; }; class Misc