Config: toggle background controller inputs (#3424)

This commit is contained in:
rainmakerv2
2025-08-17 00:45:54 +08:00
committed by GitHub
parent e93fd00dc7
commit 3a929515e7
7 changed files with 46 additions and 10 deletions

View File

@@ -58,6 +58,7 @@ static bool isMotionControlsEnabled = true;
static bool useUnifiedInputConfig = true;
static std::string micDevice = "Default Device";
static std::string defaultControllerID = "";
static bool backgroundControllerInput = false;
// These two entries aren't stored in the config
static bool overrideControllerColor = false;
@@ -621,6 +622,14 @@ void setDefaultControllerID(std::string id) {
defaultControllerID = id;
}
bool getBackgroundControllerInput() {
return backgroundControllerInput;
}
void setBackgroundControllerInput(bool enable) {
backgroundControllerInput = enable;
}
void load(const std::filesystem::path& path) {
// If the configuration file does not exist, create it and return
std::error_code error;
@@ -680,6 +689,8 @@ void load(const std::filesystem::path& path) {
useUnifiedInputConfig =
toml::find_or<bool>(input, "useUnifiedInputConfig", useUnifiedInputConfig);
micDevice = toml::find_or<std::string>(input, "micDevice", micDevice);
backgroundControllerInput =
toml::find_or<bool>(input, "backgroundControllerInput", backgroundControllerInput);
}
if (data.contains("GPU")) {
@@ -855,6 +866,7 @@ void save(const std::filesystem::path& path) {
data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled;
data["Input"]["useUnifiedInputConfig"] = useUnifiedInputConfig;
data["Input"]["micDevice"] = micDevice;
data["Input"]["backgroundControllerInput"] = backgroundControllerInput;
data["GPU"]["screenWidth"] = windowWidth;
data["GPU"]["screenHeight"] = windowHeight;
data["GPU"]["internalScreenWidth"] = internalScreenWidth;
@@ -960,6 +972,7 @@ void setDefaultValues() {
controllerCustomColorRGB[1] = 0;
controllerCustomColorRGB[2] = 255;
micDevice = "Default Device";
backgroundControllerInput = false;
// GPU
windowWidth = 1280;

View File

@@ -109,6 +109,8 @@ bool getIsMotionControlsEnabled();
void setIsMotionControlsEnabled(bool use);
std::string getDefaultControllerID();
void setDefaultControllerID(std::string id);
bool getBackgroundControllerInput();
void setBackgroundControllerInput(bool enable);
// TODO
bool GetLoadGameSizeEnabled();