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:
rainmakerv2
2025-07-31 02:37:45 +08:00
committed by GitHub
parent 35132d9fdc
commit c924c20575
10 changed files with 515 additions and 255 deletions

View File

@@ -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;

View File

@@ -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();