From c9e671d4b623cb5d51227dcf3ab579a98cc4282c Mon Sep 17 00:00:00 2001 From: Jiaye Date: Fri, 16 Jan 2026 20:43:26 +0800 Subject: [PATCH 1/2] feat(weather overrides): add weather override pause checkbox --- src/Menu/FeatureListRenderer.cpp | 14 ++++++++++++++ src/WeatherVariableRegistry.h | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/Menu/FeatureListRenderer.cpp b/src/Menu/FeatureListRenderer.cpp index 2929e6c5b7..8a3c299ddd 100644 --- a/src/Menu/FeatureListRenderer.cpp +++ b/src/Menu/FeatureListRenderer.cpp @@ -16,6 +16,7 @@ #include "SettingsOverrideManager.h" #include "State.h" #include "Util.h" +#include "WeatherVariableRegistry.h" namespace { @@ -418,6 +419,19 @@ void FeatureListRenderer::DrawMenuVisitor::RenderFeatureSettingsTab(Feature* fea ImGui::Text("Enable the feature above to access its configuration options."); } else { if (isLoaded) { + auto weatherRegistry = WeatherVariables::GlobalWeatherRegistry::GetSingleton(); + if (weatherRegistry->HasWeatherSupport(feat->GetShortName())) { + bool paused = weatherRegistry->IsFeaturePaused(feat->GetShortName()); + if (ImGui::Checkbox("Pause Weather Overrides", &paused)) { + weatherRegistry->SetFeaturePaused(feat->GetShortName(), paused); + } + if (auto _tt = Util::HoverTooltipWrapper()) { + ImGui::Text("Temporarily disable weather-based setting adjustments for this feature.\n" + "This state is not saved."); + } + ImGui::Separator(); + } + ImVec2 cursorPosBefore = ImGui::GetCursorPos(); feat->DrawSettings(); ImVec2 cursorPosAfter = ImGui::GetCursorPos(); diff --git a/src/WeatherVariableRegistry.h b/src/WeatherVariableRegistry.h index 0f902fff45..919e8ab143 100644 --- a/src/WeatherVariableRegistry.h +++ b/src/WeatherVariableRegistry.h @@ -331,12 +331,30 @@ namespace WeatherVariables void UpdateFeatureFromWeathers(const std::string& featureName, const json& currWeather, const json& nextWeather, float lerpFactor) { + if (IsFeaturePaused(featureName)) { + return; + } + auto* registry = GetFeatureRegistry(featureName); if (registry) { registry->LerpAllVariables(currWeather, nextWeather, lerpFactor); } } + bool IsFeaturePaused(const std::string& featureName) + { + auto it = pausedFeatures.find(featureName); + if (it != pausedFeatures.end()) { + return it->second; + } + return false; + } + + void SetFeaturePaused(const std::string& featureName, bool paused) + { + pausedFeatures[featureName] = paused; + } + void SaveFeatureToJson(const std::string& featureName, json& j) const { auto it = featureRegistries.find(featureName); @@ -360,5 +378,6 @@ namespace WeatherVariables GlobalWeatherRegistry& operator=(const GlobalWeatherRegistry&) = delete; std::map> featureRegistries; + std::map pausedFeatures; }; } From 4f376d920ce38b72a72542941c661b5df0859103 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:45:46 +0000 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=F0=9F=8E=A8=20apply=20pre-commit.?= =?UTF-8?q?ci=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details. --- src/Menu/FeatureListRenderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Menu/FeatureListRenderer.cpp b/src/Menu/FeatureListRenderer.cpp index 8a3c299ddd..6f5e67743a 100644 --- a/src/Menu/FeatureListRenderer.cpp +++ b/src/Menu/FeatureListRenderer.cpp @@ -426,8 +426,9 @@ void FeatureListRenderer::DrawMenuVisitor::RenderFeatureSettingsTab(Feature* fea weatherRegistry->SetFeaturePaused(feat->GetShortName(), paused); } if (auto _tt = Util::HoverTooltipWrapper()) { - ImGui::Text("Temporarily disable weather-based setting adjustments for this feature.\n" - "This state is not saved."); + ImGui::Text( + "Temporarily disable weather-based setting adjustments for this feature.\n" + "This state is not saved."); } ImGui::Separator(); }