Browse Source

Add OptionEntry Intro

pull/3594/head
obligaron 4 years ago committed by Anders Jenbo
parent
commit
d7a0cf8dbe
  1. 6
      Source/diablo.cpp
  2. 14
      Source/options.cpp
  3. 4
      Source/options.h

6
Source/diablo.cpp

@ -971,13 +971,11 @@ void DiabloSplash()
play_movie("gendata\\logo.smk", true);
if (gbIsHellfire && sgOptions.Hellfire.bIntro) {
if (gbIsHellfire && *sgOptions.Hellfire.intro) {
play_movie("gendata\\Hellfire.smk", true);
sgOptions.Hellfire.bIntro = false;
}
if (!gbIsHellfire && !gbIsSpawn && sgOptions.Diablo.bIntro) {
if (!gbIsHellfire && !gbIsSpawn && *sgOptions.Diablo.intro) {
play_movie("gendata\\diablo1.smk", true);
sgOptions.Diablo.bIntro = false;
}
UiTitleDialog();

14
Source/options.cpp

@ -242,10 +242,8 @@ void LoadOptions()
}
}
sgOptions.Diablo.bIntro = GetIniBool("Diablo", "Intro", true);
sgOptions.Diablo.lastSinglePlayerHero = GetIniInt("Diablo", "LastSinglePlayerHero", 0);
sgOptions.Diablo.lastMultiplayerHero = GetIniInt("Diablo", "LastMultiplayerHero", 0);
sgOptions.Hellfire.bIntro = GetIniBool("Hellfire", "Intro", true);
sgOptions.Hellfire.lastSinglePlayerHero = GetIniInt("Hellfire", "LastSinglePlayerHero", 0);
sgOptions.Hellfire.lastMultiplayerHero = GetIniInt("Hellfire", "LastMultiplayerHero", 0);
sgOptions.Hellfire.startUpGameOption = static_cast<StartUpGameOption>(GetIniInt("Hellfire", "StartUpGameOption", static_cast<int>(StartUpGameOption::None)));
@ -394,10 +392,8 @@ void SaveOptions()
}
}
SetIniValue("Diablo", "Intro", sgOptions.Diablo.bIntro);
SetIniValue("Diablo", "LastSinglePlayerHero", sgOptions.Diablo.lastSinglePlayerHero);
SetIniValue("Diablo", "LastMultiplayerHero", sgOptions.Diablo.lastMultiplayerHero);
SetIniValue("Hellfire", "Intro", sgOptions.Hellfire.bIntro);
SetIniValue("Hellfire", "SItem", sgOptions.Hellfire.szItem);
SetIniValue("Hellfire", "LastSinglePlayerHero", sgOptions.Hellfire.lastSinglePlayerHero);
SetIniValue("Hellfire", "LastMultiplayerHero", sgOptions.Hellfire.lastMultiplayerHero);
@ -584,20 +580,26 @@ string_view OptionCategoryBase::GetDescription() const
DiabloOptions::DiabloOptions()
: OptionCategoryBase("Diablo", N_("Diablo"), N_("Diablo specific Settings"))
, intro("Intro", OptionEntryFlags::OnlyDiablo, N_("Intro"), N_("Enable/disable Intro cinematic."), true)
{
}
std::vector<OptionEntryBase *> DiabloOptions::GetEntries()
{
return {};
return {
&intro,
};
}
HellfireOptions::HellfireOptions()
: OptionCategoryBase("Hellfire", N_("Hellfire"), N_("Hellfire specific Settings"))
, intro("Intro", OptionEntryFlags::OnlyHellfire, N_("Intro"), N_("Enable/disable Intro cinematic."), true)
{
}
std::vector<OptionEntryBase *> HellfireOptions::GetEntries()
{
return {};
return {
&intro,
};
}
AudioOptions::AudioOptions()

4
Source/options.h

@ -177,7 +177,7 @@ struct DiabloOptions : OptionCategoryBase {
std::vector<OptionEntryBase *> GetEntries() override;
/** @brief Play game intro video on startup. */
bool bIntro;
OptionEntryBoolean intro;
/** @brief Remembers what singleplayer hero/save was last used. */
std::uint32_t lastSinglePlayerHero;
/** @brief Remembers what multiplayer hero/save was last used. */
@ -189,7 +189,7 @@ struct HellfireOptions : OptionCategoryBase {
std::vector<OptionEntryBase *> GetEntries() override;
/** @brief Play game intro video on startup. */
bool bIntro;
OptionEntryBoolean intro;
/** @brief Cornerstone of the world item. */
char szItem[sizeof(ItemPack) * 2 + 1];
/** @brief Remembers what singleplayer hero/save was last used. */

Loading…
Cancel
Save