Controllers: Make restore defaults restore controller LED (#12264)

This commit is contained in:
TheTechnician27 authored and GitHub committed 2025-02-03 16:53:55 -05:00
1 parent 282317c46e
commit 33aed95a6c
3 files changed
+12

No files matched your search

+8
View File
@@ -247,6 +247,14 @@ u32 SDLInputSource::ParseRGBForPlayerId(const std::string_view str, u32 player_i
return color;
}
void SDLInputSource::ResetRGBForAllPlayers(SettingsInterface& si)
{
for (u32 player_id = 0; player_id < MAX_LED_COLORS; player_id++)
{
si.DeleteValue("SDLExtra", fmt::format("Player{}LED", player_id).c_str());
}
}
void SDLInputSource::SetHints()
{
if (const std::string upath = Path::Combine(EmuFolders::DataRoot, CONTROLLER_DB_FILENAME); FileSystem::FileExists(upath.c_str()))
+1
View File
@@ -44,6 +44,7 @@ public:
static u32 GetRGBForPlayerId(SettingsInterface& si, u32 player_id);
static u32 ParseRGBForPlayerId(const std::string_view str, u32 player_id);
static void ResetRGBForAllPlayers(SettingsInterface& si);
private:
struct ControllerData
+3
View File
@@ -12,6 +12,8 @@
#include "SIO/Pad/PadNotConnected.h"
#include "SIO/Sio.h"
#include "Input/SDLInputSource.h"
#include "IconsFontAwesome5.h"
#include "VMManager.h"
@@ -167,6 +169,7 @@ void Pad::SetDefaultControllerConfig(SettingsInterface& si)
si.SetBoolValue("Pad", "MultitapPort2", false);
si.SetFloatValue("Pad", "PointerXScale", 8.0f);
si.SetFloatValue("Pad", "PointerYScale", 8.0f);
SDLInputSource::ResetRGBForAllPlayers(si);
// PCSX2 Controller Settings - Default pad types and parameters.
for (u32 i = 0; i < Pad::NUM_CONTROLLER_PORTS; i++)