mirror of https://github.com/PCSX2/pcsx2.git
Controllers: Make restore defaults restore controller LED (#12264)
This commit is contained in:
parent
282317c46e
commit
33aed95a6c
|
@ -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()))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++)
|
||||
|
|
Loading…
Reference in New Issue