Add motion controls toggle (#2029)

* Add motion controls toggle

* clang
This commit is contained in:
kalaposfos13 2025-01-07 10:50:54 +01:00 committed by GitHub
parent 86038e6a71
commit c3ecf599ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 39 additions and 17 deletions

View file

@ -47,6 +47,7 @@ static std::string updateChannel;
static std::string backButtonBehavior = "left";
static bool useSpecialPad = false;
static int specialPadClass = 1;
static bool isMotionControlsEnabled = true;
static bool isDebugDump = false;
static bool isShaderDebug = false;
static bool isShowSplash = false;
@ -172,6 +173,10 @@ int getSpecialPadClass() {
return specialPadClass;
}
bool getIsMotionControlsEnabled() {
return isMotionControlsEnabled;
}
bool debugDump() {
return isDebugDump;
}
@ -368,6 +373,10 @@ void setSpecialPadClass(int type) {
specialPadClass = type;
}
void setIsMotionControlsEnabled(bool use) {
isMotionControlsEnabled = use;
}
void setSeparateUpdateEnabled(bool use) {
separateupdatefolder = use;
}
@ -594,6 +603,7 @@ void load(const std::filesystem::path& path) {
backButtonBehavior = toml::find_or<std::string>(input, "backButtonBehavior", "left");
useSpecialPad = toml::find_or<bool>(input, "useSpecialPad", false);
specialPadClass = toml::find_or<int>(input, "specialPadClass", 1);
isMotionControlsEnabled = toml::find_or<bool>(input, "isMotionControlsEnabled", true);
}
if (data.contains("GPU")) {
@ -709,6 +719,7 @@ void save(const std::filesystem::path& path) {
data["Input"]["backButtonBehavior"] = backButtonBehavior;
data["Input"]["useSpecialPad"] = useSpecialPad;
data["Input"]["specialPadClass"] = specialPadClass;
data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled;
data["GPU"]["screenWidth"] = screenWidth;
data["GPU"]["screenHeight"] = screenHeight;
data["GPU"]["nullGpu"] = isNullGpu;

View file

@ -38,6 +38,7 @@ int getCursorHideTimeout();
std::string getBackButtonBehavior();
bool getUseSpecialPad();
int getSpecialPadClass();
bool getIsMotionControlsEnabled();
u32 getScreenWidth();
u32 getScreenHeight();
@ -84,6 +85,7 @@ void setCursorHideTimeout(int newcursorHideTimeout);
void setBackButtonBehavior(const std::string& type);
void setUseSpecialPad(bool use);
void setSpecialPadClass(int type);
void setIsMotionControlsEnabled(bool use);
void setLogType(const std::string& type);
void setLogFilter(const std::string& type);
@ -139,4 +141,4 @@ void setDefaultValues();
// settings
u32 GetLanguage();
}; // namespace Config
}; // namespace Config