From 43841477bc71b74b20ecd776f8cbc0c74cdec61d Mon Sep 17 00:00:00 2001 From: obligaron Date: Sun, 7 Nov 2021 23:58:04 +0100 Subject: [PATCH] Add OptionEntry Test Bard --- Source/DiabloUI/selhero.cpp | 2 +- Source/items.cpp | 2 +- Source/options.cpp | 4 ++-- Source/options.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/DiabloUI/selhero.cpp b/Source/DiabloUI/selhero.cpp index ccd9dbe95..d9d50eb9c 100644 --- a/Source/DiabloUI/selhero.cpp +++ b/Source/DiabloUI/selhero.cpp @@ -139,7 +139,7 @@ void SelheroListSelect(int value) if (gbIsHellfire) { vecSelHeroDlgItems.push_back(std::make_unique(_("Monk"), static_cast(HeroClass::Monk))); } - if (gbBard || sgOptions.Gameplay.bTestBard) { + if (gbBard || *sgOptions.Gameplay.testBard) { vecSelHeroDlgItems.push_back(std::make_unique(_("Bard"), static_cast(HeroClass::Bard))); } if (gbBarbarian || sgOptions.Gameplay.bTestBarbarian) { diff --git a/Source/items.cpp b/Source/items.cpp index 192b3f4b5..c86d63e1a 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -2538,7 +2538,7 @@ bool IsItemAvailable(int i) || ( // Bard items are technically Hellfire-exclusive // but are just normal items with adjusted stats. - sgOptions.Gameplay.bTestBard && IsAnyOf(i, IDI_BARDSWORD, IDI_BARDDAGGER)); + *sgOptions.Gameplay.testBard && IsAnyOf(i, IDI_BARDSWORD, IDI_BARDDAGGER)); } BYTE GetOutlineColor(const Item &item, bool checkReq) diff --git a/Source/options.cpp b/Source/options.cpp index 5915caf13..296d01cf1 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -275,7 +275,6 @@ void LoadOptions() sgOptions.Graphics.bShowFPS = (GetIniInt("Graphics", "Show FPS", 0) != 0); sgOptions.Gameplay.nTickRate = GetIniInt("Game", "Speed", 20); - sgOptions.Gameplay.bTestBard = GetIniBool("Game", "Test Bard", false); sgOptions.Gameplay.bTestBarbarian = GetIniBool("Game", "Test Barbarian", false); sgOptions.Gameplay.bExperienceBar = GetIniBool("Game", "Experience Bar", AUTO_PICKUP_DEFAULT(false)); sgOptions.Gameplay.bEnemyHealthBar = GetIniBool("Game", "Enemy Health Bar", false); @@ -425,7 +424,6 @@ void SaveOptions() SetIniValue("Graphics", "Show FPS", sgOptions.Graphics.bShowFPS); SetIniValue("Game", "Speed", sgOptions.Gameplay.nTickRate); - SetIniValue("Game", "Test Bard", sgOptions.Gameplay.bTestBard); SetIniValue("Game", "Test Barbarian", sgOptions.Gameplay.bTestBarbarian); SetIniValue("Game", "Experience Bar", sgOptions.Gameplay.bExperienceBar); SetIniValue("Game", "Enemy Health Bar", sgOptions.Gameplay.bEnemyHealthBar); @@ -635,6 +633,7 @@ GameplayOptions::GameplayOptions() , theoQuest("Theo Quest", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::OnlyHellfire, N_("Theo Quest"), N_("Enable Little Girl quest."), false) , cowQuest("Cow Quest", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::OnlyHellfire, N_("Cow Quest"), N_("Enable Jersey's quest. Lester the farmer is replaced by the Complete Nut."), false) , friendlyFire("Friendly Fire", OptionEntryFlags::CantChangeInMultiPlayer, N_("Friendly Fire"), N_("Allow arrow/spell damage between players in multiplayer even when the friendly mode is on."), true) + , testBard("Test Bard", OptionEntryFlags::CantChangeInGame, N_("Test Bard"), N_("Force the Bard character type to appear in the hero selection menu."), false) { grabInput.SetValueChangedCallback(OptionGrabInputChanged); } @@ -646,6 +645,7 @@ std::vector GameplayOptions::GetEntries() &theoQuest, &cowQuest, &friendlyFire, + &testBard, }; } diff --git a/Source/options.h b/Source/options.h index f910072f6..5d24726f0 100644 --- a/Source/options.h +++ b/Source/options.h @@ -282,7 +282,7 @@ struct GameplayOptions : OptionCategoryBase { /** @brief Will players still damage other players in non-PvP mode. */ OptionEntryBoolean friendlyFire; /** @brief Enable the bard hero class. */ - bool bTestBard; + OptionEntryBoolean testBard; /** @brief Enable the babarian hero class. */ bool bTestBarbarian; /** @brief Show the current level progress. */