From 1b00b4e3d87e3cd3da90d35bf52741e50f66a3b0 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Thu, 13 Jun 2024 21:46:07 -0400 Subject: [PATCH 1/3] OSD messages display horizontally OSD messages with an icon and text will display the text to the right of the icon instead of below it. --- Source/Core/VideoCommon/OnScreenDisplay.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/VideoCommon/OnScreenDisplay.cpp b/Source/Core/VideoCommon/OnScreenDisplay.cpp index c24fee6538..5d9d90b95b 100644 --- a/Source/Core/VideoCommon/OnScreenDisplay.cpp +++ b/Source/Core/VideoCommon/OnScreenDisplay.cpp @@ -111,6 +111,7 @@ static float DrawMessage(int index, Message& msg, const ImVec2& position, int ti { ImGui::Image(msg.texture.get(), ImVec2(static_cast(msg.icon->width), static_cast(msg.icon->height))); + ImGui::SameLine(); } } From a79f4289722784452e0322cf46aa058bc4180d5f Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Thu, 13 Jun 2024 22:09:15 -0400 Subject: [PATCH 2/3] Fix margins on icon-only messages Messages with an icon and no text (such as in the game start sequence) had an oversized margin due to ImGui adding padding for an empty string. --- Source/Core/VideoCommon/OnScreenDisplay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/OnScreenDisplay.cpp b/Source/Core/VideoCommon/OnScreenDisplay.cpp index 5d9d90b95b..cc7fa6e22b 100644 --- a/Source/Core/VideoCommon/OnScreenDisplay.cpp +++ b/Source/Core/VideoCommon/OnScreenDisplay.cpp @@ -116,7 +116,8 @@ static float DrawMessage(int index, Message& msg, const ImVec2& position, int ti } // Use %s in case message contains %. - ImGui::TextColored(ARGBToImVec4(msg.color), "%s", msg.text.c_str()); + if (msg.text.size() > 0) + ImGui::TextColored(ARGBToImVec4(msg.color), "%s", msg.text.c_str()); window_height = ImGui::GetWindowSize().y + (WINDOW_PADDING * ImGui::GetIO().DisplayFramebufferScale.y); } From 9e1f5ed4b566df704b2041012944bbbd605a9592 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Thu, 13 Jun 2024 23:39:46 -0400 Subject: [PATCH 3/3] Stack Challenge Icons Horizontally --- Source/Core/VideoCommon/OnScreenUI.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoCommon/OnScreenUI.cpp b/Source/Core/VideoCommon/OnScreenUI.cpp index d3a3c7397d..61e59484e4 100644 --- a/Source/Core/VideoCommon/OnScreenUI.cpp +++ b/Source/Core/VideoCommon/OnScreenUI.cpp @@ -357,9 +357,9 @@ void OnScreenUI::DrawChallengesAndLeaderboards() float leaderboard_y = ImGui::GetIO().DisplaySize.y; if (!m_challenge_texture_map.empty()) { + ImGui::SetNextWindowSize(ImVec2(0, 0)); ImGui::SetNextWindowPos(ImVec2(ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y), 0, - ImVec2(1.0, 1.0)); - ImGui::SetNextWindowSize(ImVec2(0.0f, 0.0f)); + ImVec2(1, 1)); if (ImGui::Begin("Challenges", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings | @@ -370,9 +370,10 @@ void OnScreenUI::DrawChallengesAndLeaderboards() { ImGui::Image(texture.get(), ImVec2(static_cast(texture->GetWidth()), static_cast(texture->GetHeight()))); + ImGui::SameLine(); } - leaderboard_y -= ImGui::GetWindowHeight(); } + leaderboard_y -= ImGui::GetWindowHeight(); ImGui::End(); }