Browse Source

Move Intro Options to StartUp-Section and add a "Once"-Option

pull/3643/head
obligaron 4 years ago committed by Anders Jenbo
parent
commit
8fc2fcd9e9
  1. 14
      Source/diablo.cpp
  2. 24
      Source/options.cpp
  3. 14
      Source/options.h

14
Source/diablo.cpp

@ -973,11 +973,15 @@ void DiabloSplash()
if (*sgOptions.StartUp.splash == StartUpSplash::LogoAndTitleDialog)
play_movie("gendata\\logo.smk", true);
if (gbIsHellfire && *sgOptions.Hellfire.intro) {
play_movie("gendata\\Hellfire.smk", true);
}
if (!gbIsHellfire && !gbIsSpawn && *sgOptions.Diablo.intro) {
play_movie("gendata\\diablo1.smk", true);
auto &intro = gbIsHellfire ? sgOptions.StartUp.hellfireIntro : sgOptions.StartUp.diabloIntro;
if (*intro != StartUpIntro::Off) {
if (gbIsHellfire)
play_movie("gendata\\Hellfire.smk", true);
else
play_movie("gendata\\diablo1.smk", true);
if (*intro == StartUpIntro::Once)
intro.SetValue(StartUpIntro::Off);
}
if (IsAnyOf(*sgOptions.StartUp.splash, StartUpSplash::TitleDialog, StartUpSplash::LogoAndTitleDialog))

24
Source/options.cpp

@ -565,6 +565,18 @@ string_view OptionCategoryBase::GetDescription() const
StartUpOptions::StartUpOptions()
: OptionCategoryBase("StartUp", N_("Start Up"), N_("Start Up Settings"))
, diabloIntro("Diablo Intro", OptionEntryFlags::OnlyDiablo, N_("Intro"), N_("Shown Intro cinematic."), StartUpIntro::Once,
{
{ StartUpIntro::Off, N_("OFF") },
// Once is missing, cause we want to hide it from UI-Settings.
{ StartUpIntro::On, N_("ON") },
})
, hellfireIntro("Hellfire Intro", OptionEntryFlags::OnlyHellfire, N_("Intro"), N_("Shown Intro cinematic."), StartUpIntro::Once,
{
{ StartUpIntro::Off, N_("OFF") },
// Once is missing, cause we want to hide it from UI-Settings.
{ StartUpIntro::On, N_("ON") },
})
, splash("Splash", OptionEntryFlags::None, N_("Splash"), N_("Shown splash screen."), StartUpSplash::LogoAndTitleDialog,
{
{ StartUpSplash::LogoAndTitleDialog, N_("Logo and Title Screen") },
@ -576,32 +588,28 @@ StartUpOptions::StartUpOptions()
std::vector<OptionEntryBase *> StartUpOptions::GetEntries()
{
return {
&diabloIntro,
&hellfireIntro,
&splash,
};
}
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 {
&intro,
};
return {};
}
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 {
&intro,
};
return {};
}
AudioOptions::AudioOptions()

14
Source/options.h

@ -16,6 +16,12 @@ enum class StartUpGameOption {
Diablo,
};
enum class StartUpIntro {
Off = 0,
Once = 1,
On = 2,
};
/** @brief Defines what splash screen should be shown at startup. */
enum class StartUpSplash {
/** @brief Show no splash screen. */
@ -197,6 +203,10 @@ struct StartUpOptions : OptionCategoryBase {
StartUpOptions();
std::vector<OptionEntryBase *> GetEntries() override;
/** @brief Play game intro video on diablo startup. */
OptionEntryEnum<StartUpIntro> diabloIntro;
/** @brief Play game intro video on hellfire startup. */
OptionEntryEnum<StartUpIntro> hellfireIntro;
OptionEntryEnum<StartUpSplash> splash;
};
@ -204,8 +214,6 @@ struct DiabloOptions : OptionCategoryBase {
DiabloOptions();
std::vector<OptionEntryBase *> GetEntries() override;
/** @brief Play game intro video on startup. */
OptionEntryBoolean intro;
/** @brief Remembers what singleplayer hero/save was last used. */
std::uint32_t lastSinglePlayerHero;
/** @brief Remembers what multiplayer hero/save was last used. */
@ -216,8 +224,6 @@ struct HellfireOptions : OptionCategoryBase {
HellfireOptions();
std::vector<OptionEntryBase *> GetEntries() override;
/** @brief Play game intro video on startup. */
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