Add OptionEntry Shareware and remove specials from settingsmenu
This commit is contained in:
parent
b5ab9758d0
commit
db392c84b0
4 changed files with 12 additions and 14 deletions
|
|
@ -26,7 +26,6 @@ Rectangle rectDescription;
|
|||
enum class SpecialMenuEntry {
|
||||
None = -1,
|
||||
PreviousMenu = -2,
|
||||
ToggleSpawn = -4,
|
||||
};
|
||||
|
||||
bool IsValidEntry(OptionEntryBase *pOptionEntry)
|
||||
|
|
@ -70,11 +69,6 @@ void ItemSelected(int value)
|
|||
case SpecialMenuEntry::PreviousMenu:
|
||||
endMenu = true;
|
||||
break;
|
||||
case SpecialMenuEntry::ToggleSpawn:
|
||||
gbIsSpawn = !gbIsSpawn;
|
||||
endMenu = true;
|
||||
recreateUI = true;
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -130,13 +124,8 @@ void UiSettingsMenu()
|
|||
vecDialog.push_back(std::make_unique<UiScrollbar>(&ArtScrollBarBackground, &ArtScrollBarThumb, &ArtScrollBarArrow, MakeSdlRect(rectList.position.x + rectList.size.width + 5, rectList.position.y, 25, rectList.size.height)));
|
||||
vecDialog.push_back(std::make_unique<UiArtText>(optionDescription, MakeSdlRect(rectDescription), UiFlags::FontSize12 | UiFlags::ColorUiSilverDark | UiFlags::AlignCenter, 1, IsSmallFontTall() ? 22 : 18));
|
||||
|
||||
if (diabdat_mpq)
|
||||
vecDialogItems.push_back(std::make_unique<UiListItem>(gbIsSpawn ? _("Switch to Fullgame") : _("Switch to Shareware"), static_cast<int>(SpecialMenuEntry::ToggleSpawn), UiFlags::ColorUiGold));
|
||||
|
||||
bool switchOptionExists = vecDialogItems.size() > 0;
|
||||
int catCount = switchOptionExists ? 1 : 0;
|
||||
|
||||
size_t itemToSelect = switchOptionExists ? 0 : 1;
|
||||
size_t catCount = 0;
|
||||
size_t itemToSelect = 1;
|
||||
|
||||
for (auto *pCategory : sgOptions.GetCategories()) {
|
||||
bool categoryCreated = false;
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ void DiabloInit()
|
|||
init_archives();
|
||||
was_archives_init = true;
|
||||
|
||||
if (forceSpawn)
|
||||
if (forceSpawn || *sgOptions.StartUp.shareware)
|
||||
gbIsSpawn = true;
|
||||
if (forceDiablo || *sgOptions.StartUp.gameMode == StartUpGameMode::Diablo)
|
||||
gbIsHellfire = false;
|
||||
|
|
|
|||
|
|
@ -247,6 +247,11 @@ void OptionGameModeChanged()
|
|||
gbIsHellfire = *sgOptions.StartUp.gameMode == StartUpGameMode::Hellfire;
|
||||
}
|
||||
|
||||
void OptionSharewareChanged()
|
||||
{
|
||||
gbIsSpawn = *sgOptions.StartUp.shareware;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void SetIniValue(const char *sectionName, const char *keyName, const char *value, int len)
|
||||
|
|
@ -521,6 +526,7 @@ StartUpOptions::StartUpOptions()
|
|||
// Ask is missing, cause we want to hide it from UI-Settings.
|
||||
{ StartUpGameMode::Hellfire, N_("Hellfire") },
|
||||
})
|
||||
, shareware("Shareware", OptionEntryFlags::NeedDiabloMpq | OptionEntryFlags::RecreateUI, N_("Restrict to Shareware"), N_("Makes the game compatible with the demo. Enables multiplayer with friends who don't own a full copy of Diablo."), false)
|
||||
, diabloIntro("Diablo Intro", OptionEntryFlags::OnlyDiablo, N_("Intro"), N_("Shown Intro cinematic."), StartUpIntro::Once,
|
||||
{
|
||||
{ StartUpIntro::Off, N_("OFF") },
|
||||
|
|
@ -541,11 +547,13 @@ StartUpOptions::StartUpOptions()
|
|||
})
|
||||
{
|
||||
gameMode.SetValueChangedCallback(OptionGameModeChanged);
|
||||
shareware.SetValueChangedCallback(OptionSharewareChanged);
|
||||
}
|
||||
std::vector<OptionEntryBase *> StartUpOptions::GetEntries()
|
||||
{
|
||||
return {
|
||||
&gameMode,
|
||||
&shareware,
|
||||
&diabloIntro,
|
||||
&hellfireIntro,
|
||||
&splash,
|
||||
|
|
|
|||
|
|
@ -236,6 +236,7 @@ struct StartUpOptions : OptionCategoryBase {
|
|||
std::vector<OptionEntryBase *> GetEntries() override;
|
||||
|
||||
OptionEntryEnum<StartUpGameMode> gameMode;
|
||||
OptionEntryBoolean shareware;
|
||||
/** @brief Play game intro video on diablo startup. */
|
||||
OptionEntryEnum<StartUpIntro> diabloIntro;
|
||||
/** @brief Play game intro video on hellfire startup. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue