summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalkierian <malkierian@gmail.com>2025-04-11 19:54:52 -0700
committerGitHub <noreply@github.com>2025-04-11 22:54:52 -0400
commitfc0cbbe9e72c487ba0dbdd06ec1e46f5dd852ac2 (patch)
tree6af166b40cbefcece2a8baa38a5145ee012981a0
parentf0f2157a4c2b4bc6cbe239eebb1e4a2b54c80321 (diff)
Improve tracker dock bgs (#5383)
* Modify the flow for applying opacity to docked tracker windows only when they are docked to the "Main - Deck" dockspace. * Add opacity clamping for check tracker.
-rw-r--r--soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp9
-rw-r--r--soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp4
2 files changed, 10 insertions, 3 deletions
diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp
index 93798fea5..b1be07b6e 100644
--- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp
+++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp
@@ -1258,8 +1258,13 @@ void BeginFloatWindows(std::string UniqueName, bool& open, ImGuiWindowFlags flag
windowFlags |= ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoMove;
}
}
- ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(Color_Background.r / 255.0f, Color_Background.g / 255.0f,
- Color_Background.b / 255.0f, Color_Background.a / 255.0f));
+ auto maybeParent = ImGui::GetCurrentWindow();
+ ImGuiWindow* window = ImGui::FindWindowByName(UniqueName.c_str());
+ if (window != NULL && window->DockTabIsVisible && window->ParentWindow != NULL &&
+ std::string(window->ParentWindow->Name).compare(0, strlen("Main - Deck"), "Main - Deck") == 0) {
+ Color_Background.a = 255;
+ }
+ ImGui::PushStyleColor(ImGuiCol_WindowBg, VecFromRGBA8(Color_Background));
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 4.0f);
ImGui::Begin(UniqueName.c_str(), &open, windowFlags);
diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp
index b86da3c0c..9b7b1fd39 100644
--- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp
+++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp
@@ -1162,8 +1162,10 @@ void BeginFloatingWindows(std::string UniqueName, ImGuiWindowFlags flags = 0) {
}
}
auto color = VecFromRGBA8(CVarGetColor(CVAR_TRACKER_ITEM("BgColor.Value"), { 0, 0, 0, 0 }));
+ auto maybeParent = ImGui::GetCurrentWindow();
ImGuiWindow* window = ImGui::FindWindowByName(UniqueName.c_str());
- if (window != NULL && window->DockTabIsVisible) {
+ if (window != NULL && window->DockTabIsVisible && window->ParentWindow != NULL &&
+ std::string(window->ParentWindow->Name).compare(0, strlen("Main - Deck"), "Main - Deck") == 0) {
color.w = 1.0f;
}
ImGui::PushStyleColor(ImGuiCol_WindowBg, color);