diff --git a/Source/options.cpp b/Source/options.cpp index 8b6fa03e9..da0ad146b 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -536,7 +536,7 @@ void OptionEntryEnumBase::SaveToIni(string_view category) const { SetIniValue(category.data(), key.data(), value); } -int OptionEntryEnumBase::GetValueInternal() +int OptionEntryEnumBase::GetValueInternal() const { return value; } @@ -585,4 +585,85 @@ string_view OptionCategoryBase::GetDescription() const return _(description.data()); } +DiabloOptions::DiabloOptions() + : OptionCategoryBase("Diablo", N_("Diablo"), N_("Diablo specific Settings")) +{ +} +std::vector DiabloOptions::GetEntries() +{ + return {}; +} + +HellfireOptions::HellfireOptions() + : OptionCategoryBase("Hellfire", N_("Hellfire"), N_("Hellfire specific Settings")) +{ +} +std::vector HellfireOptions::GetEntries() +{ + return {}; +} + +AudioOptions::AudioOptions() + : OptionCategoryBase("Audio", N_("Audio"), N_("Audio Settings")) +{ +} +std::vector AudioOptions::GetEntries() +{ + return {}; +} + +GraphicsOptions::GraphicsOptions() + : OptionCategoryBase("Graphics", N_("Graphics"), N_("Graphics Settings")) +{ +} +std::vector GraphicsOptions::GetEntries() +{ + return {}; +} + +GameplayOptions::GameplayOptions() + : OptionCategoryBase("Game", N_("Gameplay"), N_("Gameplay Settings")) +{ +} +std::vector GameplayOptions::GetEntries() +{ + return {}; +} + +ControllerOptions::ControllerOptions() + : OptionCategoryBase("Controller", N_("Controller"), N_("Controller Settings")) +{ +} +std::vector ControllerOptions::GetEntries() +{ + return {}; +} + +NetworkOptions::NetworkOptions() + : OptionCategoryBase("Network", N_("Network"), N_("Network Settings")) +{ +} +std::vector NetworkOptions::GetEntries() +{ + return {}; +} + +ChatOptions::ChatOptions() + : OptionCategoryBase("NetMsg", N_("Chat"), N_("Chat Settings")) +{ +} +std::vector ChatOptions::GetEntries() +{ + return {}; +} + +LanguageOptions::LanguageOptions() + : OptionCategoryBase("Language", N_("Language"), N_("Language Settings")) +{ +} +std::vector LanguageOptions::GetEntries() +{ + return {}; +} + } // namespace devilution diff --git a/Source/options.h b/Source/options.h index 7b7bb61f5..ffef420f0 100644 --- a/Source/options.h +++ b/Source/options.h @@ -124,7 +124,7 @@ protected: { } - int GetValueInternal(); + [[nodiscard]] int GetValueInternal() const; void AddEntry(int value, string_view name); @@ -166,7 +166,10 @@ protected: string_view description; }; -struct DiabloOptions { +struct DiabloOptions : OptionCategoryBase { + DiabloOptions(); + std::vector GetEntries() override; + /** @brief Play game intro video on startup. */ bool bIntro; /** @brief Remembers what singleplayer hero/save was last used. */ @@ -175,7 +178,10 @@ struct DiabloOptions { std::uint32_t lastMultiplayerHero; }; -struct HellfireOptions { +struct HellfireOptions : OptionCategoryBase { + HellfireOptions(); + std::vector GetEntries() override; + /** @brief Play game intro video on startup. */ bool bIntro; /** @brief Cornerstone of the world item. */ @@ -188,7 +194,10 @@ struct HellfireOptions { StartUpGameOption startUpGameOption; }; -struct AudioOptions { +struct AudioOptions : OptionCategoryBase { + AudioOptions(); + std::vector GetEntries() override; + /** @brief Movie and SFX volume. */ int nSoundVolume; /** @brief Music volume. */ @@ -210,7 +219,10 @@ struct AudioOptions { std::uint8_t nResamplingQuality; }; -struct GraphicsOptions { +struct GraphicsOptions : OptionCategoryBase { + GraphicsOptions(); + std::vector GetEntries() override; + /** @brief Render width. */ int nWidth; /** @brief Render height. */ @@ -247,7 +259,10 @@ struct GraphicsOptions { bool bShowFPS; }; -struct GameplayOptions { +struct GameplayOptions : OptionCategoryBase { + GameplayOptions(); + std::vector GetEntries() override; + /** @brief Gameplay ticks per second. */ int nTickRate; /** @brief Enable double walk speed when in town. */ @@ -292,7 +307,10 @@ struct GameplayOptions { bool bDisableCripplingShrines; }; -struct ControllerOptions { +struct ControllerOptions : OptionCategoryBase { + ControllerOptions(); + std::vector GetEntries() override; + /** @brief SDL Controller mapping, see SDL_GameControllerDB. */ char szMapping[1024]; /** @brief Use dpad for spell hotkeys without holding "start" */ @@ -307,7 +325,10 @@ struct ControllerOptions { #endif }; -struct NetworkOptions { +struct NetworkOptions : OptionCategoryBase { + NetworkOptions(); + std::vector GetEntries() override; + /** @brief Optionally bind to a specific network interface. */ char szBindAddress[129]; /** @brief Most recently entered Hostname in join dialog. */ @@ -316,12 +337,18 @@ struct NetworkOptions { uint16_t nPort; }; -struct ChatOptions { +struct ChatOptions : OptionCategoryBase { + ChatOptions(); + std::vector GetEntries() override; + /** @brief Quick chat messages. */ char szHotKeyMsgs[QUICK_MESSAGE_OPTIONS][MAX_SEND_STR_LEN]; }; -struct LanguageOptions { +struct LanguageOptions : OptionCategoryBase { + LanguageOptions(); + std::vector GetEntries() override; + /** @brief Language code (IETF) for text. */ char szCode[6]; }; @@ -339,7 +366,17 @@ struct Options { [[nodiscard]] std::vector GetCategories() { - return {}; + return { + &Diablo, + &Hellfire, + &Audio, + &Gameplay, + &Graphics, + &Controller, + &Network, + &Chat, + &Language, + }; } };