diff --git a/KillproofUI.cpp b/KillproofUI.cpp index b2810a5..7da84fa 100644 --- a/KillproofUI.cpp +++ b/KillproofUI.cpp @@ -64,7 +64,7 @@ void KillproofUI::draw(bool* p_open, ImGuiWindowFlags flags) { /** * Unofficial Extras message */ - if (!extrasLoaded) { + if (!extrasLoaded && !settings.getHideExtrasMessage()) { ImGui::TextUnformatted(lang.translate(LangKey::UnofficialExtrasNotInstalled).c_str()); ImGui::SameLine(); diff --git a/Lang.h b/Lang.h index ed227ce..a04d953 100644 --- a/Lang.h +++ b/Lang.h @@ -104,6 +104,7 @@ BUILD_ENUM_SERIALIZED( SettingsToThisPanelCorner, "to this panel corner", SettingsFromWindowName, "from window", SettingsCofferValue, "Killproofs per coffer", + SettingsHideExtrasMessage, "Hide Unofficial Extras Message", Alignment, "Alignment", HeaderAlignment, "Header alignment", diff --git a/Settings.cpp b/Settings.cpp index 20eafda..ed7efcc 100644 --- a/Settings.cpp +++ b/Settings.cpp @@ -83,6 +83,10 @@ uint8_t Settings::getCofferValue() const { return settings.cofferValue; } +bool Settings::getHideExtrasMessage() const { + return settings.hideExtrasMessage; +} + void Settings::load() { // according to standard, this constructor is completely thread-safe // read settings from file diff --git a/Settings.h b/Settings.h index 056a7e3..53381c5 100644 --- a/Settings.h +++ b/Settings.h @@ -47,11 +47,12 @@ class Settings { ImGuiID fromWindowID; bool showCommander = false; uint8_t cofferValue = 3; + bool hideExtrasMessage = false; NLOHMANN_DEFINE_TYPE_INTRUSIVE_NON_THROWING(SettingsObject, killproofKey, hidePrivateAccount, showKillproof, blockedDataText, disableEscClose, alignment, headerAlignment, showHeaderText, hideControls, showOverallByDefault, showHeader, position, cornerPosition, cornerVector, anchorPanelCornerPosition, selfPanelCornerPosition, fromWindowID, - showCommander, cofferValue) + showCommander, cofferValue, hideExtrasMessage) }; Settings() = default; @@ -80,6 +81,7 @@ class Settings { [[nodiscard]] ImGuiID getFromWindowID() const; [[nodiscard]] bool getShowCommander() const; [[nodiscard]] uint8_t getCofferValue() const; + [[nodiscard]] bool getHideExtrasMessage() const; // delete copy/move Settings(const Settings& other) = delete; diff --git a/SettingsUI.cpp b/SettingsUI.cpp index a80520e..efe96ca 100644 --- a/SettingsUI.cpp +++ b/SettingsUI.cpp @@ -60,6 +60,8 @@ void SettingsUI::draw() { settings.settings.cofferValue = cofferValue; } + ImGui::Checkbox(lang.translate(LangKey::SettingsHideExtrasMessage).c_str(), &settings.settings.hideExtrasMessage); + if (ImGui::Button(lang.translate(LangKey::SettingsClearCacheText).c_str())) { std::scoped_lock guard(cachedPlayersMutex, trackedPlayersMutex);