From 049d6ecd0c60e017713c36393c8ff935f21880fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 23 Nov 2025 19:54:02 +0100 Subject: [PATCH] Fix oversight causing wrong initialization of button visibility --- Core/Config.cpp | 33 +++++++++++++++++---------------- Core/Config.h | 21 ++++++++++++++------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 781b41ef2f..478e69ccd9 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -849,24 +849,25 @@ static const ConfigTouchPos defaultTouchPosHide = { -1.0f, -1.0f, defaultControl void TouchControlConfig::ResetLayout() { // reset puts the settings in a state so they'll then get properly reinitialized in InitPadLayout. - auto reset = [](ConfigTouchPos &pos) { - pos.x = defaultTouchPosShow.x; - pos.y = defaultTouchPosShow.y; - pos.scale = defaultTouchPosShow.scale; + // Intentionally don't modify 'show' here, this is only done in ResetToDefault. + auto reset = [](ConfigTouchPos *pos) { + pos->x = defaultTouchPosShow.x; + pos->y = defaultTouchPosShow.y; + pos->scale = defaultTouchPosShow.scale; }; - reset(touchActionButtonCenter); + reset(&touchActionButtonCenter); fActionButtonSpacing = 1.0f; - reset(touchDpad); + reset(&touchDpad); fDpadSpacing = 1.0f; - reset(touchStartKey); - reset(touchSelectKey); - reset(touchFastForwardKey); - reset(touchLKey); - reset(touchRKey); - reset(touchAnalogStick); - reset(touchRightAnalogStick); + reset(&touchStartKey); + reset(&touchSelectKey); + reset(&touchFastForwardKey); + reset(&touchLKey); + reset(&touchRKey); + reset(&touchAnalogStick); + reset(&touchRightAnalogStick); for (int i = 0; i < CUSTOM_BUTTON_COUNT; i++) { - reset(touchCustom[i]); + reset(&touchCustom[i]); } fLeftStickHeadScale = 1.0f; fRightStickHeadScale = 1.0f; @@ -1255,7 +1256,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { IniFile iniFile; if (!iniFile.Load(iniFilename_)) { - ERROR_LOG(Log::Loader, "Failed to read '%s'. Setting config to default.", iniFilename_.c_str()); + WARN_LOG(Log::Loader, "Failed to read '%s'. Setting main config to default.", iniFilename_.c_str()); // Continue anyway to initialize the config. } @@ -1820,7 +1821,7 @@ void Config::UnloadGameConfig() { void Config::LoadStandardControllerIni() { IniFile controllerIniFile; if (!controllerIniFile.Load(controllerIniFilename_)) { - ERROR_LOG(Log::Loader, "Failed to read %s. Setting controller config to default.", controllerIniFilename_.c_str()); + WARN_LOG(Log::Loader, "Failed to read '%s'. Setting controller config to default.", controllerIniFilename_.c_str()); KeyMap::RestoreDefault(); } else { // Continue anyway to initialize the config. It will just restore the defaults. diff --git a/Core/Config.h b/Core/Config.h index cc568ff735..03fdafdbce 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -97,15 +97,22 @@ struct DisplayLayoutConfig : public ConfigBlock { }; struct TouchControlConfig : public ConfigBlock { - //space between PSP buttons - //the PSP button's center (triangle, circle, square, cross) + constexpr TouchControlConfig() { + // Hide all extras and custom buttons by default. + touchRightAnalogStick.show = false; + for (size_t i = 0; i < CUSTOM_BUTTON_COUNT; i++) { + touchCustom[i].show = false; + } + } + // the PSP button's center (triangle, circle, square, cross) ConfigTouchPos touchActionButtonCenter; - float fActionButtonSpacing = 0.0f; - //radius of the D-pad (PSP cross) - // int iDpadRadius; - //the D-pad (PSP cross) position + // space between those PSP buttons + float fActionButtonSpacing = 1.0f; + // the D-pad (PSP cross) position ConfigTouchPos touchDpad; - float fDpadSpacing = 0.0f; + // And its spacing. + float fDpadSpacing = 1.0f; + ConfigTouchPos touchStartKey; ConfigTouchPos touchSelectKey; ConfigTouchPos touchFastForwardKey;