From 265478ee6ad4f9e7eb225e589362f435ac15bd79 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 7 Mar 2022 15:26:16 +0100 Subject: [PATCH] GlosSITarget: parse & use real device id setting from json --- GlosSITarget/InputRedirector.cpp | 3 ++- GlosSITarget/Resource.rc | 32 ++++++++++++++++++++++++++++---- GlosSITarget/Settings.h | 2 ++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/GlosSITarget/InputRedirector.cpp b/GlosSITarget/InputRedirector.cpp index 1db6fec..d9b0382 100644 --- a/GlosSITarget/InputRedirector.cpp +++ b/GlosSITarget/InputRedirector.cpp @@ -51,6 +51,7 @@ void InputRedirector::run() run_ = vigem_connected_; controller_thread_ = std::thread(&InputRedirector::runLoop, this); max_controller_count_ = Settings::controller.maxControllers; + use_real_vid_pid_ = Settings::devices.realDeviceIds; #ifdef _WIN32 Overlay::AddOverlayElem([this]() { ImGui::SetNextWindowPos({650, 450}, ImGuiCond_FirstUseEver); @@ -75,7 +76,7 @@ void InputRedirector::run() ImGui::Text("When changing this, it's advised to also set Max. controller count"); ImGui::Text("to prevent having multiple mirrored controllers plugged in"); ImGui::Spacing(); - ImGui::Text("If enabled, Device hiding can't show if a controller is emulated."); + ImGui::Text("If enabled, Device hiding won't work! Use \"Max. Controller count\"-setting."); bool use_real_copy = use_real_vid_pid_; ImGui::Checkbox("Use real USB-IDs", &use_real_copy); if (use_real_vid_pid_ != use_real_copy) { diff --git a/GlosSITarget/Resource.rc b/GlosSITarget/Resource.rc index 9933f08..263c9f9 100644 --- a/GlosSITarget/Resource.rc +++ b/GlosSITarget/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,4,20068 - PRODUCTVERSION 0,0,4,20068 + FILEVERSION 0,0,5,003000770004 + PRODUCTVERSION 0,0,5,003000770004 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "FileDescription", "GlosSI - SteamTarget" - VALUE "FileVersion", "0.0.4.1-23-g23aebd4" + VALUE "FileVersion", "0.0.5.0-3-gf77e0c4" VALUE "InternalName", "GlosSITarget" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSITarget.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.4.1-23-g23aebd4" + VALUE "ProductVersion", "0.0.5.0-3-gf77e0c4" END END BLOCK "VarFileInfo" @@ -108,3 +108,27 @@ IDI_ICON1 ICON "GloSC_Icon.ico" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GlosSITarget/Settings.h b/GlosSITarget/Settings.h index b374e1a..cc5d943 100644 --- a/GlosSITarget/Settings.h +++ b/GlosSITarget/Settings.h @@ -34,6 +34,7 @@ inline struct Launch { inline struct Devices { bool hideDevices = true; + bool realDeviceIds = false; } devices; inline struct Window { @@ -119,6 +120,7 @@ inline void Parse(std::string arg1) if (auto devconf = json["devices"]; devconf.is_object()) { safeParseValue(devconf, "hideDevices", devices.hideDevices); + safeParseValue(devconf, "realDeviceIds", devices.realDeviceIds); } if (auto winconf = json["window"]; winconf.is_object()) {