mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
Multiple controllers: Select active controller and set default controller (#3169)
* initial commit - not cleanup yet, not usable with imGUI * Ugly solution to working with ImGUI * Populate the default controller labels * Add remove default button * missing tr calls * edit imgui flag after updating * Refactor * Update sirit
This commit is contained in:
@@ -57,6 +57,7 @@ static int specialPadClass = 1;
|
||||
static bool isMotionControlsEnabled = true;
|
||||
static bool useUnifiedInputConfig = true;
|
||||
static std::string micDevice = "Default Device";
|
||||
static std::string defaultControllerID = "";
|
||||
|
||||
// These two entries aren't stored in the config
|
||||
static bool overrideControllerColor = false;
|
||||
@@ -612,6 +613,14 @@ void setPSNSignedIn(bool sign) {
|
||||
isPSNSignedIn = sign;
|
||||
}
|
||||
|
||||
std::string getDefaultControllerID() {
|
||||
return defaultControllerID;
|
||||
}
|
||||
|
||||
void setDefaultControllerID(std::string id) {
|
||||
defaultControllerID = id;
|
||||
}
|
||||
|
||||
void load(const std::filesystem::path& path) {
|
||||
// If the configuration file does not exist, create it and return
|
||||
std::error_code error;
|
||||
@@ -656,6 +665,7 @@ void load(const std::filesystem::path& path) {
|
||||
isConnectedToNetwork =
|
||||
toml::find_or<bool>(general, "isConnectedToNetwork", isConnectedToNetwork);
|
||||
chooseHomeTab = toml::find_or<std::string>(general, "chooseHomeTab", chooseHomeTab);
|
||||
defaultControllerID = toml::find_or<std::string>(general, "defaultControllerID", "");
|
||||
}
|
||||
|
||||
if (data.contains("Input")) {
|
||||
@@ -837,6 +847,7 @@ void save(const std::filesystem::path& path) {
|
||||
data["General"]["compatibilityEnabled"] = compatibilityData;
|
||||
data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup;
|
||||
data["General"]["isConnectedToNetwork"] = isConnectedToNetwork;
|
||||
data["General"]["defaultControllerID"] = defaultControllerID;
|
||||
data["Input"]["cursorState"] = cursorState;
|
||||
data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
|
||||
data["Input"]["useSpecialPad"] = useSpecialPad;
|
||||
|
||||
@@ -107,6 +107,8 @@ bool isDevKitConsole(); // no set
|
||||
bool vkValidationGpuEnabled(); // no set
|
||||
bool getIsMotionControlsEnabled();
|
||||
void setIsMotionControlsEnabled(bool use);
|
||||
std::string getDefaultControllerID();
|
||||
void setDefaultControllerID(std::string id);
|
||||
|
||||
// TODO
|
||||
bool GetLoadGameSizeEnabled();
|
||||
|
||||
Reference in New Issue
Block a user