From ae45a9918bcecb0b51bc12a280f0bbcf7e53b4db Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Thu, 16 Jun 2022 23:31:22 +0200 Subject: [PATCH 01/24] Fix build Fix stupid visual studio paths My gosh, you suck! Why cannot it be **easily** possible to include icons RELATIV THE THE FUCKING SOLUTION?! FUCK MICROCRAP --- GlosSIConfig/GlosSIConfig.vcxproj | 3 +- GlosSIConfig/GlosSIConfig.vcxproj.filters | 7 ++--- GlosSIConfig/RCa37628 | Bin 0 -> 5264 bytes GlosSIConfig/Resource.rc | 34 ++++++---------------- GlosSIConfig/resource.h | 4 ++- GlosSIConfig/resource1.h | 16 ---------- 6 files changed, 15 insertions(+), 49 deletions(-) create mode 100644 GlosSIConfig/RCa37628 delete mode 100644 GlosSIConfig/resource1.h diff --git a/GlosSIConfig/GlosSIConfig.vcxproj b/GlosSIConfig/GlosSIConfig.vcxproj index 27d75f2..9fa364f 100644 --- a/GlosSIConfig/GlosSIConfig.vcxproj +++ b/GlosSIConfig/GlosSIConfig.vcxproj @@ -153,7 +153,6 @@ - @@ -165,7 +164,7 @@ - + diff --git a/GlosSIConfig/GlosSIConfig.vcxproj.filters b/GlosSIConfig/GlosSIConfig.vcxproj.filters index 1f02ba1..58136fc 100644 --- a/GlosSIConfig/GlosSIConfig.vcxproj.filters +++ b/GlosSIConfig/GlosSIConfig.vcxproj.filters @@ -84,9 +84,6 @@ Header Files - - Header Files - Header Files @@ -102,8 +99,8 @@ - - Resource Files + + Resource Files \ No newline at end of file diff --git a/GlosSIConfig/RCa37628 b/GlosSIConfig/RCa37628 new file mode 100644 index 0000000000000000000000000000000000000000..1ee8931259a25ecc10f7cf13ab57271773c6e2de GIT binary patch literal 5264 zcmdUz+fE}#5QghIQr@9s-(-~y!5qYrJFvmA;su0_m6ebz$Ji{%u8kN7yHXxL-`_P2 zGsZULBzZL&&rEey*P;Kau6ETv*p*FeWWj1yv4;I<=UjV{KCtch)v&1z?an^JH?dpG zBDIHP26X^$-#XCm>;l@9uM@lB`5XMh2mU5}QzSapit@$pIwKPsBYhdiPLa%@-7(LQ z_qF(}*w^-zRZBLD@&i|}w@448UP+G88?0z!u)2N670@9+M(_^c8ew(dy{s{yU$b4= zH9Tukv-G$HirEl5^SJs1noh5{xM$d&J^r>~2JF zRv$envjY`nUR_D!o@0*)*)T^)jc6{G+-J^atW+V!W6>UPZtM9zAS`(7iYu^bn^9gh zZoW33|52aptxy$accIyOcMdMj$rj&*D!e~u$!@e{bD<^DJZs0_)v^T=J>uFC)G;Uv zJ=>qwwx_r&#%{}Y;#^-67JFpm4b@DY(&WMVSqv&$MeC8}eSQz9C+eKk5A-AI4tZCH zQyfvWM3>|tTx~|n903fxj`t4FTI4)o?qiU7MwRQnfIrQA7^_ngyWUczI@AWu{s}yf z8F7z_RYmpl0Q{VhH$@8{=W+SkgY<~XpAoNR-0KDIgr_3^F_!tfTUe)SE0;)qbm^~7 zu&k^-jd~p}^CX?+Tu`+>CWeYb1+BNNvvTy3wYb8Q5i6oDcbaG9GHJJTH(L8Ezn;To zi5^i`k0i@0=v6PJnm@76;9wB@^-A1JD)={wd*%(i>aMTpDSn4XUGn$bhuEjDjFBnN z4!`Q5@1d%La{XnE$*TtA#ctV=oirEweAiX%_Lt3D&XhFYI-Rxd9d4ajwAN+26lL`X zH#~JZnTF2Q`o>swXvXM?uJ%0f-Xa;GYZY|97xw^uN$3Qx zD&*@D;&*YE^mDrUTp>O~a>#6Y)A>L-ugnjTrddC5=_LO-AN|PF&yBLU6?f7)HTx)L zXp5ZHyK>qyrUOO0t!r7!?Qy&p`;cAs6ve9=EhzUi|IG{hx{Azg%f{$I|18q((maDPgrEG!Oq1vQattlHUF=P#>l? literal 0 HcmV?d00001 diff --git a/GlosSIConfig/Resource.rc b/GlosSIConfig/Resource.rc index 7afb4f1..9fd0612 100644 --- a/GlosSIConfig/Resource.rc +++ b/GlosSIConfig/Resource.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "resource1.h" +#include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -27,12 +27,12 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 1 TEXTINCLUDE BEGIN - "resource1.h\0" + "resource.h\0" END 2 TEXTINCLUDE BEGIN - "#include ""winres.h""\r\n" + "#include winres.h\r\n" "\0" END @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,7,004000070037 - PRODUCTVERSION 0,0,7,004000070037 + FILEVERSION 0,0,7,1 + PRODUCTVERSION 0,0,7,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "FileDescription", "GlosSI - Config" - VALUE "FileVersion", "0.0.7.0-4-gcf7ad37" + VALUE "FileVersion", "0.0.7.1" VALUE "InternalName", "GlosSIConfig" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSIConfig.exe" - VALUE "ProductName", "GlosSi" - VALUE "ProductVersion", "0.0.7.0-4-gcf7ad37" + VALUE "ProductName", "GlosSI" + VALUE "ProductVersion", "0.0.7.1" END END BLOCK "VarFileInfo" @@ -91,7 +91,7 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICON1 ICON "D:\\Alia5\\Documents\\Visual_Studio_Projects\\GlosSI\\GloSC_Icon.ico" +IDI_ICON1 ICON "..\GloSC_Icon.ico" #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// @@ -108,19 +108,3 @@ IDI_ICON1 ICON "D:\\Alia5\\Documents\\Visual_St ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED - - - - - - - - - - - - - - - - diff --git a/GlosSIConfig/resource.h b/GlosSIConfig/resource.h index 7ca31da..191b694 100644 --- a/GlosSIConfig/resource.h +++ b/GlosSIConfig/resource.h @@ -1,12 +1,14 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Resource.rc +// +#define IDI_ICON1 101 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/GlosSIConfig/resource1.h b/GlosSIConfig/resource1.h deleted file mode 100644 index 191b694..0000000 --- a/GlosSIConfig/resource1.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Resource.rc -// -#define IDI_ICON1 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif From d15320b1399c35a1853d911409d6f2bbd187e83b Mon Sep 17 00:00:00 2001 From: LemmusLemmus <63229554+LemmusLemmus@users.noreply.github.com> Date: Wed, 13 Jul 2022 22:53:57 +0200 Subject: [PATCH 02/24] Fix Unicode support for paths on Windows. [1/2] --- GlosSIConfig/UIModel.cpp | 4 ++-- GlosSIConfig/VDFParser.h | 6 +++--- GlosSIConfig/main.cpp | 5 ++--- GlosSITarget/Overlay.cpp | 5 ++++- GlosSITarget/Settings.h | 18 +++++++++--------- GlosSITarget/SteamTarget.cpp | 2 +- GlosSITarget/SteamTarget.h | 2 +- GlosSITarget/main.cpp | 22 +++++++++++++--------- 8 files changed, 35 insertions(+), 29 deletions(-) diff --git a/GlosSIConfig/UIModel.cpp b/GlosSIConfig/UIModel.cpp index 21472bd..f96bfd9 100644 --- a/GlosSIConfig/UIModel.cpp +++ b/GlosSIConfig/UIModel.cpp @@ -39,7 +39,7 @@ UIModel::UIModel() : QObject(nullptr) std::filesystem::create_directories(path); config_path_ = path; - config_dir_name_ = (path /= "Targets").string().data(); + config_dir_name_ = QString::fromStdWString((path /= "Targets").wstring().data()); if (!std::filesystem::exists(path)) std::filesystem::create_directories(path); @@ -58,7 +58,7 @@ void UIModel::readConfigs() std::for_each(entries.begin(), entries.end(), [this](const auto& name) { auto path = config_path_; - path /= config_dir_name_.toStdString(); + path /= config_dir_name_.toStdWString(); path /= name.toStdWString(); QFile file(path); if (!file.open(QIODevice::Text | QIODevice::ReadOnly)) { diff --git a/GlosSIConfig/VDFParser.h b/GlosSIConfig/VDFParser.h index 6200b48..dca5287 100644 --- a/GlosSIConfig/VDFParser.h +++ b/GlosSIConfig/VDFParser.h @@ -326,7 +326,7 @@ class Parser { { VDFFile vdffile; - ifile.open(path.string(), std::ios::binary | std::ios::in); + ifile.open(path, std::ios::binary | std::ios::in); if (!ifile.is_open()) { return {}; } @@ -489,9 +489,9 @@ class Parser { static inline bool writeShortcuts(std::filesystem::path path, const VDFFile& vdffile) { - const auto copied = std::filesystem::copy_file(path, path.string() + ".bak", std::filesystem::copy_options::update_existing); + const auto copied = std::filesystem::copy_file(path, path.wstring() + L".bak", std::filesystem::copy_options::update_existing); - ofile.open(path.string(), std::ios::binary | std::ios::out); + ofile.open(path.wstring(), std::ios::binary | std::ios::out); if (!ofile.is_open()) { return false; } diff --git a/GlosSIConfig/main.cpp b/GlosSIConfig/main.cpp index e3da593..91fc322 100644 --- a/GlosSIConfig/main.cpp +++ b/GlosSIConfig/main.cpp @@ -106,7 +106,6 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext&, const QString& std::cout << txt.toStdString() << "\n"; } - int main(int argc, char* argv[]) { @@ -140,14 +139,14 @@ int main(int argc, char* argv[]) if (argc >= 4) { if (QString::fromStdString(argv[1]) == "remove") { const auto write_res = uimodel.removeFromSteam( - QString::fromStdString(argv[2]), QString::fromStdString(argv[3]), true); + QCoreApplication::arguments().at(2), QCoreApplication::arguments().at(3), true); if (write_res) { return 0; } return 1; } else if (QString::fromStdString(argv[1]) == "add") { const auto write_res = uimodel.addToSteam( - QString::fromStdString(argv[2]), QString::fromStdString(argv[3]), true); + QCoreApplication::arguments().at(2), QCoreApplication::arguments().at(3), true); if (write_res) { return 0; } diff --git a/GlosSITarget/Overlay.cpp b/GlosSITarget/Overlay.cpp index d84a938..d317175 100644 --- a/GlosSITarget/Overlay.cpp +++ b/GlosSITarget/Overlay.cpp @@ -17,6 +17,8 @@ limitations under the License. #include #include +#include +#include #include "Roboto.h" @@ -53,7 +55,8 @@ Overlay::Overlay( if (!std::filesystem::exists(config_path)) std::filesystem::create_directories(config_path); config_path /= "imgui.ini"; - config_file_name_ = config_path.string(); + // This assumes that char is utf8 and wchar_t is utf16, which is guaranteed on Windows. + config_file_name_ = std::wstring_convert>().to_bytes(config_path.wstring()); io.IniFilename = config_file_name_.data(); #endif diff --git a/GlosSITarget/Settings.h b/GlosSITarget/Settings.h index f538260..63b5afd 100644 --- a/GlosSITarget/Settings.h +++ b/GlosSITarget/Settings.h @@ -20,6 +20,8 @@ limitations under the License. #include #include #include +#include +#include namespace Settings { @@ -62,10 +64,10 @@ inline bool checkIsUwp(const std::wstring& launch_path) return false; } -inline void Parse(std::string arg1) +inline void Parse(std::wstring arg1) { - if (!arg1.ends_with(".json")) { - arg1 += ".json"; + if (!arg1.ends_with(L".json")) { + arg1 += L".json"; } std::filesystem::path path(arg1); if (path.has_extension() && !std::filesystem::exists(path)) { @@ -82,7 +84,7 @@ inline void Parse(std::string arg1) std::ifstream json_file; json_file.open(path); if (!json_file.is_open()) { - spdlog::error("Couldn't open settings file {}", path.string()); + spdlog::error(L"Couldn't open settings file {}", path.wstring()); return; } const auto json = nlohmann::json::parse(json_file); @@ -111,10 +113,8 @@ inline void Parse(std::string arg1) std::string meh; safeParseValue(object, key, meh); if (!meh.empty()) { - value.clear(); - std::ranges::transform(meh, std::back_inserter(value), [](const auto& ch) { - return static_cast(ch); - }); + // This assumes that char is utf8 and wchar_t is utf16, which is guaranteed on Windows. + value = std::wstring_convert>().from_bytes(meh); } }; @@ -146,7 +146,7 @@ inline void Parse(std::string arg1) json_file.close(); - spdlog::debug("Read config file \"{}\"", path.string()); + spdlog::debug(L"Read config file \"{}\"", path.wstring()); if (launch.launch) { launch.isUWP = checkIsUwp(launch.launchPath); diff --git a/GlosSITarget/SteamTarget.cpp b/GlosSITarget/SteamTarget.cpp index f796eb1..841ce39 100644 --- a/GlosSITarget/SteamTarget.cpp +++ b/GlosSITarget/SteamTarget.cpp @@ -30,7 +30,7 @@ limitations under the License. #include #endif -SteamTarget::SteamTarget(int argc, char* argv[]) +SteamTarget::SteamTarget() : window_( [this] { run_ = false; }, [this] { toggleGlossiOverlay(); }, diff --git a/GlosSITarget/SteamTarget.h b/GlosSITarget/SteamTarget.h index 65e47db..ccff866 100644 --- a/GlosSITarget/SteamTarget.h +++ b/GlosSITarget/SteamTarget.h @@ -32,7 +32,7 @@ limitations under the License. class SteamTarget { public: - explicit SteamTarget(int argc, char* argv[]); + explicit SteamTarget(); int run(); private: diff --git a/GlosSITarget/main.cpp b/GlosSITarget/main.cpp index c248a66..b1101ac 100644 --- a/GlosSITarget/main.cpp +++ b/GlosSITarget/main.cpp @@ -27,6 +27,7 @@ limitations under the License. #include "OverlayLogSink.h" #include "Settings.h" +#include #ifdef _WIN32 @@ -126,9 +127,10 @@ int main(int argc, char* argv[]) if (!std::filesystem::exists(path)) std::filesystem::create_directories(path); path /= "glossitarget.log"; - const auto file_sink = std::make_shared(path.string(), true); + // For "path.wstring()" to be usable here, "#define SPDLOG_WCHAR_FILENAMES" in "tweakme.h" has to be uncommented. + const auto file_sink = std::make_shared(path.wstring(), true); #else - auto file_sink = std::make_shared("/tmp/glossitarget.log", true); + auto file_sink = std::make_shared(L"/tmp/glossitarget.log", true); #endif file_sink->set_level(spdlog::level::trace); @@ -148,21 +150,23 @@ int main(int argc, char* argv[]) auto exit = 1; try { #ifdef _WIN32 - std::string argsv = ""; - if (__argc > 1) { - for (int i = 1; i < __argc; i++) - argsv += i == 1 ? __argv[i] : std::string(" ") + __argv[i]; + int numArgs; + LPWSTR* args = CommandLineToArgvW(GetCommandLine(), &numArgs); + std::wstring argsv = L""; + if (numArgs > 1) { + for (int i = 1; i < numArgs; i++) + argsv += i == 1 ? args[i] : std::wstring(L" ") + args[i]; } Settings::Parse(argsv); - SteamTarget target(__argc, __argv); -#else + SteamTarget target; +#else // Code below is broken now due to parse requiring std::wstring instead of std:string. Sorry. std::string argsv = ""; if (argc > 1) { for (int i = 1; i < argc; i++) argsv += i == 1 ? argv[i] : std::string(" ") + argv[i]; } Settings::Parse(argsv); - SteamTarget target(argc, argv); + SteamTarget target; #endif exit = target.run(); } From c9283a61adad19eb143534cd02ad3759e16b079c Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Tue, 26 Jul 2022 12:01:56 +0200 Subject: [PATCH 03/24] Default allowDesktopConfig to false Users reported issues with UWP/Launcher titles not handling inputs properly I believe that this is due to this config. Let's just default that to false to emulate ol GloSCs behaviour --- GlosSIConfig/qml/ShortcutProps.qml | 6 +++--- GlosSITarget/Settings.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GlosSIConfig/qml/ShortcutProps.qml b/GlosSIConfig/qml/ShortcutProps.qml index c4e6eab..075ec39 100644 --- a/GlosSIConfig/qml/ShortcutProps.qml +++ b/GlosSIConfig/qml/ShortcutProps.qml @@ -45,7 +45,7 @@ Item { maxControllers: 4, disableOverlay: false, realDeviceIds: false, - allowDesktopConfig: true, + allowDesktopConfig: false, emulateDS4: false, }) @@ -66,7 +66,7 @@ Item { maxControllers: 4, disableOverlay: false, realDeviceIds: false, - allowDesktopConfig: true, + allowDesktopConfig: false, emulateDS4: false, }) } @@ -83,7 +83,7 @@ Item { maxControllersSpinBox.value = shortcutInfo.maxControllers disableOverlayCheckbox.checked = shortcutInfo.disableOverlay || false realDeviceIds.checked = shortcutInfo.realDeviceIds || false - allowDesktopConfig.checked = shortcutInfo.allowDesktopConfig || true + allowDesktopConfig.checked = shortcutInfo.allowDesktopConfig || false emulateDS4.checked = shortcutInfo.emulateDS4 || false } diff --git a/GlosSITarget/Settings.h b/GlosSITarget/Settings.h index f538260..f942c71 100644 --- a/GlosSITarget/Settings.h +++ b/GlosSITarget/Settings.h @@ -46,7 +46,7 @@ inline struct Window { inline struct Controller { int maxControllers = 4; - bool allowDesktopConfig = Settings::launch.launch; + bool allowDesktopConfig = false; bool emulateDS4 = false; } controller; From 4f6889d3d3b1bf9a988e4f81e7bb5f0ec665c998 Mon Sep 17 00:00:00 2001 From: LemmusLemmus <63229554+LemmusLemmus@users.noreply.github.com> Date: Tue, 26 Jul 2022 15:35:59 +0200 Subject: [PATCH 04/24] Fix Unicode support for paths on Windows. [2/2] --- GlosSITarget/GlosSITarget.vcxproj | 4 ++-- GlosSITarget/main.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GlosSITarget/GlosSITarget.vcxproj b/GlosSITarget/GlosSITarget.vcxproj index 7299866..0343586 100644 --- a/GlosSITarget/GlosSITarget.vcxproj +++ b/GlosSITarget/GlosSITarget.vcxproj @@ -125,7 +125,7 @@ Level3 true - _DEBUG;SPDLOG_WCHAR_TO_UTF8_SUPPORT;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SUBHOOK_STATIC;%(PreprocessorDefinitions) + _DEBUG;SPDLOG_WCHAR_TO_UTF8_SUPPORT;SPDLOG_WCHAR_FILENAMES;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SUBHOOK_STATIC;%(PreprocessorDefinitions) true stdcpp20 @@ -148,7 +148,7 @@ true true true - NDEBUG;SPDLOG_WCHAR_TO_UTF8_SUPPORT;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SUBHOOK_STATIC;%(PreprocessorDefinitions) + NDEBUG;SPDLOG_WCHAR_TO_UTF8_SUPPORT;SPDLOG_WCHAR_FILENAMES;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SUBHOOK_STATIC;%(PreprocessorDefinitions) true stdcpp20 diff --git a/GlosSITarget/main.cpp b/GlosSITarget/main.cpp index b1101ac..ec6ee4e 100644 --- a/GlosSITarget/main.cpp +++ b/GlosSITarget/main.cpp @@ -127,7 +127,7 @@ int main(int argc, char* argv[]) if (!std::filesystem::exists(path)) std::filesystem::create_directories(path); path /= "glossitarget.log"; - // For "path.wstring()" to be usable here, "#define SPDLOG_WCHAR_FILENAMES" in "tweakme.h" has to be uncommented. + // For "path.wstring()" to be usable here, SPDLOG_WCHAR_FILENAMES must be defined. const auto file_sink = std::make_shared(path.wstring(), true); #else auto file_sink = std::make_shared(L"/tmp/glossitarget.log", true); From 349e41125934687b759bc3798370f14e5f9f1e79 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Tue, 26 Jul 2022 17:48:21 +0200 Subject: [PATCH 05/24] Fix shortcuts.vdf must be present before adding one to steam - Only create backup in case a file exists. - Also, only create backup if no backup exists. If glossi nukes the vdf file, more than 1 add operation would also nuke the last backup - Add log output to shortcut backup Fixes: #163 --- GlosSIConfig/Resource.rc | 24 ++++++++++++++++++++---- GlosSIConfig/VDFParser.h | 11 ++++++++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/GlosSIConfig/Resource.rc b/GlosSIConfig/Resource.rc index 9fd0612..a0f0331 100644 --- a/GlosSIConfig/Resource.rc +++ b/GlosSIConfig/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,7,1 - PRODUCTVERSION 0,0,7,1 + FILEVERSION 0,0,7,102000153200 + PRODUCTVERSION 0,0,7,102000153200 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "FileDescription", "GlosSI - Config" - VALUE "FileVersion", "0.0.7.1" + VALUE "FileVersion", "0.0.7.1-2-gd15320b" VALUE "InternalName", "GlosSIConfig" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSIConfig.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.7.1" + VALUE "ProductVersion", "0.0.7.1-2-gd15320b" END END BLOCK "VarFileInfo" @@ -108,3 +108,19 @@ IDI_ICON1 ICON "..\GloSC_Icon.ico" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED + + + + + + + + + + + + + + + + diff --git a/GlosSIConfig/VDFParser.h b/GlosSIConfig/VDFParser.h index dca5287..3234170 100644 --- a/GlosSIConfig/VDFParser.h +++ b/GlosSIConfig/VDFParser.h @@ -24,6 +24,8 @@ limitations under the License. #include #include +#include + namespace VDFParser { namespace crc { template @@ -489,7 +491,14 @@ class Parser { static inline bool writeShortcuts(std::filesystem::path path, const VDFFile& vdffile) { - const auto copied = std::filesystem::copy_file(path, path.wstring() + L".bak", std::filesystem::copy_options::update_existing); + const auto backupFileName = path.wstring() + L".bak"; + if (std::filesystem::exists(path) && !std::filesystem::exists(backupFileName)) { + qDebug() << "No shortcuts backup detected... Creating now..."; + const auto copied = std::filesystem::copy_file(path, backupFileName, std::filesystem::copy_options::update_existing); + if (!copied) { + qDebug() << "failed to copy shortcuts.vdf to backup!"; + } + } ofile.open(path.wstring(), std::ios::binary | std::ios::out); if (!ofile.is_open()) { From b2cf0b42577a14d374e02dbed7c6113782d8e9ad Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Wed, 27 Jul 2022 12:11:03 +0200 Subject: [PATCH 06/24] Update QT --- GlosSIConfig/GlosSIConfig.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GlosSIConfig/GlosSIConfig.vcxproj b/GlosSIConfig/GlosSIConfig.vcxproj index 9fa364f..344f827 100644 --- a/GlosSIConfig/GlosSIConfig.vcxproj +++ b/GlosSIConfig/GlosSIConfig.vcxproj @@ -34,12 +34,12 @@ quick qml debug true - 6.2.4_msvc2019_64 + 6.3.1_msvc2019_64 quick qml release - 6.2.4_msvc2019_64 + 6.3.1_msvc2019_64 From c9ec98e21b8d0f4f8854b8da55d6839c093c9e1c Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Tue, 2 Aug 2022 22:24:01 +0200 Subject: [PATCH 07/24] Add bundle Zip script --- bundle-zip.ps1 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 bundle-zip.ps1 diff --git a/bundle-zip.ps1 b/bundle-zip.ps1 new file mode 100644 index 0000000..37b494a --- /dev/null +++ b/bundle-zip.ps1 @@ -0,0 +1,22 @@ +powershell.exe .\download_release_deps.ps1 + +cd ./x64/Release/ + +Get-ChildItem -Rec | Where {$_.Extension -match "lib"} | Remove-Item +$env:Path = "$env:QTDIR\bin;$env:Path" + +windeployqt.exe --release --qmldir ../../GlosSIConfig/qml ./GlosSIConfig.exe + + +Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-graphics-2.dll" -Destination "." +Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-system-2.dll" -Destination "." +Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-window-2.dll" -Destination "." +Copy-Item "..\..\GlosSIConfig\GetAUMIDs.ps1" -Destination "." +Copy-Item "..\..\HidHideMSI.msi" -Destination "." +Copy-Item "..\..\ViGEmBusSetup_x64.msi" -Destination "." +Copy-Item "..\..\vc_redist.x64.exe" -Destination "." +Copy-Item "..\..\LICENSE" -Destination "./LICENSE" +Copy-Item "..\..\QT_License" -Destination "./QT_License" +Copy-Item "..\..\THIRD_PARTY_LICENSES.txt" -Destination "./THIRD_PARTY_LICENSES.txt" + +7z a GlosSI-snapshot.zip * \ No newline at end of file From 326f1f104231489eb7a385fcd7d1909008d1bdc9 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Tue, 2 Aug 2022 22:24:46 +0200 Subject: [PATCH 08/24] Pass /permissive- option Seems somehow required to build in appveyor? --- GlosSIConfig/GlosSIConfig.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GlosSIConfig/GlosSIConfig.vcxproj b/GlosSIConfig/GlosSIConfig.vcxproj index 344f827..f98cfdc 100644 --- a/GlosSIConfig/GlosSIConfig.vcxproj +++ b/GlosSIConfig/GlosSIConfig.vcxproj @@ -87,7 +87,7 @@ stdcpp17 %(AdditionalUsingDirectories) - /Zc:__cplusplus /Zc:zwoPhase- %(AdditionalOptions) + /Zc:__cplusplus /Zc:zwoPhase- /permissive- %(AdditionalOptions) false NOMINMAX;%(PreprocessorDefinitions) ..\deps\WinReg;%(AdditionalIncludeDirectories) From 4dc2479eaccdbda9f6a155dcefecd5675f21c07c Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 13:00:51 +0200 Subject: [PATCH 09/24] Update Release deps download links --- download_release_deps.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download_release_deps.ps1 b/download_release_deps.ps1 index 14e8cf7..c7dc44f 100644 --- a/download_release_deps.ps1 +++ b/download_release_deps.ps1 @@ -1,3 +1,3 @@ -Invoke-WebRequest -o ViGEmBusSetup_x64.msi https://github.com/ViGEm/ViGEmBus/releases/download/setup-v1.17.333/ViGEmBusSetup_x64.msi -Invoke-WebRequest -o HidHideMSI.msi https://github.com/ViGEm/HidHide/releases/download/v1.1.50.0/HidHideMSI.msi +Invoke-WebRequest -o ViGEmBusSetup_x64.msi https://github.com/ViGEm/ViGEmBus/releases/download/v1.18.367.0/ViGEmBus_1.18.367_x64_x86.exe +Invoke-WebRequest -o HidHideMSI.msi https://github.com/ViGEm/HidHide/releases/download/v1.2.98.0/HidHide_1.2.98_x64.exe Invoke-WebRequest -o vc_redist.x64.exe https://aka.ms/vs/16/release/vc_redist.x64.exe \ No newline at end of file From 8a40649d0f6267d53bb4fe2637e7b4e61e2f8c08 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 13:09:05 +0200 Subject: [PATCH 10/24] Update deps --- deps/ViGEmClient | 2 +- deps/WinReg | 2 +- deps/imgui | 2 +- deps/imgui-sfml | 2 +- deps/json | 2 +- deps/libsteam | 1 + deps/spdlog | 2 +- deps/subhook | 2 +- deps/traypp | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) create mode 160000 deps/libsteam diff --git a/deps/ViGEmClient b/deps/ViGEmClient index e99ba77..c8c312e 160000 --- a/deps/ViGEmClient +++ b/deps/ViGEmClient @@ -1 +1 @@ -Subproject commit e99ba7755ec0fbc054c6208cab482ba657ea5d38 +Subproject commit c8c312ef33d6112dbb8b86d5cd80d25716d32ff1 diff --git a/deps/WinReg b/deps/WinReg index 023ad61..a4907f3 160000 --- a/deps/WinReg +++ b/deps/WinReg @@ -1 +1 @@ -Subproject commit 023ad61dc77c83407e7ae061f177a3ba3d3941e6 +Subproject commit a4907f31deaca15ca27cc41e5506f54e9f05d3a4 diff --git a/deps/imgui b/deps/imgui index 55d35d8..9aae45e 160000 --- a/deps/imgui +++ b/deps/imgui @@ -1 +1 @@ -Subproject commit 55d35d8387c15bf0cfd71861df67af8cfbda7456 +Subproject commit 9aae45eb4a05a5a1f96be1ef37eb503a12ceb889 diff --git a/deps/imgui-sfml b/deps/imgui-sfml index 8bc196c..9cc8c57 160000 --- a/deps/imgui-sfml +++ b/deps/imgui-sfml @@ -1 +1 @@ -Subproject commit 8bc196c5eaadb342712407eb06fc2f53edfde227 +Subproject commit 9cc8c57a4565551087be0d9aeb3ae55490aa1207 diff --git a/deps/json b/deps/json index f5b3fb3..bc889af 160000 --- a/deps/json +++ b/deps/json @@ -1 +1 @@ -Subproject commit f5b3fb326c1a651cd3e62201b0e7074cf987f748 +Subproject commit bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d diff --git a/deps/libsteam b/deps/libsteam new file mode 160000 index 0000000..5f21758 --- /dev/null +++ b/deps/libsteam @@ -0,0 +1 @@ +Subproject commit 5f217584bbea24af3d8cd65ac109bd52ac0a65bd diff --git a/deps/spdlog b/deps/spdlog index 8826011..f44fa31 160000 --- a/deps/spdlog +++ b/deps/spdlog @@ -1 +1 @@ -Subproject commit 8826011c81b69e1f8427be520b357c19c74ea480 +Subproject commit f44fa31f5110331af196d0ed7f00ae1c7b8ef3cc diff --git a/deps/subhook b/deps/subhook index 284047b..83d4e1e 160000 --- a/deps/subhook +++ b/deps/subhook @@ -1 +1 @@ -Subproject commit 284047b761bd61e3c0518b0be235aa77172b1010 +Subproject commit 83d4e1ebef3588fae48b69a7352cc21801cb70bc diff --git a/deps/traypp b/deps/traypp index 8ea6862..698db7d 160000 --- a/deps/traypp +++ b/deps/traypp @@ -1 +1 @@ -Subproject commit 8ea68626a484de06d48ebcba8db99f8fd393ddd4 +Subproject commit 698db7d58dd450cc9e30dc12d3bd0c5ca4d6a5b1 From b522117169c4c6abac1f20ef8591b1cf6077f985 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 13:35:42 +0200 Subject: [PATCH 11/24] HidHide: Refactor unpatching Valve hooks --- GlosSITarget/HidHide.cpp | 117 +++++++-------------------------------- GlosSITarget/HidHide.h | 39 ++++++------- 2 files changed, 37 insertions(+), 119 deletions(-) diff --git a/GlosSITarget/HidHide.cpp b/GlosSITarget/HidHide.cpp index 3cef0be..3086d67 100644 --- a/GlosSITarget/HidHide.cpp +++ b/GlosSITarget/HidHide.cpp @@ -20,7 +20,6 @@ limitations under the License. #include "HidHide.h" -#include #include #include #include @@ -147,112 +146,38 @@ void HidHide::UnPatchValveHooks() { spdlog::debug("Unpatching Valve HID hooks..."); // need to load addresses that way.. Otherwise we land before some jumps... - auto setupapidll = GetModuleHandle(L"setupapi.dll"); - if (setupapidll) { - BYTE* addr = reinterpret_cast(GetProcAddress(setupapidll, "SetupDiEnumDeviceInfo")); - if (addr) { - UnPatchHook(addr, SETUP_DI_ENUM_DEV_INFO_ORIG_BYTES); - spdlog::trace("Unpatched SetupDiEnumDeviceInfo"); - } - else { - spdlog::error("failed to unpatch SetupDiEnumDeviceInfo"); - } - //addr = reinterpret_cast(GetProcAddress(setupapidll, "SetupDiGetClassDevsW")); - //if (addr) { - // UnPatchHook(addr, SETUP_DI_GETCLASSDEVSW_ORIG_BYTES); - // spdlog::trace("Unpatched SetupDiGetClassDevsW"); - //} - //else { - // spdlog::error("failed to unpatch SetupDiGetClassDevsW"); - //} - } - auto hiddll = GetModuleHandle(L"hid.dll"); - if (hiddll) { - BYTE* addr = reinterpret_cast(GetProcAddress(hiddll, "HidD_GetPreparsedData")); - if (addr) { - UnPatchHook(addr, HID_GETPREPARSED_ORIG_BYTES); - spdlog::trace("Unpatched HidD_GetPreparsedData"); - } - else { - spdlog::error("failed to unpatch HidD_GetPreparsedData"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidP_GetCaps")); - if (addr) { - UnPatchHook(addr, HID_GETCAPS_ORIG_BYTES); - spdlog::trace("Unpatched HidP_GetCaps"); - } - else { - spdlog::error("failed to unpatch HidP_GetCaps"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidD_GetAttributes")); - if (addr) { - UnPatchHook(addr, HID_GETATTRS_ORIG_BYTES); - spdlog::trace("Unpatched HidD_GetAttributes"); - } - else { - spdlog::error("failed to unpatch HidD_GetAttributes"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidD_GetProductString")); - if (addr) { - UnPatchHook(addr, HID_GETPRODSTR_ORIG_BYTES); - spdlog::trace("Unpatched HidD_GetProductString"); - } - else { - spdlog::error("failed to unpatch HidD_GetProductString"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidP_GetUsages")); - if (addr) { - UnPatchHook(addr, HID_GETUSAGE_ORIG_BYTES); - spdlog::trace("Unpatched HidP_GetUsages"); - } - else { - spdlog::error("failed to unpatch HidP_GetUsages"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidP_GetData")); - if (addr) { - UnPatchHook(addr, HID_GETDATA_ORIG_BYTES); - spdlog::trace("Unpatched HidP_GetData"); - } - else { - spdlog::error("failed to unpatch HidP_GetData"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidP_GetValueCaps")); - if (addr) { - UnPatchHook(addr, HID_GETVALUECAPS_ORIG_BYTES); - spdlog::trace("Unpatched HidP_GetValueCaps"); - } - else { - spdlog::error("failed to unpatch HidP_GetValueCaps"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidP_GetUsageValue")); - if (addr) { - UnPatchHook(addr, HID_GETUSAGE_VAL_ORIG_BYTES); - spdlog::trace("Unpatched HidP_GetUsageValue"); - } - else { - spdlog::error("failed to unpatch HidP_GetUsageValue"); - } - addr = reinterpret_cast(GetProcAddress(hiddll, "HidP_GetButtonCaps")); - if (addr) { - UnPatchHook(addr, HID_GETBTNCAPS_VAL_ORIG_BYTES); - spdlog::trace("Unpatched HidP_GetButtonCaps"); - } - else { - spdlog::error("failed to unpatch HidP_GetButtonCaps"); + if (const auto setupapidll = GetModuleHandle(L"setupapi.dll")) { + UnPatchHook("SetupDiEnumDeviceInfo", setupapidll); + //UnPatchHook("SetupDiGetClassDevsW", setupapidll); + } + if (const auto hiddll = GetModuleHandle(L"hid.dll")) { + for (const auto& name : ORIGINAL_BYTES | std::views::keys) { + if (name.starts_with("Hid")) { + UnPatchHook(name, hiddll); + } } } } -void HidHide::UnPatchHook(BYTE* address, const std::string& bytes) +void HidHide::UnPatchHook(const std::string& name, HMODULE module) { + spdlog::trace("Patching \"{}\"...", name); + + BYTE* address = reinterpret_cast(GetProcAddress(module, name.c_str())); + if (!address) { + spdlog::error("failed to unpatch \"{}\"", name); + } + + auto bytes = ORIGINAL_BYTES.at(name); DWORD dw_old_protect, dw_bkup; const auto len = bytes.size(); - VirtualProtect(address, len, PAGE_EXECUTE_READWRITE, &dw_old_protect); //Change permissions of memory.. + VirtualProtect(address, len, PAGE_EXECUTE_READWRITE, &dw_old_protect); // Change permissions of memory.. for (DWORD i = 0; i < len; i++) //unpatch Valve's hook { *(address + i) = bytes[i]; } - VirtualProtect(address, len, dw_old_protect, &dw_bkup); //Revert permission change... + VirtualProtect(address, len, dw_old_protect, &dw_bkup); // Revert permission change... + spdlog::trace("Unpatched \"{}\"", name); } void HidHide::enableOverlayElement() diff --git a/GlosSITarget/HidHide.h b/GlosSITarget/HidHide.h index 598e703..0f9c020 100644 --- a/GlosSITarget/HidHide.h +++ b/GlosSITarget/HidHide.h @@ -22,6 +22,7 @@ limitations under the License. #include #include #include +#include #include #include #include @@ -68,32 +69,24 @@ class HidHide { private: HANDLE hidhide_handle = nullptr; - // Valve Hooks `SetupDiEnumDeviceInfo` and hides Gaming devices like this. + // Valve Hooks various functions and hides Gaming devices like this. // To be able to query them, unpatch the hook with the original bytes... - static inline const std::string SETUP_DI_ENUM_DEV_INFO_ORIG_BYTES = "\x48\x89\x5C\x24\x08"; - // Valve also Hooks `SetupDiGetClassDevsW` ..unhook that as well... - static inline const std::string SETUP_DI_GETCLASSDEVSW_ORIG_BYTES = "\x48\x89\x5C\x24\x08"; - // Valve also Hooks `HidD_GetPreparsedData` ..unhook that as well... - static inline const std::string HID_GETPREPARSED_ORIG_BYTES = "\x48\x89\x5C\x24\x18"; - // ..aand `HidP_GetCaps` - static inline const std::string HID_GETCAPS_ORIG_BYTES = "\x4C\x8B\xD1\x48\x85\xC9"; - // ...aaand `HidD_GetAttributes` - static inline const std::string HID_GETATTRS_ORIG_BYTES = "\x40\x53\x48\x83\xEC"; - // ...aaaaand `HidD_GetProductString` - static inline const std::string HID_GETPRODSTR_ORIG_BYTES = "\x48\x83\xEC\x48\x48"; - // ...aaaaand `HidP_GetUsages` - static inline const std::string HID_GETUSAGE_ORIG_BYTES = "\x4C\x89\x4C\x24\x20"; - // ...aaaaand `HidP_GetData` - static inline const std::string HID_GETDATA_ORIG_BYTES = "\x4C\x89\x44\x24\x18"; - // ...aaaaand `HidP_GetValueCaps` - static inline const std::string HID_GETVALUECAPS_ORIG_BYTES = "\x48\x83\xEC\x48\x49"; - // ...aaaaand `HidP_GetUsageValue` - static inline const std::string HID_GETUSAGE_VAL_ORIG_BYTES = "\x40\x53\x55\x56\x48"; - // ...aaaaand `HidP_GetButtonCaps` - static inline const std::string HID_GETBTNCAPS_VAL_ORIG_BYTES = "\x48\x83\xEC\x48\x49"; + static inline const std::map ORIGINAL_BYTES = { + {"SetupDiEnumDeviceInfo", "\x48\x89\x5C\x24\x08"}, + {"SetupDiGetClassDevsW", "\x48\x89\x5C\x24\x08"}, + {"HidD_GetPreparsedData", "\x48\x89\x5C\x24\x18"}, + {"HidP_GetCaps", "\x4C\x8B\xD1\x48\x85\xC9"}, + {"HidD_GetAttributes", "\x40\x53\x48\x83\xEC"}, + {"HidD_GetProductString", "\x48\x83\xEC\x48\x48"}, + {"HidP_GetUsages", "\x4C\x89\x4C\x24\x20"}, + {"HidP_GetData", "\x4C\x89\x44\x24\x18"}, + {"HidP_GetValueCaps", "\x48\x83\xEC\x48\x49"}, + {"HidP_GetUsageValue", "\x40\x53\x55\x56\x48"}, + {"HidP_GetButtonCaps", "\x48\x83\xEC\x48\x49"}, + }; static void UnPatchValveHooks(); - static void UnPatchHook(BYTE* address, const std::string& bytes); + static void UnPatchHook(const std::string& name, HMODULE module); void enableOverlayElement(); sf::Clock overlay_elem_clock_; From 26da01022c1f6453f333c9f5301d0d6f061953ec Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 14:12:18 +0200 Subject: [PATCH 12/24] Fix build --- GlosSITarget/HidHide.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GlosSITarget/HidHide.cpp b/GlosSITarget/HidHide.cpp index 3086d67..52bf1bf 100644 --- a/GlosSITarget/HidHide.cpp +++ b/GlosSITarget/HidHide.cpp @@ -322,7 +322,7 @@ DWORD HidHide::getRequiredOutputBufferSize(IOCTL_TYPE type) const { DWORD bytes_needed; if (!DeviceIoControl(hidhide_handle, static_cast(type), nullptr, 0, nullptr, 0, &bytes_needed, nullptr)) { - spdlog::error("Couldn't determine required HidHide output buffer size; type: {}", type); + spdlog::error("Couldn't determine required HidHide output buffer size; type: {}", static_cast(type)); return 0; } return bytes_needed; From 661d8ddc6a0bd13cf4123be562eb435c475c34f4 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 14:30:14 +0200 Subject: [PATCH 13/24] Update prebuild script --- GlosSIConfig/Resource.rc | 16 ++++++++++++---- GlosSITarget/Resource.rc | 20 ++++++++++++++++---- prebuild.ps1 | 2 +- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/GlosSIConfig/Resource.rc b/GlosSIConfig/Resource.rc index a0f0331..fe1d9d3 100644 --- a/GlosSIConfig/Resource.rc +++ b/GlosSIConfig/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,7,102000153200 - PRODUCTVERSION 0,0,7,102000153200 + FILEVERSION 0,0,7,1013000522117 + PRODUCTVERSION 0,0,7,1013000522117 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "FileDescription", "GlosSI - Config" - VALUE "FileVersion", "0.0.7.1-2-gd15320b" + VALUE "FileVersion", "0.0.7.1-13-gb522117" VALUE "InternalName", "GlosSIConfig" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSIConfig.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.7.1-2-gd15320b" + VALUE "ProductVersion", "0.0.7.1-13-gb522117" END END BLOCK "VarFileInfo" @@ -119,6 +119,14 @@ IDI_ICON1 ICON "..\GloSC_Icon.ico" + + + + + + + + diff --git a/GlosSITarget/Resource.rc b/GlosSITarget/Resource.rc index 263c9f9..b88f622 100644 --- a/GlosSITarget/Resource.rc +++ b/GlosSITarget/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,5,003000770004 - PRODUCTVERSION 0,0,5,003000770004 + FILEVERSION 0,0,7,1014002600010 + PRODUCTVERSION 0,0,7,1014002600010 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.5.0-3-gf77e0c4" + VALUE "FileVersion", "0.0.7.1-14-g26da010" VALUE "InternalName", "GlosSITarget" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSITarget.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.5.0-3-gf77e0c4" + VALUE "ProductVersion", "0.0.7.1-14-g26da010" END END BLOCK "VarFileInfo" @@ -124,6 +124,18 @@ IDI_ICON1 ICON "GloSC_Icon.ico" + + + + + + + + + + + + diff --git a/prebuild.ps1 b/prebuild.ps1 index 1472704..ab378b5 100644 --- a/prebuild.ps1 +++ b/prebuild.ps1 @@ -1,5 +1,5 @@ git submodule init -git submodule update --recursive +git submodule update --recursive --force .\buildSFML.ps1 .\buildViGEmClient.ps1 From 5ba0a5233d40a18711fae96a63d84ac88c312c4a Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 14:37:34 +0200 Subject: [PATCH 14/24] Remove libsteam --- deps/libsteam | 1 - 1 file changed, 1 deletion(-) delete mode 160000 deps/libsteam diff --git a/deps/libsteam b/deps/libsteam deleted file mode 160000 index 5f21758..0000000 --- a/deps/libsteam +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5f217584bbea24af3d8cd65ac109bd52ac0a65bd From 8077630ea82be0e1d3627684928a96a85045d6da Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 14:55:30 +0200 Subject: [PATCH 15/24] Update VigemCLient build patch --- ViGEm_BuildConfig.patch | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/ViGEm_BuildConfig.patch b/ViGEm_BuildConfig.patch index 1767d0f..eba667b 100644 --- a/ViGEm_BuildConfig.patch +++ b/ViGEm_BuildConfig.patch @@ -1,38 +1,8 @@ diff --git a/src/ViGEmClient.vcxproj b/src/ViGEmClient.vcxproj -index 7c186414e62a6334fbcd518d506f55db57491dfe..2955df4d391b37bf0b71e17df8bd161c1014a0c4 100644 +index 7c186414e62a6334fbcd518d506f55db57491dfe..6b71920a9b848e4a5a3ffb314a2e009a7a22502f 100644 --- a/src/ViGEmClient.vcxproj +++ b/src/ViGEmClient.vcxproj -@@ -49,52 +49,52 @@ - - StaticLibrary - true -- v142 -+ v143 - Unicode - - - DynamicLibrary - true -- v142 -+ v143 - Unicode - - - StaticLibrary - false -- v142 -+ v143 - true - Unicode - - - DynamicLibrary - false -- v142 -+ v143 - true - Unicode - +@@ -75,26 +75,26 @@ StaticLibrary true From 0f2bac6fbb00e43dafb238dcb9e014b2db2f4d8f Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 14:56:08 +0200 Subject: [PATCH 16/24] GloSSITarget: Link against XINPUT1_4 Only supported in Win10/11 --- GlosSITarget/GlosSITarget.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GlosSITarget/GlosSITarget.vcxproj b/GlosSITarget/GlosSITarget.vcxproj index 0343586..ee7852d 100644 --- a/GlosSITarget/GlosSITarget.vcxproj +++ b/GlosSITarget/GlosSITarget.vcxproj @@ -132,7 +132,7 @@ Windows true - hid.lib;Cfgmgr32.lib;opengl32.lib;sfml-window-d.lib;sfml-system-d.lib;sfml-graphics-d.lib;dwmapi.lib;xinput9_1_0.lib;setupapi.lib;ViGEmClient.lib;Dbghelp.lib;%(AdditionalDependencies) + hid.lib;Cfgmgr32.lib;opengl32.lib;sfml-window-d.lib;sfml-system-d.lib;sfml-graphics-d.lib;dwmapi.lib;xinput.lib;setupapi.lib;ViGEmClient.lib;Dbghelp.lib;%(AdditionalDependencies) PerMonitorHighDPIAware @@ -157,7 +157,7 @@ true true true - hid.lib;Cfgmgr32.lib;opengl32.lib;sfml-window.lib;sfml-system.lib;sfml-graphics.lib;dwmapi.lib;xinput9_1_0.lib;setupapi.lib;ViGEmClient.lib;Dbghelp.lib;%(AdditionalDependencies) + hid.lib;Cfgmgr32.lib;opengl32.lib;sfml-window.lib;sfml-system.lib;sfml-graphics.lib;dwmapi.lib;XINPUT.lib;setupapi.lib;ViGEmClient.lib;Dbghelp.lib;%(AdditionalDependencies) PerMonitorHighDPIAware From 5ffc40347a006b5a63306eeba06e4b3389f13d88 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 14:59:59 +0200 Subject: [PATCH 17/24] GetAUMIDs: Keep "Microsoft.*" Entires to display more games --- GlosSIConfig/GetAUMIDs.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GlosSIConfig/GetAUMIDs.ps1 b/GlosSIConfig/GetAUMIDs.ps1 index 4c516c4..42c3844 100644 --- a/GlosSIConfig/GetAUMIDs.ps1 +++ b/GlosSIConfig/GetAUMIDs.ps1 @@ -21,7 +21,7 @@ foreach ($app in $installedapps) { } #filter more apps with improper naming patterns; games generally have the appropriate field in their manifests filled out. - if ($name -like "MicrosoftWindows.*" -or $name -like "Microsoft.*" -or $name -like "Windows.*" -or $name -like "Windows Web*") { break; } + if ($name -like "MicrosoftWindows.*" -or $name -like "Windows.*" -or $name -like "Windows Web*") { break; } $installDir = $app.InstallLocation; #filter out system apps and apps installed by Microsoft as part of Windows From c7e5cbd30cb9a7f57ee0b3ceb6360bc7bf71a2b8 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 15:49:19 +0200 Subject: [PATCH 18/24] =?UTF-8?q?Fix=20ShittyShortcutsVdf-Parser=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GlosSIConfig/VDFParser.h | 86 +++++++++++----------------------------- 1 file changed, 24 insertions(+), 62 deletions(-) diff --git a/GlosSIConfig/VDFParser.h b/GlosSIConfig/VDFParser.h index 3234170..f2fd4b9 100644 --- a/GlosSIConfig/VDFParser.h +++ b/GlosSIConfig/VDFParser.h @@ -106,58 +106,37 @@ struct VDFKeyPair { } }; -template struct VDFIdx { VDFIdx(){}; VDFIdx(const VDFIdx& other) { - data[0] = other.data[0]; - data[1] = other.data[1]; + data = other.data; }; VDFIdx(VDFIdx&& other) { - data[0] = std::move(other.data[0]); - data[1] = std::move(other.data[1]); + data = std::move(other.data); }; VDFIdx(int idx) { - if (idx > 99) { - data[0] = initialByte; - data[1] = 0; - } - else if (idx < 10) { - data[1] = std::to_string(idx).c_str()[0]; - } - else { - auto meh = std::to_string(idx).c_str(); - data[0] = meh[0] + initialByte; - data[1] = meh[1]; - } + data = std::to_string(idx); } - char data[2] = {initialByte, 0x0}; + std::string data; operator int() const { - if (data[0] == initialByte) { - int res = 0; - std::from_chars(&data[1], &data[1], res); - return res; - } int res = 0; - char copy[2] = {data[0] - initialByte, data[1]}; - std::from_chars(©[0], ©[1], res); + std::from_chars(data.data(), data.data() + data.size(), res); return res; } VDFIdx& operator=(const VDFIdx& other) { - data[0] = other.data[0]; - data[1] = other.data[1]; + data = other.data; + return *this; } VDFIdx& operator=(VDFIdx&& other) { - data[0] = std::move(other.data[0]); - data[1] = std::move(other.data[1]); + data = std::move(other.data); return *this; } }; @@ -172,7 +151,7 @@ struct ShortcutTag { { value = std::move(other.value); }; - VDFIdx<0x01> idx; // I Hope this is how it works... See VDFIdx + VDFIdx idx; std::string value; const uint16_t end_marker = 0x0808; @@ -189,7 +168,7 @@ struct ShortcutTag { }; struct Shortcut { - VDFIdx<0x00> idx; + VDFIdx idx; VDFKeyPair appId{0x000000}; VDFKeyPair appName{""}; VDFKeyPair exe{"\"\""}; // Qouted @@ -354,34 +333,17 @@ class Parser { } char b = '\x0'; readVDFBuffer(&b, 1); // skip 0 byte - if (b != '\x0') - buff.push_back(b); - do { - if (ifile.eof()) { - break; - } - readVDFBuffer(&b, 1); // 1-2 bytes idx, 0x00 delmiter - if (b != '\x0') - buff.push_back(b); - } while (b != '\x0'); - if (buff[0] == 0x08 && buff[1] == 0x08) { - break; - } Shortcut shortcut; - if (buff.size() == 2) { - shortcut.idx.data[0] = buff[0]; - shortcut.idx.data[1] = buff[1]; - } - else { - shortcut.idx.data[0] = '\x0'; - shortcut.idx.data[1] = buff[0]; + shortcut.idx.data = readVDFString(); + if (shortcut.idx.data == "\x08\x08") { + break; } while (true) // TODO; { if (ifile.eof()) { break; } - VDFTypeId tid = static_cast(readVDFValue()); + auto tid = static_cast(readVDFValue()); if (tid == 0x08) { auto nextbyte = readVDFValue(); if (nextbyte == 0x08) { @@ -458,20 +420,22 @@ class Parser { continue; } if (key == shortcut.tags.key) { - // TODO: read tags ShortcutTag tag; while (true) { if (ifile.eof()) { break; } char tbuff[2]; - readVDFBuffer(tbuff, 2); // 2 bytes idx + readVDFBuffer(tbuff, 2); // 2 bytes POSSIBLE end marker + ifile.seekg(-2, std::ios_base::cur); if (tbuff[0] == 0x08 && tbuff[1] == 0x08) { + break; + } + tag.idx.data = readVDFString(); + if (tag.idx.data == "\x08\x08") { ifile.seekg(-2, std::ios_base::cur); break; } - tag.idx.data[0] = tbuff[0]; - tag.idx.data[1] = tbuff[1]; ifile.seekg(1, std::ios_base::cur); tag.value = readVDFString(); shortcut.tags.value.push_back(tag); @@ -479,7 +443,7 @@ class Parser { continue; } } - if (!(shortcut.idx.data[0] == 0x0 && shortcut.idx.data[1] == 0x0)) { + if (!(shortcut.idx.data == "\x00\x00")) { vdffile.shortcuts.push_back(shortcut); } } @@ -508,10 +472,8 @@ class Parser { ofile.write(vdffile.identifier.data(), vdffile.identifier.length()); ofile.write("\x00", 1); for (auto& shortcut : vdffile.shortcuts) { - if (shortcut.idx.data[0] != '\x0') { - ofile.write("\x00", 1); - } - ofile.write(shortcut.idx.data, 2); + ofile.write("\x00", 1); + ofile.write(shortcut.idx.data.data(), shortcut.idx.data.length()); ofile.write("\x00", 1); // ofile.write((char*)&shortcut.appId.type_id, 1); @@ -599,7 +561,7 @@ class Parser { ofile.write((char*)&shortcut.tags.type_id, 1); ofile.write(shortcut.tags.key, 5); for (auto& tag : shortcut.tags.value) { - ofile.write(tag.idx.data, 2); + ofile.write(tag.idx.data.data(), tag.idx.data.length()); ofile.write("\x00", 1); ofile.write(tag.value.data(), tag.value.length()); ofile.write("\x00", 1); From 31ee8768b990e1a9d34d3a068440d1246a8e3c00 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 15:54:59 +0200 Subject: [PATCH 19/24] Config: UIModel: Fix max controller setting --- GlosSIConfig/UIModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GlosSIConfig/UIModel.cpp b/GlosSIConfig/UIModel.cpp index f96bfd9..a79162b 100644 --- a/GlosSIConfig/UIModel.cpp +++ b/GlosSIConfig/UIModel.cpp @@ -84,7 +84,7 @@ void UIModel::readConfigs() json["maxFps"] = filejson["window"]["maxFps"]; json["scale"] = filejson["window"]["scale"]; json["disableOverlay"] = filejson["window"]["disableOverlay"]; - json["maxControllers"] = filejson["controller"]["allowDesktopConfig"]; + json["maxControllers"] = filejson["controller"]["maxControllers"]; json["allowDesktopConfig"] = filejson["controller"]["allowDesktopConfig"]; json["emulateDS4"] = filejson["controller"]["emulateDS4"]; From bb5c2de5284cc3df9750678ede0865d48ca1be23 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 4 Sep 2022 16:18:02 +0200 Subject: [PATCH 20/24] GloSSIConfig: Attempt to declutter UI a bit --- GlosSIConfig/Resource.rc | 204 ++++++++++++++++++- GlosSIConfig/qml.qrc | 1 + GlosSIConfig/qml/InfoDialog.qml | 4 +- GlosSIConfig/qml/ShortcutProps.qml | 147 ++++++++----- GlosSIConfig/svg/help_outline_white_24dp.svg | 1 + GlosSITarget/Resource.rc | 52 ++++- 6 files changed, 349 insertions(+), 60 deletions(-) create mode 100644 GlosSIConfig/svg/help_outline_white_24dp.svg diff --git a/GlosSIConfig/Resource.rc b/GlosSIConfig/Resource.rc index fe1d9d3..3049894 100644 --- a/GlosSIConfig/Resource.rc +++ b/GlosSIConfig/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,7,1013000522117 - PRODUCTVERSION 0,0,7,1013000522117 + FILEVERSION 0,0,7,1021003100876 + PRODUCTVERSION 0,0,7,1021003100876 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "FileDescription", "GlosSI - Config" - VALUE "FileVersion", "0.0.7.1-13-gb522117" + VALUE "FileVersion", "0.0.7.1-21-g31ee876" VALUE "InternalName", "GlosSIConfig" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSIConfig.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.7.1-13-gb522117" + VALUE "ProductVersion", "0.0.7.1-21-g31ee876" END END BLOCK "VarFileInfo" @@ -127,6 +127,202 @@ IDI_ICON1 ICON "..\GloSC_Icon.ico" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GlosSIConfig/qml.qrc b/GlosSIConfig/qml.qrc index 523435f..80ff2b9 100644 --- a/GlosSIConfig/qml.qrc +++ b/GlosSIConfig/qml.qrc @@ -14,5 +14,6 @@ steamscreener.png noise.png GloSC_Icon_small.png + svg/help_outline_white_24dp.svg diff --git a/GlosSIConfig/qml/InfoDialog.qml b/GlosSIConfig/qml/InfoDialog.qml index b3b72c7..96066aa 100644 --- a/GlosSIConfig/qml/InfoDialog.qml +++ b/GlosSIConfig/qml/InfoDialog.qml @@ -80,6 +80,7 @@ Dialog { anchors.top: title.bottom anchors.topMargin: parent.spacing spacing: 16 + height: text.height + spacing Label { id: text } @@ -89,7 +90,7 @@ Dialog { anchors.top: col.bottom anchors.topMargin: parent.spacing spacing: 16 - + height: okbutton.height + spacing + parent.spacing Button { id: extrabutton visible: extraButton @@ -100,6 +101,7 @@ Dialog { } Button { + id: okbutton text: qsTr("OK") onClicked: function(){ close() diff --git a/GlosSIConfig/qml/ShortcutProps.qml b/GlosSIConfig/qml/ShortcutProps.qml index 075ec39..14ba84c 100644 --- a/GlosSIConfig/qml/ShortcutProps.qml +++ b/GlosSIConfig/qml/ShortcutProps.qml @@ -77,7 +77,7 @@ Item { pathInput.text = shortcutInfo.launchPath || "" argsInput.text = shortcutInfo.launchAppArgs || "" closeOnExit.checked = shortcutInfo.closeOnExit || false - waitForChildren.checked = shortcutInfo.waitForChildProcs || true + waitForChildren.checked = shortcutInfo.waitForChildProcs hideDevices.checked = shortcutInfo.hideDevices || false windowMode.checked = shortcutInfo.windowMode || false maxControllersSpinBox.value = shortcutInfo.maxControllers @@ -321,7 +321,7 @@ Item { RPane { width: parent.width / 2 - 8 - height: 394 + height: 264 radius: 4 Material.elevation: 32 bgOpacity: 0.97 @@ -329,64 +329,99 @@ Item { Column { spacing: 2 width: parent.width - CheckBox { - id: hideDevices - text: qsTr("Hide (Real) Controllers") - checked: shortcutInfo.hideDevices - onCheckedChanged: shortcutInfo.hideDevices = checked - } - Label { - text: qsTr("Hides real game controllers from the system\nThis may prevent doubled inputs") - wrapMode: Text.WordWrap - width: parent.width - leftPadding: 32 - topPadding: -8 - } - Label { - text: qsTr("You can change this setting and which devices are hidden in the GlosSI overlay") - wrapMode: Text.WordWrap - width: parent.width - leftPadding: 32 + Row { + CheckBox { + id: hideDevices + text: qsTr("Hide (Real) Controllers") + checked: shortcutInfo.hideDevices + onCheckedChanged: shortcutInfo.hideDevices = checked + } + RoundButton { + onClicked: () => { + helpInfoDialog.titleText = qsTr("Hide (Real) Controllers") + helpInfoDialog.text = + qsTr("Hides real game controllers from the system\nThis may prevent doubled inputs") + + "\n" + + qsTr("You can change this setting and which devices are hidden in the GlosSI overlay") + + helpInfoDialog.open() + } + width: 48 + height: 48 + Material.elevation: 0 + anchors.topMargin: 16 + Image { + anchors.centerIn: parent + source: "qrc:/svg/help_outline_white_24dp.svg" + width: 24 + height: 24 + } + } } Item { width: 1 height: 4 } - CheckBox { - 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 + Row { + CheckBox { + id: realDeviceIds + text: qsTr("Use real device (USB)-IDs") + checked: shortcutInfo.realDeviceIds + onCheckedChanged: shortcutInfo.realDeviceIds = checked + } + RoundButton { + onClicked: () => { + helpInfoDialog.titleText = qsTr("Use real device (USB)-IDs") + helpInfoDialog.text = + qsTr("Only enable if input's are not recognized by the game") + + "\n" + + qsTr("If enabled, device-hiding won't work.\nUse the \"Max. Controller count\" setting!") + + helpInfoDialog.open() + } + width: 48 + height: 48 + Material.elevation: 0 + anchors.topMargin: 16 + Image { + anchors.centerIn: parent + source: "qrc:/svg/help_outline_white_24dp.svg" + width: 24 + height: 24 + } + } } 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 + Row { + CheckBox { + id: emulateDS4 + text: qsTr("Emulate DS4") + checked: shortcutInfo.emulateDS4 + onCheckedChanged: shortcutInfo.emulateDS4 = checked + } + RoundButton { + onClicked: () => { + helpInfoDialog.titleText = qsTr("Emulate DS4") + helpInfoDialog.text = + qsTr("Instead of X360 Pad") + + "\n" + + qsTr("Disable \"Playstation Configuration support\" in Steam") + helpInfoDialog.open() + } + width: 48 + height: 48 + Material.elevation: 0 + anchors.topMargin: 16 + Image { + anchors.centerIn: parent + source: "qrc:/svg/help_outline_white_24dp.svg" + width: 24 + height: 24 + } + } } Item { width: 1 @@ -411,7 +446,7 @@ Item { } RPane { width: parent.width / 2 - 8 - height: 294 + height: 264 radius: 4 Material.elevation: 32 bgOpacity: 0.97 @@ -520,4 +555,14 @@ Item { } } + InfoDialog { + id: helpInfoDialog + titleText: qsTr("") + text: qsTr("") + extraButton: false + extraButtonText: qsTr("") + onConfirmedExtra: function(data) { + } + } + } diff --git a/GlosSIConfig/svg/help_outline_white_24dp.svg b/GlosSIConfig/svg/help_outline_white_24dp.svg new file mode 100644 index 0000000..439616e --- /dev/null +++ b/GlosSIConfig/svg/help_outline_white_24dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/GlosSITarget/Resource.rc b/GlosSITarget/Resource.rc index b88f622..e37e0b4 100644 --- a/GlosSITarget/Resource.rc +++ b/GlosSITarget/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,7,1014002600010 - PRODUCTVERSION 0,0,7,1014002600010 + FILEVERSION 0,0,7,1018000020006 + PRODUCTVERSION 0,0,7,1018000020006 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.7.1-14-g26da010" + VALUE "FileVersion", "0.0.7.1-18-g0f2bac6" VALUE "InternalName", "GlosSITarget" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSITarget.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.7.1-14-g26da010" + VALUE "ProductVersion", "0.0.7.1-18-g0f2bac6" END END BLOCK "VarFileInfo" @@ -127,6 +127,50 @@ IDI_ICON1 ICON "GloSC_Icon.ico" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e960ec33ddb388f223c8f4ddde852d9407eace0f Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 5 Sep 2022 09:43:26 +0200 Subject: [PATCH 21/24] FIx crash when localconfig.vdf not parseable --- GlosSITarget/SteamTarget.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GlosSITarget/SteamTarget.cpp b/GlosSITarget/SteamTarget.cpp index 841ce39..b11a51a 100644 --- a/GlosSITarget/SteamTarget.cpp +++ b/GlosSITarget/SteamTarget.cpp @@ -270,8 +270,8 @@ std::vector SteamTarget::getOverlayHotkey() std::ifstream config_file(config_path); auto root = tyti::vdf::read(config_file); - auto children = root.childs["system"]; - if (children->attribs.find("InGameOverlayShortcutKey") == children->attribs.end()) { + std::shared_ptr> children = root.childs["system"]; + if (!children || children->attribs.empty() || !children->attribs.contains("InGameOverlayShortcutKey")) { spdlog::warn("Couldn't detect overlay hotkey, using default: Shift+Tab"); return {"Shift", "KEY_TAB"}; // default } @@ -311,8 +311,8 @@ std::vector SteamTarget::getScreenshotHotkey() std::ifstream config_file(config_path); auto root = tyti::vdf::read(config_file); - auto children = root.childs["system"]; - if (children->attribs.find("InGameOverlayScreenshotHotKey") == children->attribs.end()) { + std::shared_ptr> children = root.childs["system"]; + if (!children || children->attribs.empty() || !children->attribs.contains("InGameOverlayScreenshotHotKey")) { spdlog::warn("Couldn't detect overlay hotkey, using default: F12"); return {"KEY_F12"}; //default } @@ -352,7 +352,7 @@ bool SteamTarget::getXBCRebindingEnabled() std::ifstream config_file(config_path); auto root = tyti::vdf::read(config_file); - if (root.attribs.find("SteamController_XBoxSupport") == root.attribs.end()) { + if (root.attribs.empty() || !root.attribs.contains("SteamController_XBoxSupport")) { spdlog::warn("\"Xbox Configuration Support\" is disabled in Steam. This may cause doubled Inputs!"); return false; } From f3a2ffc751c524d69fc194e147f7de06896958df Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 5 Sep 2022 11:12:47 +0200 Subject: [PATCH 22/24] Fix driver installer bundling --- build.ps1 | 3 ++- bundle-zip.ps1 | 4 ++-- download_release_deps.ps1 | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.ps1 b/build.ps1 index 8d36151..94ec4fa 100644 --- a/build.ps1 +++ b/build.ps1 @@ -8,7 +8,8 @@ msbuild.exe GlosSI.sln /t:Build /p:Configuration=Release /p:Platform=x64 cd ./x64/Release/ -$env:Path += ';C:\Qt\6.2.4\msvc2019_64\bin' +$env:Path += ';C:\Qt\6.3.1\msvc2019_64\bin' +$env:Path += ';C:\Program Files\7-Zip' Get-ChildItem -Rec | Where {$_.Extension -match "lib"} | Remove-Item $env:Path = "$env:QTDIR\bin;$env:Path" diff --git a/bundle-zip.ps1 b/bundle-zip.ps1 index 37b494a..e33b25e 100644 --- a/bundle-zip.ps1 +++ b/bundle-zip.ps1 @@ -12,8 +12,8 @@ Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-graphics-2.dll" - Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-system-2.dll" -Destination "." Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-window-2.dll" -Destination "." Copy-Item "..\..\GlosSIConfig\GetAUMIDs.ps1" -Destination "." -Copy-Item "..\..\HidHideMSI.msi" -Destination "." -Copy-Item "..\..\ViGEmBusSetup_x64.msi" -Destination "." +Copy-Item "..\..\HidHideSetup.exe" -Destination "." +Copy-Item "..\..\ViGEmBusSetup_x64.exe" -Destination "." Copy-Item "..\..\vc_redist.x64.exe" -Destination "." Copy-Item "..\..\LICENSE" -Destination "./LICENSE" Copy-Item "..\..\QT_License" -Destination "./QT_License" diff --git a/download_release_deps.ps1 b/download_release_deps.ps1 index c7dc44f..9afd46b 100644 --- a/download_release_deps.ps1 +++ b/download_release_deps.ps1 @@ -1,3 +1,3 @@ -Invoke-WebRequest -o ViGEmBusSetup_x64.msi https://github.com/ViGEm/ViGEmBus/releases/download/v1.18.367.0/ViGEmBus_1.18.367_x64_x86.exe -Invoke-WebRequest -o HidHideMSI.msi https://github.com/ViGEm/HidHide/releases/download/v1.2.98.0/HidHide_1.2.98_x64.exe +Invoke-WebRequest -o ViGEmBusSetup_x64.exe https://github.com/ViGEm/ViGEmBus/releases/download/v1.18.367.0/ViGEmBus_1.18.367_x64_x86.exe +Invoke-WebRequest -o HidHideSetup.exe https://github.com/ViGEm/HidHide/releases/download/v1.2.98.0/HidHide_1.2.98_x64.exe Invoke-WebRequest -o vc_redist.x64.exe https://aka.ms/vs/16/release/vc_redist.x64.exe \ No newline at end of file From f532fb74e043498b5ab45399c404cfb467c14604 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 5 Sep 2022 13:02:53 +0200 Subject: [PATCH 23/24] ChildProcess Log: Change to trace --- GlosSITarget/AppLauncher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GlosSITarget/AppLauncher.cpp b/GlosSITarget/AppLauncher.cpp index 64e5ac7..7bc3f25 100644 --- a/GlosSITarget/AppLauncher.cpp +++ b/GlosSITarget/AppLauncher.cpp @@ -79,7 +79,7 @@ void AppLauncher::update() std::erase_if(pids_, [](auto pid) { const auto running = IsProcessRunning(pid); if (!running) - spdlog::info("Child process with PID \"{}\" died", pid); + spdlog::trace("Child process with PID \"{}\" died", pid); return !running; }); if (Settings::launch.closeOnExit && pids_.empty() && Settings::launch.launch) { From f631321a8410bb6b76667256c41d2b8241b1f3b3 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 5 Sep 2022 15:32:39 +0200 Subject: [PATCH 24/24] Fix Shitty shortcuts.vdf parser tag writing --- GlosSIConfig/VDFParser.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/GlosSIConfig/VDFParser.h b/GlosSIConfig/VDFParser.h index f2fd4b9..b4c4a93 100644 --- a/GlosSIConfig/VDFParser.h +++ b/GlosSIConfig/VDFParser.h @@ -69,6 +69,7 @@ static constexpr const char k_Devkit[] = {"Devkit"}; static constexpr const char k_DevkitGameID[] = {"DevkitGameID"}; static constexpr const char k_DevkitOverrideAppID[] = {"DevkitOverrideAppID"}; static constexpr const char k_LastPlayTime[] = {"LastPlayTime"}; +static constexpr const char k_FlatpakAppID[] = {"FlatpakAppID"}; static constexpr const char k_tags[] = {"tags"}; enum VDFTypeId { @@ -77,7 +78,7 @@ enum VDFTypeId { Number, }; -template +template struct VDFKeyPair { VDFKeyPair() {} explicit VDFKeyPair(type _value) : value(_value) {} @@ -145,10 +146,12 @@ struct ShortcutTag { ShortcutTag(){}; ShortcutTag(const ShortcutTag& other) { + idx = other.idx; value = other.value; }; ShortcutTag(ShortcutTag&& other) { + idx = std::move(other.idx); value = std::move(other.value); }; VDFIdx idx; @@ -157,11 +160,13 @@ struct ShortcutTag { ShortcutTag& operator=(const ShortcutTag& other) { + idx = other.idx; value = other.value; return *this; } ShortcutTag& operator=(ShortcutTag&& other) { + idx = std::move(other.idx); value = std::move(other.value); return *this; } @@ -184,6 +189,7 @@ struct Shortcut { VDFKeyPair DevkitGameID{""}; VDFKeyPair DevkitOverrideAppID{0}; // VDFKeyPair LastPlayTime{0}; // + VDFKeyPair FlatpakAppID{""}; // VDFKeyPair, VDFTypeId::StringList> tags{}; Shortcut& operator=(const Shortcut& other) { @@ -204,6 +210,7 @@ struct Shortcut { DevkitGameID = other.DevkitGameID; DevkitOverrideAppID = other.DevkitOverrideAppID; LastPlayTime = other.LastPlayTime; + FlatpakAppID = other.FlatpakAppID; tags = other.tags; return *this; } @@ -343,7 +350,7 @@ class Parser { if (ifile.eof()) { break; } - auto tid = static_cast(readVDFValue()); + const auto tid = static_cast(readVDFValue()); if (tid == 0x08) { auto nextbyte = readVDFValue(); if (nextbyte == 0x08) { @@ -419,6 +426,10 @@ class Parser { shortcut.LastPlayTime.value = readVDFValue(); continue; } + if (key == shortcut.FlatpakAppID.key) { + shortcut.FlatpakAppID.value = readVDFString(); + continue; + } if (key == shortcut.tags.key) { ShortcutTag tag; while (true) { @@ -427,8 +438,9 @@ class Parser { } char tbuff[2]; readVDFBuffer(tbuff, 2); // 2 bytes POSSIBLE end marker - ifile.seekg(-2, std::ios_base::cur); + ifile.seekg(-1, std::ios_base::cur); // go one back, skip typeId if (tbuff[0] == 0x08 && tbuff[1] == 0x08) { + ifile.seekg(-1, std::ios_base::cur); // another back break; } tag.idx.data = readVDFString(); @@ -436,7 +448,6 @@ class Parser { ifile.seekg(-2, std::ios_base::cur); break; } - ifile.seekg(1, std::ios_base::cur); tag.value = readVDFString(); shortcut.tags.value.push_back(tag); } @@ -557,6 +568,12 @@ class Parser { ofile.write(shortcut.LastPlayTime.key, 13); ofile.write((char*)&shortcut.LastPlayTime.value, 4); + // + ofile.write((char*)&shortcut.FlatpakAppID.type_id, 1); + ofile.write(shortcut.FlatpakAppID.key, 13); + ofile.write(shortcut.FlatpakAppID.value.data(), shortcut.FlatpakAppID.value.length()); + ofile.write("\x00", 1); + // ofile.write((char*)&shortcut.tags.type_id, 1); ofile.write(shortcut.tags.key, 5);