From 60162d745ab8a59e517f47789fb3223805fbab73 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 6 Jun 2022 20:31:28 +0200 Subject: [PATCH] GlosSIConfig: Emulate DS4 config --- GlosSIConfig/UIModel.cpp | 2 ++ GlosSIConfig/qml/ShortcutProps.qml | 26 +++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/GlosSIConfig/UIModel.cpp b/GlosSIConfig/UIModel.cpp index 499522e..21472bd 100644 --- a/GlosSIConfig/UIModel.cpp +++ b/GlosSIConfig/UIModel.cpp @@ -86,6 +86,7 @@ void UIModel::readConfigs() json["disableOverlay"] = filejson["window"]["disableOverlay"]; json["maxControllers"] = filejson["controller"]["allowDesktopConfig"]; json["allowDesktopConfig"] = filejson["controller"]["allowDesktopConfig"]; + json["emulateDS4"] = filejson["controller"]["emulateDS4"]; json["name"] = filejson.contains("name") ? filejson["name"] : QString(name).replace(QRegularExpression("\\.json"), ""); @@ -371,6 +372,7 @@ void UIModel::writeTarget(const QJsonObject& json, const QString& name) QJsonObject controllerObject; controllerObject["maxControllers"] = json["maxControllers"]; controllerObject["allowDesktopConfig"] = json["allowDesktopConfig"]; + controllerObject["emulateDS4"] = json["emulateDS4"]; fileJson["controller"] = controllerObject; auto wtf = QString(QJsonDocument(fileJson).toJson(QJsonDocument::Indented)).toStdString(); diff --git a/GlosSIConfig/qml/ShortcutProps.qml b/GlosSIConfig/qml/ShortcutProps.qml index c18cbd2..c4e6eab 100644 --- a/GlosSIConfig/qml/ShortcutProps.qml +++ b/GlosSIConfig/qml/ShortcutProps.qml @@ -46,6 +46,7 @@ Item { disableOverlay: false, realDeviceIds: false, allowDesktopConfig: true, + emulateDS4: false, }) function resetInfo() { @@ -66,6 +67,7 @@ Item { disableOverlay: false, realDeviceIds: false, allowDesktopConfig: true, + emulateDS4: false, }) } @@ -82,6 +84,7 @@ Item { disableOverlayCheckbox.checked = shortcutInfo.disableOverlay || false realDeviceIds.checked = shortcutInfo.realDeviceIds || false allowDesktopConfig.checked = shortcutInfo.allowDesktopConfig || true + emulateDS4.checked = shortcutInfo.emulateDS4 || false } Flickable { @@ -318,7 +321,7 @@ Item { RPane { width: parent.width / 2 - 8 - height: 294 + height: 394 radius: 4 Material.elevation: 32 bgOpacity: 0.97 @@ -326,7 +329,7 @@ Item { Column { spacing: 2 width: parent.width - RadioButton { + CheckBox { id: hideDevices text: qsTr("Hide (Real) Controllers") checked: shortcutInfo.hideDevices @@ -349,7 +352,7 @@ Item { width: 1 height: 4 } - RadioButton { + CheckBox { id: realDeviceIds text: qsTr("Use real device (USB)-IDs") checked: shortcutInfo.realDeviceIds @@ -372,6 +375,23 @@ Item { width: 1 height: 4 } + CheckBox { + id: emulateDS4 + text: qsTr("Emulate DS4") + checked: shortcutInfo.emulateDS4 + onCheckedChanged: shortcutInfo.emulateDS4 = checked + } + Label { + text: qsTr("Instead of X360 Pad; Disable \"Playstation Configuration support\" in Steam") + wrapMode: Text.WordWrap + width: parent.width + leftPadding: 32 + topPadding: -8 + } + Item { + width: 1 + height: 4 + } Row { leftPadding: 16 Label {