Initial implementation of controller color config (#2411)

This commit is contained in:
kalaposfos13 2025-02-14 11:30:49 +01:00 committed by GitHub
parent ad43ba5ec7
commit 1cc9e0d37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 73 additions and 10 deletions

View file

@ -71,6 +71,8 @@ static bool rdocEnable = false;
static s16 cursorState = HideCursorState::Idle;
static int cursorHideTimeout = 5; // 5 seconds (default)
static bool useUnifiedInputConfig = true;
static bool overrideControllerColor = false;
static int controllerCustomColorRGB[3] = {0, 0, 255};
static bool separateupdatefolder = false;
static bool compatibilityData = false;
static bool checkCompatibilityOnStartup = false;
@ -115,6 +117,24 @@ void SetUseUnifiedInputConfig(bool use) {
useUnifiedInputConfig = use;
}
bool GetOverrideControllerColor() {
return overrideControllerColor;
}
void SetOverrideControllerColor(bool enable) {
overrideControllerColor = enable;
}
int* GetControllerCustomColor() {
return controllerCustomColorRGB;
}
void SetControllerCustomColor(int r, int b, int g) {
controllerCustomColorRGB[0] = r;
controllerCustomColorRGB[1] = b;
controllerCustomColorRGB[2] = g;
}
std::string getTrophyKey() {
return trophyKey;
}
@ -1046,6 +1066,8 @@ axis_right_y = axis_right_y
# Range of deadzones: 1 (almost none) to 127 (max)
analog_deadzone = leftjoystick, 2, 127
analog_deadzone = rightjoystick, 2, 127
override_controller_color = false, 0, 0, 255
)";
}
std::filesystem::path GetFoolproofKbmConfigFile(const std::string& game_id) {

View file

@ -47,6 +47,10 @@ int getSpecialPadClass();
bool getIsMotionControlsEnabled();
bool GetUseUnifiedInputConfig();
void SetUseUnifiedInputConfig(bool use);
bool GetOverrideControllerColor();
void SetOverrideControllerColor(bool enable);
int* GetControllerCustomColor();
void SetControllerCustomColor(int r, int b, int g);
u32 getScreenWidth();
u32 getScreenHeight();