From a69cd0db2a6f1afaa57dffdab2d59531fb519994 Mon Sep 17 00:00:00 2001 From: obligaron Date: Sun, 7 Nov 2021 23:52:05 +0100 Subject: [PATCH] Add OptionEntry Theo Quest --- Source/DiabloUI/selgame.cpp | 2 +- Source/multi.cpp | 2 +- Source/options.cpp | 4 ++-- Source/options.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/DiabloUI/selgame.cpp b/Source/DiabloUI/selgame.cpp index 190d73256..0e892be2a 100644 --- a/Source/DiabloUI/selgame.cpp +++ b/Source/DiabloUI/selgame.cpp @@ -493,7 +493,7 @@ void selgame_Password_Select(int /*value*/) m_game_data->nDifficulty = nDifficulty; m_game_data->nTickRate = nTickRate; m_game_data->bRunInTown = *sgOptions.Gameplay.runInTown ? 1 : 0; - m_game_data->bTheoQuest = sgOptions.Gameplay.bTheoQuest ? 1 : 0; + m_game_data->bTheoQuest = *sgOptions.Gameplay.theoQuest ? 1 : 0; m_game_data->bCowQuest = sgOptions.Gameplay.bCowQuest ? 1 : 0; if (SNetCreateGame(nullptr, gamePassword, (char *)m_game_data, sizeof(*m_game_data), gdwPlayerId)) { diff --git a/Source/multi.cpp b/Source/multi.cpp index 581ec39a8..456246f06 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -692,7 +692,7 @@ bool NetInit(bool bSinglePlayer) sgGameInitInfo.versionPatch = PROJECT_VERSION_PATCH; sgGameInitInfo.nTickRate = sgOptions.Gameplay.nTickRate; sgGameInitInfo.bRunInTown = *sgOptions.Gameplay.runInTown ? 1 : 0; - sgGameInitInfo.bTheoQuest = sgOptions.Gameplay.bTheoQuest ? 1 : 0; + sgGameInitInfo.bTheoQuest = *sgOptions.Gameplay.theoQuest ? 1 : 0; sgGameInitInfo.bCowQuest = sgOptions.Gameplay.bCowQuest ? 1 : 0; sgGameInitInfo.bFriendlyFire = sgOptions.Gameplay.bFriendlyFire ? 1 : 0; memset(sgbPlayerTurnBitTbl, 0, sizeof(sgbPlayerTurnBitTbl)); diff --git a/Source/options.cpp b/Source/options.cpp index c52984679..0b1eaa3d0 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.bTheoQuest = GetIniBool("Game", "Theo Quest", false); sgOptions.Gameplay.bCowQuest = GetIniBool("Game", "Cow Quest", false); sgOptions.Gameplay.bFriendlyFire = GetIniBool("Game", "Friendly Fire", true); sgOptions.Gameplay.bTestBard = GetIniBool("Game", "Test Bard", false); @@ -428,7 +427,6 @@ void SaveOptions() SetIniValue("Graphics", "Show FPS", sgOptions.Graphics.bShowFPS); SetIniValue("Game", "Speed", sgOptions.Gameplay.nTickRate); - SetIniValue("Game", "Theo Quest", sgOptions.Gameplay.bTheoQuest); SetIniValue("Game", "Cow Quest", sgOptions.Gameplay.bCowQuest); SetIniValue("Game", "Friendly Fire", sgOptions.Gameplay.bFriendlyFire); SetIniValue("Game", "Test Bard", sgOptions.Gameplay.bTestBard); @@ -638,6 +636,7 @@ GameplayOptions::GameplayOptions() : OptionCategoryBase("Game", N_("Gameplay"), N_("Gameplay Settings")) , runInTown("Run in Town", OptionEntryFlags::CantChangeInMultiPlayer, N_("Run in Town"), N_("Enable jogging/fast walking in town for Diablo and Hellfire. This option was introduced in the expansion."), AUTO_PICKUP_DEFAULT(false)) , grabInput("Grab Input", OptionEntryFlags::None, N_("Grab Input"), N_("When enabled mouse is locked to the game window."), false) + , theoQuest("Theo Quest", OptionEntryFlags::CantChangeInGame | OptionEntryFlags::OnlyHellfire, N_("Theo Quest"), N_("Enable Little Girl quest."), false) { grabInput.SetValueChangedCallback(OptionGrabInputChanged); } @@ -646,6 +645,7 @@ std::vector GameplayOptions::GetEntries() return { &runInTown, &grabInput, + &theoQuest, }; } diff --git a/Source/options.h b/Source/options.h index c823a02f8..3bbd9fa12 100644 --- a/Source/options.h +++ b/Source/options.h @@ -276,7 +276,7 @@ struct GameplayOptions : OptionCategoryBase { /** @brief Do not let the mouse leave the application window. */ OptionEntryBoolean grabInput; /** @brief Enable the Theo quest. */ - bool bTheoQuest; + OptionEntryBoolean theoQuest; /** @brief Enable the cow quest. */ bool bCowQuest; /** @brief Will players still damage other players in non-PvP mode. */