mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
Config: toggle background controller inputs (#3424)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user