From 7c1aea4e24d73cac7e4f0968a156b0ff39c135c2 Mon Sep 17 00:00:00 2001 From: "Skyth (Asilkan)" <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Sun, 9 Feb 2025 14:25:06 +0300 Subject: [PATCH] Fix the custom UI drawing in front of ImGui windows. (#335) --- UnleashedRecomp/gpu/imgui/imgui_common.cpp | 2 +- UnleashedRecomp/gpu/video.cpp | 2 +- UnleashedRecomp/ui/achievement_menu.cpp | 12 +++++----- UnleashedRecomp/ui/achievement_overlay.cpp | 4 ++-- UnleashedRecomp/ui/button_guide.cpp | 4 ++-- UnleashedRecomp/ui/fader.cpp | 2 +- UnleashedRecomp/ui/imgui_utils.cpp | 20 ++++++++--------- UnleashedRecomp/ui/installer_wizard.cpp | 26 +++++++++++----------- UnleashedRecomp/ui/message_window.cpp | 6 ++--- UnleashedRecomp/ui/options_menu.cpp | 24 ++++++++++---------- 10 files changed, 51 insertions(+), 51 deletions(-) diff --git a/UnleashedRecomp/gpu/imgui/imgui_common.cpp b/UnleashedRecomp/gpu/imgui/imgui_common.cpp index c273ac7..9c60bfd 100644 --- a/UnleashedRecomp/gpu/imgui/imgui_common.cpp +++ b/UnleashedRecomp/gpu/imgui/imgui_common.cpp @@ -11,7 +11,7 @@ ImGuiCallbackData* AddImGuiCallback(ImGuiCallback callback) auto& callbackData = g_callbackData[g_callbackDataIndex]; ++g_callbackDataIndex; - ImGui::GetForegroundDrawList()->AddCallback(reinterpret_cast(callback), callbackData.get()); + ImGui::GetBackgroundDrawList()->AddCallback(reinterpret_cast(callback), callbackData.get()); return callbackData.get(); } diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index 447ace8..62a5b30 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -2321,7 +2321,7 @@ static void DrawImGui() Fader::Draw(); BlackBar::Draw(); - assert(ImGui::GetForegroundDrawList()->_ClipRectStack.Size == 1 && "Some clip rects were not removed from the stack!"); + assert(ImGui::GetBackgroundDrawList()->_ClipRectStack.Size == 1 && "Some clip rects were not removed from the stack!"); DrawProfiler(); ImGui::Render(); diff --git a/UnleashedRecomp/ui/achievement_menu.cpp b/UnleashedRecomp/ui/achievement_menu.cpp index 4c0068d..91c3201 100644 --- a/UnleashedRecomp/ui/achievement_menu.cpp +++ b/UnleashedRecomp/ui/achievement_menu.cpp @@ -67,7 +67,7 @@ static void ResetSelection() static void DrawContainer(ImVec2 min, ImVec2 max, ImU32 gradientTop, ImU32 gradientBottom, float alpha = 1, float cornerRadius = 25) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); DrawPauseContainer(min, max, alpha); @@ -76,7 +76,7 @@ static void DrawContainer(ImVec2 min, ImVec2 max, ImU32 gradientTop, ImU32 gradi static void DrawHeaderContainer(const char* text) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto fontSize = Scale(24); auto textSize = g_fntNewRodinUB->CalcTextSizeA(fontSize, FLT_MAX, 0, text); auto cornerRadius = 23; @@ -124,7 +124,7 @@ static void DrawHeaderContainer(const char* text) static void DrawAchievement(int rowIndex, float yOffset, Achievement& achievement, bool isUnlocked) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto clipRectMin = drawList->GetClipRectMin(); auto clipRectMax = drawList->GetClipRectMax(); @@ -339,7 +339,7 @@ static void DrawAchievement(int rowIndex, float yOffset, Achievement& achievemen static void DrawTrophySparkles(ImVec2 min, ImVec2 max, int recordCount, int trophyFrameIndex) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); constexpr auto recordsHalfTotal = ACH_RECORDS / 2; @@ -427,7 +427,7 @@ static void DrawTrophySparkles(ImVec2 min, ImVec2 max, int recordCount, int trop static void DrawAchievementTotal(ImVec2 min, ImVec2 max) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); // Transparency fade animation. auto alpha = Cubic(0, 1, ComputeMotion(g_appearTime, COUNTER_INTRO_FADE_START, COUNTER_INTRO_FADE_END)); @@ -511,7 +511,7 @@ static void DrawAchievementTotal(ImVec2 min, ImVec2 max) static void DrawContentContainer() { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); // Expand/retract animation. auto motion = g_isClosing diff --git a/UnleashedRecomp/ui/achievement_overlay.cpp b/UnleashedRecomp/ui/achievement_overlay.cpp index 75ff0da..13aa568 100644 --- a/UnleashedRecomp/ui/achievement_overlay.cpp +++ b/UnleashedRecomp/ui/achievement_overlay.cpp @@ -30,7 +30,7 @@ static ImFont* g_fntSeurat; static bool DrawContainer(ImVec2 min, ImVec2 max, float cornerRadius = 25) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); // Expand/retract animation. auto containerMotion = ComputeMotion(g_appearTime, OVERLAY_CONTAINER_COMMON_MOTION_START, OVERLAY_CONTAINER_COMMON_MOTION_END); @@ -88,7 +88,7 @@ void AchievementOverlay::Draw() if (ImGui::GetTime() - g_appearTime >= OVERLAY_DURATION) AchievementOverlay::Close(); - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; auto strAchievementUnlocked = Localise("Achievements_Unlock").c_str(); diff --git a/UnleashedRecomp/ui/button_guide.cpp b/UnleashedRecomp/ui/button_guide.cpp index c65c6b0..9a7a8d1 100644 --- a/UnleashedRecomp/ui/button_guide.cpp +++ b/UnleashedRecomp/ui/button_guide.cpp @@ -155,7 +155,7 @@ static void DrawGuide(float* offset, ImVec2 regionMin, ImVec2 regionMax, EButton EButtonAlignment alignment, ImVec2 iconMin, ImVec2 iconMax, EFontQuality fontQuality, ImVec2 textSize, float fontSize, const char* text) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto _icon = icon; auto iconWidth = Scale(g_iconWidths[icon]); auto dualIconMarginX = Scale(25); @@ -235,7 +235,7 @@ void ButtonGuide::Draw() if (!s_isVisible) return; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; ImVec2 regionMin = { g_aspectRatioOffsetX + Scale(g_sideMargins), g_aspectRatioOffsetY * 2.0f + Scale(720.0f - 102.0f) }; diff --git a/UnleashedRecomp/ui/fader.cpp b/UnleashedRecomp/ui/fader.cpp index a186e45..853f679 100644 --- a/UnleashedRecomp/ui/fader.cpp +++ b/UnleashedRecomp/ui/fader.cpp @@ -45,7 +45,7 @@ void Fader::Draw() auto colour = IM_COL32(g_colour & 0xFF, (g_colour >> 8) & 0xFF, (g_colour >> 16) & 0xFF, 255 * alpha); - ImGui::GetForegroundDrawList()->AddRectFilled({ 0, 0 }, ImGui::GetIO().DisplaySize, colour); + ImGui::GetBackgroundDrawList()->AddRectFilled({ 0, 0 }, ImGui::GetIO().DisplaySize, colour); } static void DoFade(bool isFadeIn, float duration, std::function endCallback, float endCallbackDelay) diff --git a/UnleashedRecomp/ui/imgui_utils.cpp b/UnleashedRecomp/ui/imgui_utils.cpp index 1109d98..bffcc1b 100644 --- a/UnleashedRecomp/ui/imgui_utils.cpp +++ b/UnleashedRecomp/ui/imgui_utils.cpp @@ -169,7 +169,7 @@ double ComputeMotion(double duration, double offset, double total) void DrawPauseContainer(ImVec2 min, ImVec2 max, float alpha) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto commonWidth = Scale(35); auto commonHeight = Scale(35); @@ -200,7 +200,7 @@ void DrawPauseContainer(ImVec2 min, ImVec2 max, float alpha) void DrawPauseHeaderContainer(ImVec2 min, ImVec2 max, float alpha) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto commonWidth = Scale(35); @@ -217,14 +217,14 @@ void DrawPauseHeaderContainer(ImVec2 min, ImVec2 max, float alpha) void DrawTextBasic(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 colour, const char* text) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); drawList->AddText(font, fontSize, pos, colour, text, nullptr); } void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& position, const ImVec2& min, const ImVec2& max, ImU32 color, const char* text, double time, double delay, double speed) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto rectWidth = max.x - min.x; auto textSize = font->CalcTextSizeA(fontSize, FLT_MAX, 0, text); auto textX = position.x - fmodf(std::max(0.0, ImGui::GetTime() - (time + delay)) * speed, textSize.x + rectWidth); @@ -278,7 +278,7 @@ void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& posit void DrawTextWithMarqueeShadow(const ImFont* font, float fontSize, const ImVec2& pos, const ImVec2& min, const ImVec2& max, ImU32 colour, const char* text, double time, double delay, double speed, float offset, float radius, ImU32 shadowColour) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto rectWidth = max.x - min.x; auto textSize = font->CalcTextSizeA(fontSize, FLT_MAX, 0, text); auto textX = pos.x - fmodf(std::max(0.0, ImGui::GetTime() - (time + delay)) * speed, textSize.x + rectWidth); @@ -296,7 +296,7 @@ void DrawTextWithMarqueeShadow(const ImFont* font, float fontSize, const ImVec2& void DrawTextWithOutline(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 color, const char* text, float outlineSize, ImU32 outlineColor, uint32_t shaderModifier) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); SetOutline(outlineSize); drawList->AddText(font, fontSize, pos, outlineColor, text); @@ -313,7 +313,7 @@ void DrawTextWithOutline(const ImFont* font, float fontSize, const ImVec2& pos, void DrawTextWithShadow(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 colour, const char* text, float offset, float radius, ImU32 shadowColour) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); offset = Scale(offset); @@ -732,7 +732,7 @@ ImU32 ColourLerp(ImU32 c0, ImU32 c1, float t) void DrawVersionString(const ImFont* font, const ImU32 col) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; auto fontSize = Scale(12); auto textMargin = Scale(2); @@ -743,7 +743,7 @@ void DrawVersionString(const ImFont* font, const ImU32 col) void DrawSelectionContainer(ImVec2 min, ImVec2 max, bool fadeTop) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); static auto breatheStart = ImGui::GetTime(); auto alpha = BREATHE_MOTION(1.0f, 0.55f, breatheStart, 0.92f); @@ -787,7 +787,7 @@ void DrawSelectionContainer(ImVec2 min, ImVec2 max, bool fadeTop) void DrawToggleLight(ImVec2 pos, bool isEnabled, float alpha) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto lightSize = Scale(14); auto lightCol = IM_COL32(255, 255, 255, 255 * alpha); diff --git a/UnleashedRecomp/ui/installer_wizard.cpp b/UnleashedRecomp/ui/installer_wizard.cpp index 765c567..2942992 100644 --- a/UnleashedRecomp/ui/installer_wizard.cpp +++ b/UnleashedRecomp/ui/installer_wizard.cpp @@ -464,7 +464,7 @@ static void ResetCursorRects() static void DrawBackground() { auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); drawList->AddRectFilled({ 0.0, 0.0 }, res, IM_COL32_BLACK); } @@ -483,7 +483,7 @@ static void DrawLeftImage() int a = std::lround(255.0 * imageAlpha); GuestTexture *guestTexture = g_installTextures[installTextureIndex % g_installTextures.size()].get(); auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); ImVec2 min = { g_aspectRatioOffsetX + Scale(IMAGE_X), g_aspectRatioOffsetY + Scale(IMAGE_Y) }; ImVec2 max = { min.x + Scale(IMAGE_WIDTH), min.y + Scale(IMAGE_HEIGHT) }; drawList->AddImage(guestTexture, min, max, ImVec2(0, 0), ImVec2(1, 1), IM_COL32(255, 255, 255, a)); @@ -491,7 +491,7 @@ static void DrawLeftImage() static void DrawHeaderIconsForInstallPhase(double iconsPosX, double iconsPosY, double iconsScale) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); // Arrow Circle Icon ImVec2 arrowCircleMin = { g_aspectRatioOffsetX + Scale(iconsPosX - iconsScale / 2), Scale(iconsPosY - iconsScale / 2) }; @@ -546,7 +546,7 @@ static void DrawHeaderIconsForInstallPhase(double iconsPosX, double iconsPosY, d static void DrawHeaderIcons() { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); float iconsPosX = 256.0f; float iconsPosY = 80.0f; @@ -582,7 +582,7 @@ static void DrawScanlineBars() } auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); SetShaderModifier(IMGUI_SHADER_MODIFIER_SCANLINE); @@ -680,7 +680,7 @@ static void DrawScanlineBars() static void DrawContainer(ImVec2 min, ImVec2 max, bool isTextArea) { auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); double gridAlpha = ComputeMotionInstaller(g_appearTime, g_disappearTime, isTextArea ? CONTAINER_INNER_TIME : CONTAINER_OUTER_TIME, @@ -711,7 +711,7 @@ static void DrawContainer(ImVec2 min, ImVec2 max, bool isTextArea) static void DrawDescriptionContainer() { auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto fontSize = Scale(28.0f); auto annotationFontSize = fontSize * ANNOTATION_FONT_SIZE_MODIFIER; @@ -896,7 +896,7 @@ static void DrawDescriptionContainer() static void DrawButtonContainer(ImVec2 min, ImVec2 max, int baser, int baseg, float alpha) { auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); SetShaderModifier(IMGUI_SHADER_MODIFIER_SCANLINE_BUTTON); drawList->AddRectFilledMultiColor(min, max, IM_COL32(baser, baseg + 130, 0, 223 * alpha), IM_COL32(baser, baseg + 130, 0, 178 * alpha), IM_COL32(baser, baseg + 130, 0, 223 * alpha), IM_COL32(baser, baseg + 130, 0, 178 * alpha)); drawList->AddRectFilledMultiColor(min, max, IM_COL32(baser, baseg, 0, 13 * alpha), IM_COL32(baser, baseg, 0, 0), IM_COL32(baser, baseg, 0, 55 * alpha), IM_COL32(baser, baseg, 0, 6 * alpha)); @@ -924,7 +924,7 @@ static void DrawButton(ImVec2 min, ImVec2 max, const char *buttonText, bool sour buttonPressed = false; auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); float alpha = ComputeMotionInstaller(g_appearTime, g_disappearTime, CONTAINER_INNER_TIME, CONTAINER_INNER_DURATION); if (!buttonEnabled) { @@ -1030,7 +1030,7 @@ static void DrawSourceButton(ButtonColumn buttonColumn, float yRatio, const char static void DrawProgressBar(float progressRatio) { auto &res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); float alpha = 1.0; const uint32_t innerColor0 = IM_COL32(0, 65, 0, 255 * alpha); const uint32_t innerColor1 = IM_COL32(0, 32, 0, 255 * alpha); @@ -1532,7 +1532,7 @@ static void DrawHorizontalBorder(bool bottomBorder) const uint32_t FADE_COLOR_LEFT = IM_COL32(155, 155, 155, 0); const uint32_t SOLID_COLOR = IM_COL32(155, 200, 155, 255); const uint32_t FADE_COLOR_RIGHT = IM_COL32(155, 225, 155, 0); - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); double borderScale = 1.0 - ComputeMotionInstaller(g_appearTime, g_disappearTime, CONTAINER_LINE_ANIMATION_TIME, CONTAINER_LINE_ANIMATION_DURATION); float midX = g_aspectRatioOffsetX + Scale(CONTAINER_X + CONTAINER_WIDTH / 5); float minX = std::lerp(g_aspectRatioOffsetX + Scale(CONTAINER_X - BORDER_SIZE - BORDER_OVERSHOOT), midX, borderScale); @@ -1564,7 +1564,7 @@ static void DrawVerticalBorder(bool rightBorder) { const uint32_t SOLID_COLOR = IM_COL32(155, rightBorder ? 225 : 155, 155, 255); const uint32_t FADE_COLOR = IM_COL32(155, rightBorder ? 225 : 155, 155, 0); - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); double borderScale = 1.0 - ComputeMotionInstaller(g_appearTime, g_disappearTime, CONTAINER_LINE_ANIMATION_TIME, CONTAINER_LINE_ANIMATION_DURATION); float minX = g_aspectRatioOffsetX + (rightBorder ? Scale(CONTAINER_X + CONTAINER_WIDTH) : Scale(CONTAINER_X - BORDER_SIZE)); float maxX = minX + Scale(BORDER_SIZE); @@ -1661,7 +1661,7 @@ static void PickerDrawForeground() { if (g_currentPickerVisible) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); drawList->AddRectFilled({ 0.0f, 0.0f }, ImGui::GetIO().DisplaySize, IM_COL32(0, 0, 0, 190)); } } diff --git a/UnleashedRecomp/ui/message_window.cpp b/UnleashedRecomp/ui/message_window.cpp index 2b289a9..76e1e97 100644 --- a/UnleashedRecomp/ui/message_window.cpp +++ b/UnleashedRecomp/ui/message_window.cpp @@ -150,7 +150,7 @@ g_sdlEventListenerForMessageWindow; bool DrawContainer(float appearTime, ImVec2 centre, ImVec2 max, bool isForeground = true) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); ImVec2 _min = { centre.x - max.x, centre.y - max.y }; ImVec2 _max = { centre.x + max.x, centre.y + max.y }; @@ -201,7 +201,7 @@ bool DrawContainer(float appearTime, ImVec2 centre, ImVec2 max, bool isForegroun void DrawButton(int rowIndex, float yOffset, float width, float height, std::string& text) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto clipRectMin = drawList->GetClipRectMin(); auto clipRectMax = drawList->GetClipRectMax(); @@ -275,7 +275,7 @@ void MessageWindow::Draw() if (!s_isVisible) return; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; ImVec2 centre = { res.x / 2, res.y / 2 }; diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index 0b88bf8..1bf5753 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -127,7 +127,7 @@ static void DrawTitle() g_titleAnimBegin = false; } - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto x = Scale(122); auto y = Scale(56); @@ -238,7 +238,7 @@ static void DrawScanlineBars() float height = Scale(105.0f); auto& res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); if (OptionsMenu::s_pauseMenuType != SWA::eMenuType_WorldMap) { @@ -350,7 +350,7 @@ static void DrawContainer(ImVec2 min, ImVec2 max, bool drawRightOutline) max.y = Lerp(center, max.y, containerHeight); auto& res = ImGui::GetIO().DisplaySize; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); double outerAlpha = g_isStage ? 1.0 : ComputeMotion(g_appearTime, CONTAINER_OUTER_TIME, CONTAINER_OUTER_DURATION); double innerAlpha = g_isStage ? 1.0 : ComputeMotion(g_appearTime, CONTAINER_INNER_TIME, CONTAINER_INNER_DURATION); @@ -454,7 +454,7 @@ static bool DrawCategories() Game_PlaySound("sys_actstg_score"); } - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto clipRectMin = drawList->GetClipRectMin(); auto clipRectMax = drawList->GetClipRectMax(); @@ -601,7 +601,7 @@ static void DrawSelectionArrows(ImVec2 min, ImVec2 max, bool isLeftTapped, bool static bool isLeftArrowMotion = false; static bool isRightArrowMotion = false; - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto gridSize = Scale(GRID_SIZE); auto width = gridSize * 2.5f; auto padding = gridSize; @@ -725,7 +725,7 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef* conf bool isAccessible, std::string* inaccessibleReason = nullptr, T valueMin = T(0), T valueCenter = T(0.5), T valueMax = T(1), bool isSlider = true) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto clipRectMin = drawList->GetClipRectMin(); auto clipRectMax = drawList->GetClipRectMax(); auto& padState = SWA::CInputState::GetInstance()->GetPadState(); @@ -1153,7 +1153,7 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef* conf static void DrawConfigOptions() { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto clipRectMin = drawList->GetClipRectMin(); auto clipRectMax = drawList->GetClipRectMax(); @@ -1363,7 +1363,7 @@ static void DrawConfigOptions() static void DrawSettingsPanel(ImVec2 settingsMin, ImVec2 settingsMax) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); SetProceduralOrigin(settingsMin); DrawContainer(settingsMin, settingsMax, true); @@ -1387,7 +1387,7 @@ static void DrawSettingsPanel(ImVec2 settingsMin, ImVec2 settingsMax) static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); SetProceduralOrigin(infoMin); DrawContainer(infoMin, infoMax, false); @@ -1584,7 +1584,7 @@ static void SetOptionsMenuVisible(bool isVisible) static bool DrawMilesElectric() { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; // Compensate for the lack of CSD UI dimming the background. @@ -1637,7 +1637,7 @@ static bool DrawMilesElectric() static bool DrawFadeTransition() { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; auto scaleMotion = ComputeMotion(g_appearTime, 0, MILES_ELECTRIC_SCALE_DURATION); @@ -1682,7 +1682,7 @@ void OptionsMenu::Draw() if (!g_isClosing) { - auto drawList = ImGui::GetForegroundDrawList(); + auto drawList = ImGui::GetBackgroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; if (g_isStage)