From d1245ec336062f9cfe53f468a90df1529075c495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 8 Jul 2025 14:43:31 +0200 Subject: [PATCH] Merge pull request #20604 from hrydgard/minor-fixes Fix some small UI regressions --- Common/Input/KeyCodes.h | 4 +--- Core/KeyMap.cpp | 2 +- GPU/Common/TextureReplacer.cpp | 18 +++--------------- GPU/Common/TextureReplacer.h | 2 +- UI/EmuScreen.cpp | 11 ++++++----- UI/PauseScreen.cpp | 5 +++++ Windows/RawInput.cpp | 2 +- ext/imgui/imgui_impl_platform.cpp | 2 +- 8 files changed, 19 insertions(+), 27 deletions(-) diff --git a/Common/Input/KeyCodes.h b/Common/Input/KeyCodes.h index 925998945b..30365511ee 100644 --- a/Common/Input/KeyCodes.h +++ b/Common/Input/KeyCodes.h @@ -128,7 +128,7 @@ enum InputKeyCode { NKCODE_META_LEFT = 117, NKCODE_META_RIGHT = 118, NKCODE_FUNCTION = 119, - NKCODE_SYSRQ = 120, + NKCODE_PRINTSCREEN = 120, NKCODE_BREAK = 121, NKCODE_MOVE_HOME = 122, NKCODE_MOVE_END = 123, @@ -246,8 +246,6 @@ enum InputKeyCode { NKCODE_EXT_MOUSEWHEEL_UP = 1008, NKCODE_EXT_MOUSEWHEEL_DOWN = 1009, - NKCODE_EXT_PRINTSCREEN = 1010, - NKCODE_MAX }; diff --git a/Core/KeyMap.cpp b/Core/KeyMap.cpp index b4d96afab7..44bcbf83c5 100644 --- a/Core/KeyMap.cpp +++ b/Core/KeyMap.cpp @@ -225,7 +225,7 @@ static const KeyMap_IntStrPair key_names[] = { {NKCODE_APOSTROPHE, "'"}, {NKCODE_MINUS, "-"}, {NKCODE_PLUS, "+"}, - {NKCODE_SYSRQ, "Print"}, + {NKCODE_PRINTSCREEN, "Print"}, {NKCODE_SCROLL_LOCK, "ScrLock"}, {NKCODE_BREAK, "Pause"}, diff --git a/GPU/Common/TextureReplacer.cpp b/GPU/Common/TextureReplacer.cpp index 55b3032e85..b29feeb1e8 100644 --- a/GPU/Common/TextureReplacer.cpp +++ b/GPU/Common/TextureReplacer.cpp @@ -102,28 +102,16 @@ void TextureReplacer::NotifyConfigChanged() { // Even if just saving is enabled, it makes sense to reload the ini to get the correct // settings for saving. See issue #19086. This can be expensive though. std::string error; - bool result = LoadIni(&error); + bool result = LoadIni(&error, false); if (!result) { // Ignore errors here, just log if we successfully loaded an ini. } else { INFO_LOG(Log::G3D, "Loaded INI file for saving."); } } - - if (saveEnabled_) { - // Somewhat crude message, re-using translation strings. - auto d = GetI18NCategory(I18NCat::DEVELOPER); - auto di = GetI18NCategory(I18NCat::DIALOG); - std::string str(d->T("Save new textures")); - if (!str.empty()) { - str.append(": "); - str.append(di->T("Enabled")); - g_OSD.Show(OSDType::MESSAGE_INFO, str, 2.0f); - } - } } -bool TextureReplacer::LoadIni(std::string *error) { +bool TextureReplacer::LoadIni(std::string *error, bool notify) { hash_ = ReplacedTextureHash::QUICK; aliases_.clear(); hashranges_.clear(); @@ -214,7 +202,7 @@ bool TextureReplacer::LoadIni(std::string *error) { } auto gr = GetI18NCategory(I18NCat::GRAPHICS); - if (replaceEnabled_) { + if (replaceEnabled_ && notify) { g_OSD.Show(OSDType::MESSAGE_SUCCESS, gr->T("Texture replacement pack activated"), 3.0f); } diff --git a/GPU/Common/TextureReplacer.h b/GPU/Common/TextureReplacer.h index ea70bc09ea..9410dac6dd 100644 --- a/GPU/Common/TextureReplacer.h +++ b/GPU/Common/TextureReplacer.h @@ -131,7 +131,7 @@ public: protected: bool FindFiltering(u64 cachekey, u32 hash, TextureFiltering *forceFiltering); - bool LoadIni(std::string *error); + bool LoadIni(std::string *error, bool notify = true); bool LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverride, std::string *error); void ParseHashRange(const std::string &key, const std::string &value); void ParseFiltering(const std::string &key, const std::string &value); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 503a2ee25f..4a9e69b648 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -899,19 +899,20 @@ void EmuScreen::ProcessVKey(VirtKey virtKey) { case VIRTKEY_TEXTURE_DUMP: g_Config.bSaveNewTextures = !g_Config.bSaveNewTextures; if (g_Config.bSaveNewTextures) { - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("saveNewTextures_true", "Textures will now be saved to your storage"), 2.0, "savetexturechanged"); - System_PostUIMessage(UIMessage::GPU_CONFIG_CHANGED); + g_OSD.Show(OSDType::MESSAGE_SUCCESS, sc->T("saveNewTextures_true", "Textures will now be saved to your storage"), 2.0, "savetexturechanged"); } else { g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("saveNewTextures_false", "Texture saving was disabled"), 2.0, "savetexturechanged"); } + System_PostUIMessage(UIMessage::GPU_CONFIG_CHANGED); break; case VIRTKEY_TEXTURE_REPLACE: g_Config.bReplaceTextures = !g_Config.bReplaceTextures; - if (g_Config.bReplaceTextures) - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("replaceTextures_true", "Texture replacement enabled"), 2.0, "replacetexturechanged"); - else + if (g_Config.bReplaceTextures) { + g_OSD.Show(OSDType::MESSAGE_SUCCESS, sc->T("replaceTextures_true", "Texture replacement enabled"), 2.0, "replacetexturechanged"); + } else { g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("replaceTextures_false", "Textures are no longer being replaced"), 2.0, "replacetexturechanged"); + } System_PostUIMessage(UIMessage::GPU_CONFIG_CHANGED); break; diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 7336981174..f3874e3b3a 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -643,6 +643,11 @@ std::string GetConfirmExitMessage() { confirmMessage += '\n'; } + if (coreState == CORE_RUNTIME_ERROR) { + // The game crashed, or similar. Don't bother checking for timeout or network. + return confirmMessage; + } + if (IsNetworkConnected()) { auto nw = GetI18NCategory(I18NCat::NETWORKING); confirmMessage += nw->T("Network connected"); diff --git a/Windows/RawInput.cpp b/Windows/RawInput.cpp index 6872129716..21082ae555 100644 --- a/Windows/RawInput.cpp +++ b/Windows/RawInput.cpp @@ -177,7 +177,7 @@ namespace WindowsRawInput { { VK_MBUTTON, NKCODE_EXT_MOUSEBUTTON_3 }, { VK_XBUTTON1, NKCODE_EXT_MOUSEBUTTON_4 }, { VK_XBUTTON2, NKCODE_EXT_MOUSEBUTTON_5 }, - { VK_SNAPSHOT, NKCODE_EXT_PRINTSCREEN }, + { VK_SNAPSHOT, NKCODE_PRINTSCREEN }, }; void Init() { diff --git a/ext/imgui/imgui_impl_platform.cpp b/ext/imgui/imgui_impl_platform.cpp index 562d0ed722..17af2b342f 100644 --- a/ext/imgui/imgui_impl_platform.cpp +++ b/ext/imgui/imgui_impl_platform.cpp @@ -244,7 +244,7 @@ ImGuiKey KeyCodeToImGui(InputKeyCode keyCode) { case NKCODE_EXT_MOUSEWHEEL_UP: // Keys ignored for imgui return ImGuiKey_None; - case NKCODE_EXT_PRINTSCREEN: + case NKCODE_PRINTSCREEN: return ImGuiKey_PrintScreen; case NKCODE_EXT_PIPE: