From d7dd8d30ccf218c876eb6b1c3ab3101538f78cd8 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 7 Mar 2022 15:22:03 +0100 Subject: [PATCH] GlosSIConfig: Option to use real device ids --- GlosSIConfig/UIModel.cpp | 2 ++ GlosSIConfig/qml/ShortcutProps.qml | 48 ++++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/GlosSIConfig/UIModel.cpp b/GlosSIConfig/UIModel.cpp index 400ccc3..4814af8 100644 --- a/GlosSIConfig/UIModel.cpp +++ b/GlosSIConfig/UIModel.cpp @@ -79,6 +79,7 @@ void UIModel::readConfigs() json["closeOnExit"] = filejson["launch"]["closeOnExit"]; json["waitForChildProcs"] = filejson["launch"]["waitForChildProcs"]; json["hideDevices"] = filejson["devices"]["hideDevices"]; + json["realDeviceIds"] = filejson["devices"]["realDeviceIds"]; json["windowMode"] = filejson["window"]["windowMode"]; json["maxFps"] = filejson["window"]["maxFps"]; json["scale"] = filejson["window"]["scale"]; @@ -350,6 +351,7 @@ void UIModel::writeTarget(const QJsonObject& json, const QString& name) QJsonObject devicesObject; devicesObject["hideDevices"] = json["hideDevices"]; + devicesObject["realDeviceIds"] = json["realDeviceIds"]; fileJson["devices"] = devicesObject; QJsonObject windowObject; diff --git a/GlosSIConfig/qml/ShortcutProps.qml b/GlosSIConfig/qml/ShortcutProps.qml index 10c5ca0..feaaa12 100644 --- a/GlosSIConfig/qml/ShortcutProps.qml +++ b/GlosSIConfig/qml/ShortcutProps.qml @@ -43,7 +43,8 @@ Item { scale: null, icon: null, maxControllers: 4, - disableOverlay: false + disableOverlay: false, + realDeviceIds: false }) function resetInfo() { @@ -61,7 +62,8 @@ Item { scale: null, icon: null, maxControllers: 4, - disableOverlay: false + disableOverlay: false, + realDeviceIds: false }) } @@ -75,7 +77,8 @@ Item { hideDevices.checked = shortcutInfo.hideDevices || false windowMode.checked = shortcutInfo.windowMode || false maxControllersSpinBox.value = shortcutInfo.maxControllers - disableOverlayCheckbox = shortcutInfo.disableOverlay || false + disableOverlayCheckbox.checked = shortcutInfo.disableOverlay || false + realDeviceIds.checked = shortcutInfo.realDeviceIds || false } Column { @@ -253,7 +256,7 @@ Item { } Item { width: 1 - height: 16 + height: 8 } Row { spacing: 16 @@ -261,7 +264,7 @@ Item { RPane { width: parent.width / 2 - 8 - height: 224 + height: 294 radius: 4 Material.elevation: 32 bgOpacity: 0.97 @@ -269,7 +272,7 @@ Item { Column { spacing: 2 width: parent.width - CheckBox { + RadioButton { id: hideDevices text: qsTr("Hide (Real) Controllers") checked: shortcutInfo.hideDevices @@ -292,6 +295,29 @@ Item { width: 1 height: 4 } + RadioButton { + id: realDeviceIds + text: qsTr("Use real device (USB)-IDs") + checked: shortcutInfo.realDeviceIds + onCheckedChanged: shortcutInfo.realDeviceIds = checked + } + Label { + text: qsTr("Only enable if input's are not recognized by the game") + wrapMode: Text.WordWrap + width: parent.width + leftPadding: 32 + topPadding: -8 + } + Label { + text: qsTr("If enabled, device-hiding won't work.\nUse the \"Max. Controller count\" setting!") + wrapMode: Text.WordWrap + width: parent.width + leftPadding: 32 + } + Item { + width: 1 + height: 4 + } Row { leftPadding: 16 Label { @@ -311,7 +337,7 @@ Item { } RPane { width: parent.width / 2 - 8 - height: 224 + height: 294 radius: 4 Material.elevation: 32 bgOpacity: 0.97 @@ -346,17 +372,15 @@ Item { text: qsTr("Disable Steam/GlosSI overlay") checked: shortcutInfo.disableOverlay onCheckedChanged: shortcutInfo.disableOverlay = checked - } - Label { + } + Label { text: qsTr("Only controller emulation - No extra window") wrapMode: Text.WordWrap width: parent.width leftPadding: 32 topPadding: -8 + } } - - } - } } }