Clean up Push/Pop font calls in check and item trackers by adding them instead to Begin/EndFloatWindows functions. (#5122)

Add missing PopFont call to entrance tracker.
This commit is contained in:
Malkierian
2025-03-16 13:51:52 -07:00
committed by GitHub
parent 7e392e63a8
commit 5b622683f4
3 changed files with 5 additions and 8 deletions

View File

@@ -952,12 +952,14 @@ void BeginFloatingWindows(std::string UniqueName, ImGuiWindowFlags flags = 0) {
ImGui::PushStyleColor(ImGuiCol_WindowBg, VecFromRGBA8(CVarGetColor(CVAR_TRACKER_ITEM("BgColor.Value"), {0, 0, 0, 0})));
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 4.0f);
ImGui::PushFont(OTRGlobals::Instance->fontStandardLarger);
ImGui::Begin(UniqueName.c_str(), nullptr, windowFlags);
}
void EndFloatingWindows() {
ImGui::PopStyleVar();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopFont();
ImGui::End();
}
@@ -1222,7 +1224,6 @@ void ItemTrackerWindow::Draw() {
}
void ItemTrackerWindow::DrawElement() {
ImGui::PushFont(OTRGlobals::Instance->fontStandardLarger);
UpdateVectors();
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
@@ -1353,7 +1354,6 @@ void ItemTrackerWindow::DrawElement() {
EndFloatingWindows();
}
}
ImGui::PopFont();
}
static std::unordered_map<int32_t, const char*> itemTrackerCapacityTrackOptions = {