├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── other.md └── workflows │ └── stale.yml ├── .gitignore ├── .gitmodules ├── .vscode └── tasks.json ├── CEFInjectLib ├── .vscode │ ├── c_cpp_properties.json │ └── tasks.json ├── CEFInject.cpp ├── CEFInject.h ├── CEFInjectLib.vcxproj └── CEFInjectLib.vcxproj.filters ├── CONTRIBUTING.md ├── GlosSI.sln ├── GlosSIConfig ├── .clang-format ├── .vscode │ └── tasks.json ├── ExeImageProvider.cpp ├── ExeImageProvider.h ├── GetAUMIDs.ps1 ├── GlosSIConfig.vcxproj ├── GlosSIConfig.vcxproj.DotSettings ├── GlosSIConfig.vcxproj.filters ├── GlosSI_Logo_512.png ├── QtMsBuild │ ├── Qt.props │ ├── deploy │ │ ├── qt_import.props │ │ ├── qtdeploy.props │ │ ├── qtdeploy.targets │ │ └── qtdeploy.xml │ ├── moc │ │ ├── qt_import.props │ │ ├── qtmoc.props │ │ ├── qtmoc.targets │ │ ├── qtmoc.xml │ │ ├── qtmoc_cl.targets │ │ └── qtmoc_v3.xml │ ├── qml │ │ ├── qt_import.props │ │ ├── qtqml.props │ │ └── qtqml.targets │ ├── qt.targets │ ├── qt_defaults.props │ ├── qt_globals.targets │ ├── qt_private.props │ ├── qt_settings.targets │ ├── qt_settings.xml │ ├── qt_settings_vs2015.xml │ ├── qt_tasks.targets │ ├── qt_vars.targets │ ├── rcc │ │ ├── qt_import.props │ │ ├── qtrcc.props │ │ ├── qtrcc.targets │ │ ├── qtrcc.xml │ │ ├── qtrcc_cl.targets │ │ └── qtrcc_v3.xml │ ├── repc │ │ ├── qt_import.props │ │ ├── qtrepc.props │ │ ├── qtrepc.targets │ │ ├── qtrepc.xml │ │ ├── qtrepc_cl.targets │ │ └── qtrepc_v3.xml │ ├── translation │ │ ├── qt_import.props │ │ ├── qttranslation.props │ │ ├── qttranslation.targets │ │ └── qttranslation.xml │ └── uic │ │ ├── qt_import.props │ │ ├── qtuic.props │ │ ├── qtuic.targets │ │ ├── qtuic.xml │ │ └── qtuic_v3.xml ├── Resource.rc ├── UIModel.cpp ├── UIModel.h ├── UWPFetch.h ├── WinEventFilter.h ├── main.cpp ├── manifest.xml ├── noise.png ├── qml.qrc ├── qml │ ├── AddSelectTypeDialog.qml │ ├── AdvancedTargetSettings.qml │ ├── CollapsiblePane.qml │ ├── EGSSelectDialog.qml │ ├── FluentTextInput.qml │ ├── GlobalConf.qml │ ├── InfoDialog.qml │ ├── RPane.qml │ ├── ShortcutCards.qml │ ├── ShortcutProps.qml │ ├── SteamGridDialog.qml │ ├── SteamInputXboxDisabledDialog.qml │ ├── SteamNotFoundDialog.qml │ ├── UWPSelectDialog.qml │ └── main.qml ├── resource.h ├── steamscreener.png └── svg │ ├── add_photo_alternate_white_24dp.svg │ ├── delete_white_24dp.svg │ ├── edit_white_24dp.svg │ ├── expand_more_white_24dp.svg │ ├── help_outline_white_24dp.svg │ ├── settings_fill_white_24dp.svg │ └── steam.svg ├── GlosSITarget ├── .clang-format ├── .vscode │ ├── c_cpp_properties.json │ ├── launch.json │ └── tasks.json ├── AppLauncher.cpp ├── AppLauncher.h ├── CMakeLists.txt ├── CommonHttpEndpoints.h ├── DllInjector.h ├── GlosSITarget.vcxproj ├── GlosSITarget.vcxproj.filters ├── GlosSI_logo.h ├── HttpServer.cpp ├── HttpServer.h ├── InputRedirector.cpp ├── InputRedirector.h ├── Overlay.cpp ├── Overlay.h ├── OverlayLogSink.h ├── ProcessPriority.h ├── Resource.rc ├── Roboto.h ├── SteamOverlayDetector.cpp ├── SteamOverlayDetector.h ├── SteamTarget.cpp ├── SteamTarget.h ├── TargetWindow.cpp ├── TargetWindow.h ├── UWPOverlayEnabler.h ├── imconfig.h ├── imgui.ini ├── main.cpp ├── resource.h └── steam_sf_keymap.h ├── GlosSIWatchdog ├── .vscode │ └── tasks.json ├── GlosSIWatchdog.rc ├── GlosSIWatchdog.vcxproj ├── GlosSIWatchdog.vcxproj.filters ├── dllmain.cpp └── resource.h ├── GlosSI_Icon.ico ├── GlosSI_Logo.png ├── GlosSI_Logo_512.png ├── Installer ├── Installer.nsi └── buildInstaller.ps1 ├── LICENSE ├── QT_License ├── Readme.md ├── SteamTweaks ├── .eslintrc.cjs ├── .gitignore ├── .nvmrc ├── .vscode │ └── launch.json ├── package-lock.json ├── package.json ├── rollup.config.js ├── src │ ├── @types │ │ ├── GlosSISettings.d.ts │ │ └── SteamClient.d.ts │ ├── GlosSITweaks.ts │ ├── Tweaks │ │ ├── GamepadUI │ │ │ └── MinimizeSteamGamepadUI.ts │ │ └── Overlay │ │ │ └── SharedContext │ │ │ └── HideFPSCounter.ts │ └── common │ │ ├── Steam.ts │ │ ├── tweakApi.ts │ │ └── util │ │ ├── types.d.ts │ │ └── util.ts └── tsconfig.json ├── THIRD_PARTY_LICENSES.txt ├── UWPOverlayEnablerDLL ├── .vscode │ └── tasks.json ├── UWPOverlayEnablerDLL.vcxproj ├── UWPOverlayEnablerDLL.vcxproj.filters └── dllmain.cpp ├── ViGEm_BuildConfig.patch ├── build.ps1 ├── buildSFML.ps1 ├── buildSFML.sh ├── buildViGEmClient.ps1 ├── bundle-zip.ps1 ├── common ├── .vscode │ └── c_cpp_properties.json ├── HidHide.cpp ├── HidHide.h ├── Settings.h ├── UnhookUtil.cpp ├── UnhookUtil.h ├── common.vcxproj ├── common.vcxproj.filters ├── nlohmann_json_wstring.h ├── steam_util.h └── util.h ├── docs ├── BUILDING.md ├── Usage.md ├── appid_trick.png ├── glossi_add_shortcut.gif ├── imgui_controls_v6_Xbox.png └── overlay_screenie.png ├── download_release_deps.ps1 ├── glossi.code-workspace ├── prebuild.ps1 ├── tail_config_logs.ps1 ├── tail_target_logs.ps1 ├── traypp_unicode.patch ├── version_appveyor.ps1 └── version_help.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | 4 | github: 5 | - Alia5 6 | custom: 7 | - https://www.buymeacoffee.com/flatspotso7 8 | - https://www.paypal.com/donate/?hosted_button_id=TDKKBV7QU67L6 9 | - https://paypal.me/flatspotpics 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | - [ ] _**I have read and understand that tickets without Logs (or other info if Logs are 1000% not relevant) will be closed without comment.**_ 12 | 13 | ## Expected Behavior 14 | 15 | 16 | ## Actual Behavior 17 | 18 | 19 | ## Steps to Reproduce the Problem 20 | 21 | 1. 22 | 2. 23 | 3. 24 | ... 25 | 26 | ## General Information 27 | 28 | - Version: (0.0.0.0-0-g1234567) 29 | - Platform: (Win10/Win11 / Desktop/SteamDeck) 30 | - Controller(s): (1 Steam Controller + 1 Switch Pro Controller) 31 | - Application: (GlosSITarget/GlosSIConfig) 32 | 33 | ## Logs / Additional Files 34 | 35 | Log and config files are located in `%appdata%/GlosSI` 36 | The files are called: glossiconfig.log, glossitarget.log, GlosSIWatchdog.log and UWPOverlayEnabler.log 37 | 38 | _(Windows-search may not pick up the files when searching for `log` **if** file endings are hidden (default setting))_ 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Other 3 | about: Create issue that doesn't fit other templates 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | - [ ] _**I have read and understand that tickets without Logs (or other info if Logs are 1000% not relevant) will be closed without comment.**_ 11 | 12 | ## General Information 13 | 14 | - Version: (0.0.0.0-0-g1234567) 15 | - Platform: (Win10/Win11 / Desktop/SteamDeck) 16 | - Controller(s): (1 Steam Controller + 1 Switch Pro Controller) 17 | - Application: (GlosSITarget/GlosSIConfig) 18 | 19 | ## Logs / Additional Files 20 | 21 | Log and config files are located in `%appdata%/GlosSI` 22 | The files are called: glossiconfig.log, glossitarget.log, GlosSIWatchdog.log and UWPOverlayEnabler.log 23 | 24 | _(Windows-search may not pick up the files when searching for `log` **if** file endings are hidden (default setting))_ 25 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. 2 | # 3 | # You can adjust the behavior by modifying this file. 4 | # For more information, see: 5 | # https://github.com/actions/stale 6 | name: Mark stale issues and pull requests 7 | 8 | on: 9 | schedule: 10 | - cron: '17 0 * * *' 11 | 12 | jobs: 13 | stale: 14 | 15 | runs-on: ubuntu-latest 16 | permissions: 17 | issues: write 18 | pull-requests: write 19 | 20 | steps: 21 | - uses: actions/stale@v3 22 | with: 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | stale-issue-message: 'Stale issue message' 25 | stale-pr-message: 'Stale pull request message' 26 | stale-issue-label: 'no-issue-activity' 27 | stale-pr-label: 'no-pr-activity' 28 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/SFML"] 2 | path = deps/SFML 3 | url = https://github.com/Alia5/SFML 4 | [submodule "deps/WinReg"] 5 | path = deps/WinReg 6 | url = https://github.com/GiovanniDicanio/WinReg 7 | [submodule "deps/spdlog"] 8 | path = deps/spdlog 9 | url = https://github.com/gabime/spdlog 10 | [submodule "deps/subhook"] 11 | path = deps/subhook 12 | url = https://github.com/Zeex/subhook 13 | [submodule "deps/ValveFileVDF"] 14 | path = deps/ValveFileVDF 15 | url = https://github.com/TinyTinni/ValveFileVDF 16 | [submodule "deps/ViGEmClient"] 17 | path = deps/ViGEmClient 18 | url = https://github.com/ViGEm/ViGEmClient 19 | [submodule "deps/imgui"] 20 | path = deps/imgui 21 | url = https://github.com/ocornut/imgui/ 22 | [submodule "deps/imgui-sfml"] 23 | path = deps/imgui-sfml 24 | url = https://github.com/eliasdaler/imgui-sfml 25 | [submodule "deps/json"] 26 | path = deps/json 27 | url = https://github.com/nlohmann/json 28 | [submodule "deps/traypp"] 29 | path = deps/traypp 30 | url = https://github.com/Soundux/traypp 31 | [submodule "deps/fifo_map"] 32 | path = deps/fifo_map 33 | url = https://github.com/nlohmann/fifo_map 34 | [submodule "deps/Shortcuts_VDF"] 35 | path = deps/Shortcuts_VDF 36 | url = https://github.com/Alia5/Shortcuts_VDF 37 | [submodule "deps/cpp-httplib"] 38 | path = deps/cpp-httplib 39 | url = https://github.com/yhirose/cpp-httplib 40 | [submodule "deps/easywsclient"] 41 | path = deps/easywsclient 42 | url = https://github.com/dhbaird/easywsclient 43 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "shell", 6 | "label": "Build Solution (Debug)", 7 | "command": "msbuild.exe", 8 | "args": [ 9 | "GlosSI.sln", 10 | "/target:Build", 11 | "/p:Configuration=Debug", 12 | "/p:Platform=x64" 13 | ], 14 | "options": { 15 | "cwd": "${workspaceFolder}", 16 | }, 17 | "problemMatcher": ["$msCompile"], 18 | "group": { 19 | "kind": "build", 20 | }, 21 | }, 22 | { 23 | "type": "shell", 24 | "label": "Re-Build Solution (Debug)", 25 | "command": "msbuild.exe", 26 | "args": [ 27 | "GlosSI.sln", 28 | "/target:Rebuild", 29 | "/p:Configuration=Debug", 30 | "/p:Platform=x64" 31 | ], 32 | "options": { 33 | "cwd": "${workspaceFolder}", 34 | }, 35 | "problemMatcher": ["$msCompile"], 36 | "group": { 37 | "kind": "build", 38 | }, 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /CEFInjectLib/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${workspaceFolder}/../deps/json/include", 8 | "${workspaceFolder}/../deps/cpp-httplib", 9 | "${workspaceFolder}/../deps/easywsclient" 10 | ], 11 | "defines": [ 12 | "_DEBUG", 13 | "UNICODE", 14 | "_UNICODE", 15 | "_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING" 16 | ], 17 | "windowsSdkVersion": "10.0.18362.0", 18 | "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe", 19 | "cStandard": "c11", 20 | "cppStandard": "c++20", 21 | "intelliSenseMode": "msvc-x64" 22 | } 23 | ], 24 | "version": 4 25 | } -------------------------------------------------------------------------------- /CEFInjectLib/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "shell", 6 | "label": "Build CEFInjectLib (Debug)", 7 | "command": "msbuild.exe", 8 | "args": [ 9 | "GlosSI.sln", 10 | "/target:CEFInjectLib", 11 | "/p:Configuration=Debug", 12 | "/p:Platform=x64" 13 | ], 14 | "options": { 15 | "cwd": "${workspaceFolder}/..", 16 | 17 | }, 18 | "problemMatcher": ["$msCompile"], 19 | "group": { 20 | "kind": "build", 21 | }, 22 | }, 23 | { 24 | "type": "shell", 25 | "label": "Re-Build CEFInjectLib (Debug)", 26 | "command": "msbuild.exe", 27 | "args": [ 28 | "GlosSI.sln", 29 | "/target:CEFInjectLib:Rebuild", 30 | "/p:Configuration=Debug", 31 | "/p:Platform=x64" 32 | ], 33 | "options": { 34 | "cwd": "${workspaceFolder}/..", 35 | 36 | }, 37 | "problemMatcher": ["$msCompile"], 38 | "group": { 39 | "kind": "build", 40 | }, 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /CEFInjectLib/CEFInject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | namespace CEFInject 24 | { 25 | namespace internal { 26 | httplib::Client GetHttpClient(uint16_t port); 27 | static inline uint16_t port_ = 8080; 28 | } 29 | inline void setPort(uint16_t port) 30 | { 31 | internal::port_ = port; 32 | } 33 | bool CEFDebugAvailable(uint16_t port = internal::port_); 34 | std::vector AvailableTabNames(uint16_t port = internal::port_); 35 | nlohmann::basic_json<> AvailableTabs(uint16_t port = internal::port_); 36 | nlohmann::basic_json<> InjectJs(std::string_view tab_name, std::string_view debug_url, std::wstring_view js, uint16_t port = internal::port_); 37 | nlohmann::basic_json<> InjectJsByName(std::wstring_view tabname, std::wstring_view js, uint16_t port = internal::port_); 38 | 39 | class WSAStartupWrap 40 | { 41 | public: 42 | explicit WSAStartupWrap(); 43 | ~WSAStartupWrap(); 44 | private: 45 | bool wsa_startup_succeeded_ = false; 46 | }; 47 | 48 | class SteamTweaks 49 | { 50 | public: 51 | SteamTweaks() = default; 52 | 53 | struct Tab_Info 54 | { 55 | std::string name; 56 | std::string id; 57 | std::string webSocketDebuggerUrl; 58 | }; 59 | bool injectGlosSITweaks(std::string_view tab_name, uint16_t port = internal::port_); 60 | bool injectGlosSITweaks(const Tab_Info& info, uint16_t port = internal::port_); 61 | bool uninstallTweaks(bool force = false); 62 | 63 | void update(float elapsed_time); 64 | 65 | [[nodiscard]] bool isAutoInject() const; 66 | void setAutoInject(const bool auto_inject); 67 | private: 68 | bool readGlosSITweaksJs(); 69 | void readAvailableTweaks(bool builtin = true); 70 | bool auto_inject_ = false; 71 | 72 | static constexpr float update_interval_ = 30.f; 73 | float time_since_last_update_ = update_interval_; 74 | using tab_id = std::string; 75 | std::map glossi_tweaks_injected_map_; 76 | 77 | std::future auto_inject_future_; 78 | 79 | std::wstring glossi_tweaks_js_; 80 | 81 | std::map js_tweaks_cache_; 82 | 83 | using path_name = std::wstring; 84 | using tab_name = std::string; 85 | static inline const std::map path_tab_map_ = { 86 | {L"SharedContext", "Steam Shared Context"}, 87 | {L"Overlay", "HOW TF GET OVERLAY TAB NAME?"}, // TODO: Figure out how to get the overlay tab name 88 | {L"GamepadUI", "Steam Big Picture Mode"}, 89 | }; 90 | 91 | static constexpr std::string_view steam_shared_ctx_tab_name_ = "Steam Shared Context"; 92 | static constexpr std::string_view steam_tweaks_path_ = "SteamTweaks"; 93 | static constexpr std::wstring_view uninstall_glossi_tweaks_js_ = LR"( 94 | (() => { 95 | return window.GlosSITweaks?.GlosSI?.uninstall(); 96 | })(); 97 | )"; 98 | }; 99 | 100 | namespace internal { 101 | static WSAStartupWrap wsa_startup_wrap{}; 102 | } 103 | 104 | } -------------------------------------------------------------------------------- /CEFInjectLib/CEFInjectLib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Feel free to take on any feature-request, bug report or whatever idea you have. 4 | If you feel like it, you can also look at the many TODOs sprinkled throughout the code. 5 | 6 | ## Building / Dev environment 7 | 8 | For building instructions see [BUILDING.md](./BUILDING.md) 9 | 10 | If you need technical assistance, reach out via e-mail or any other channel you might find. 11 | Please get to the chase right away, though, as I get way to much spam. 12 | Please also note, that I'm short on time and might not reply immediately 13 | Also I'm least available on Discord. 14 | 15 | ## Pull Requests 16 | 17 | Please keep your feature branch up to date with the latest changes from the `develop` branch. 18 | 19 | Use [git-rebase](https://git-scm.com/docs/git-rebase); If your feature branch contains backmerges it will be ignored. -------------------------------------------------------------------------------- /GlosSIConfig/.clang-format: -------------------------------------------------------------------------------- 1 | UseTab: false 2 | BasedOnStyle: LLVM 3 | IndentWidth: 4 4 | BreakBeforeBraces: "Stroustrup" 5 | AllowShortIfStatementsOnASingleLine: false 6 | IndentCaseLabels: false 7 | ColumnLimit: 120 8 | PointerAlignment: "Left" -------------------------------------------------------------------------------- /GlosSIConfig/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "shell", 6 | "label": "Build GlosSIConfig (Debug)", 7 | "command": "msbuild.exe", 8 | "args": [ 9 | "GlosSI.sln", 10 | "/target:GlosSIConfig", 11 | "/p:Configuration=Debug", 12 | "/p:Platform=x64" 13 | ], 14 | "options": { 15 | "cwd": "${workspaceFolder}/..", 16 | 17 | }, 18 | "problemMatcher": ["$msCompile"], 19 | "group": { 20 | "kind": "build", 21 | }, 22 | }, 23 | { 24 | "type": "shell", 25 | "label": "Re-Build GlosSIConfig (Debug)", 26 | "command": "msbuild.exe", 27 | "args": [ 28 | "GlosSI.sln", 29 | "/target:GlosSIConfig:Rebuild", 30 | "/p:Configuration=Debug", 31 | "/p:Platform=x64" 32 | ], 33 | "options": { 34 | "cwd": "${workspaceFolder}/..", 35 | 36 | }, 37 | "problemMatcher": ["$msCompile"], 38 | "group": { 39 | "kind": "build", 40 | }, 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /GlosSIConfig/ExeImageProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "ExeImageProvider.h" 2 | -------------------------------------------------------------------------------- /GlosSIConfig/ExeImageProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | class ExeImageProvider : public QQuickImageProvider { 7 | public: 8 | ExeImageProvider() 9 | : QQuickImageProvider(QQuickImageProvider::Image) 10 | { 11 | } 12 | 13 | QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize) override 14 | { 15 | HICON icon = 0; 16 | std::wstring path = QString(id).replace(QRegularExpression(("\\%5C")), "\\").toStdWString(); 17 | icon = (HICON)LoadImage( 18 | 0, 19 | path.data(), 20 | IMAGE_ICON, 21 | GetSystemMetrics(SM_CXSMICON), 22 | GetSystemMetrics(SM_CYSMICON), 23 | LR_LOADFROMFILE | LR_LOADMAP3DCOLORS); 24 | if (!icon) { 25 | ExtractIconEx(path.data(), 0, &icon, nullptr, 1); 26 | if (!icon) { 27 | return {}; 28 | } 29 | } 30 | return QImage::fromHICON(icon); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /GlosSIConfig/GetAUMIDs.ps1: -------------------------------------------------------------------------------- 1 | #stolen and adapted from: https://github.com/BrianLima/UWPHook/blob/master/UWPHook/Resources/GetAUMIDScript.ps1 2 | $installedapps = Get-AppxPackage 3 | $invalidNames = '*ms-resource*', '*DisplayName*' 4 | $aumidList = @() 5 | 6 | foreach ($app in $installedapps) { 7 | try { 8 | if (-not $app.IsFramework) { 9 | foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id) { 10 | $appx = Get-AppxPackageManifest $app; 11 | $name = $appx.Package.Properties.DisplayName; 12 | 13 | #filter out language packs and Sysinternals (adds ~30 entries, all non-game) 14 | if ($app.packagefamilyname -like "Microsoft.Language*" -or $name -like "Sysinternals*") { break; } 15 | 16 | if ($name -like '*DisplayName*' -or $name -like '*ms-resource*') { 17 | $name = $appx.Package.Applications.Application.VisualElements.DisplayName; 18 | } 19 | if ($name -like '*DisplayName*' -or $name -like '*ms-resource*') { 20 | $name = $app.Name; 21 | } 22 | 23 | #filter more apps with improper naming patterns; games generally have the appropriate field in their manifests filled out. 24 | if ($name -like "MicrosoftWindows.*" -or $name -like "Windows.*" -or $name -like "Windows Web*") { break; } 25 | 26 | $installDir = $app.InstallLocation; 27 | #filter out system apps and apps installed by Microsoft as part of Windows 28 | if ($installDir -like "*SystemApps*" -or $installDir -like "*Microsoft.Windows*") { break; } 29 | 30 | $logo = $app.InstallLocation + "\" + ($appx.Package.Applications.Application.VisualElements.Square150x150Logo | Select-Object -First 1); 31 | 32 | #if this app uses qualifiers to provide different scaling factors and does not have an unqualified name, select the largest of those icons 33 | if (-Not ($logo | Test-Path -PathType Leaf)) { 34 | $assetpath = Split-Path -Path $logo -Parent 35 | $sp = (Split-Path -Path $logo -Leaf).Split(".")[0] 36 | $ext = ($appx.Package.Applications.Application.VisualElements.Square150x150Logo | Select-Object -First 1).Split(".")[-1] 37 | $logo = Get-ChildItem -Path $($assetpath + '\' + $sp + '*.' + $ext) | Sort-Object -Property Length -Descending | Select-Object -First 1 -ExpandProperty FullName 38 | } 39 | 40 | $aumidList += $name + "|" + $installDir + "|" + $logo + "|" + 41 | $app.packagefamilyname + "!" + $id + ";" 42 | } 43 | } 44 | } 45 | catch { 46 | $ErrorMessage = $_.Exception.Message 47 | $FailedItem = $_.Exception.ItemName 48 | } 49 | } 50 | 51 | $aumidList | Sort-Object #sorts the array by treating it as single strings per app, thus the first field (app name) is what it sorts on 52 | -------------------------------------------------------------------------------- /GlosSIConfig/GlosSIConfig.vcxproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | Cpp20 -------------------------------------------------------------------------------- /GlosSIConfig/GlosSIConfig.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} 18 | ts 19 | 20 | 21 | {4abd6243-b275-40c0-8927-27cebe0e7b5a} 22 | 23 | 24 | {ace69ddb-7744-4e80-a55b-7beb33f0cc81} 25 | 26 | 27 | 28 | 29 | Source Files 30 | 31 | 32 | Resource Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | 45 | 46 | qml 47 | 48 | 49 | qml 50 | 51 | 52 | qml 53 | 54 | 55 | qml 56 | 57 | 58 | qml 59 | 60 | 61 | qml 62 | 63 | 64 | qml 65 | 66 | 67 | qml 68 | 69 | 70 | 71 | 72 | qml 73 | 74 | 75 | qml 76 | 77 | 78 | qml 79 | 80 | 81 | qml 82 | 83 | 84 | qml 85 | 86 | 87 | qml 88 | 89 | 90 | qml 91 | 92 | 93 | 94 | 95 | Header Files 96 | 97 | 98 | 99 | 100 | Header Files 101 | 102 | 103 | Header Files 104 | 105 | 106 | Header Files 107 | 108 | 109 | Header Files 110 | 111 | 112 | 113 | 114 | manifest 115 | 116 | 117 | 118 | 119 | Resource Files 120 | 121 | 122 | 123 | 124 | Resource Files 125 | 126 | 127 | -------------------------------------------------------------------------------- /GlosSIConfig/GlosSI_Logo_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/GlosSIConfig/GlosSI_Logo_512.png -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/Qt.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 35 | 36 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | $(QTDIR) 55 | $(DefaultQtVersion)\bin 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/deploy/qt_import.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | $(QtMsBuildProps); 39 | $(MSBuildThisFileDirectory)qtdeploy.props 40 | 41 | 42 | $(QtMsBuildTargets); 43 | $(MSBuildThisFileDirectory)qtdeploy.targets 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/deploy/qtdeploy.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | false 39 | 40 | 41 | 42 | $(TargetPath) 43 | $(ProjectDir) 44 | $(OutDir) 45 | 46 | 47 | false 48 | false 49 | false 50 | false 51 | false 52 | false 53 | 54 | 55 | false 56 | false 57 | false 58 | false 59 | false 60 | false 61 | false 62 | false 63 | 64 | 65 | false 66 | true 67 | false 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/moc/qt_import.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | $(QtMsBuildProps); 39 | $(MSBuildThisFileDirectory)qtmoc.props 40 | 41 | 42 | $(QtMsBuildTargets); 43 | $(MSBuildThisFileDirectory)qtmoc.targets 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/moc/qtmoc.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 35 | 36 | 40 | 43 | 44 | 48 | 49 | 50 | moc %(Identity) 51 | 52 | $(QTDIR) 54 | $(QtInstallDir) 56 | 57 | %(FullPath) 58 | 59 | $(ProjectDir)GeneratedFiles\$(Configuration)\moc_%(Filename).cpp 61 | 62 | $(IntDir)moc\ 64 | moc_%(Filename).cpp 66 | 67 | output 68 | true 69 | [AllOptions] [AdditionalOptions] 70 | %(OutputFile) 71 | false 72 | 73 | 74 | 75 | 79 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/qml/qt_import.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | $(QtMsBuildProps_AfterRcc); 39 | $(MSBuildThisFileDirectory)qtqml.props 40 | 41 | 42 | $(QtMsBuildTargets_AfterRcc); 43 | $(MSBuildThisFileDirectory)qtqml.targets 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/qml/qtqml.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 35 | 36 | 40 | 43 | 44 | 48 | 49 | 50 | false 51 | 53 | ahead of time]]> 55 | _%.cpp]]> 57 | 59 | Qt Quick Compiler: filtering %(Identity) 61 | $(ProjectDir)GeneratedFiles\%(Filename)_qmlcache.qrc 63 | $(ProjectDir)GeneratedFiles\qrc_%(Filename)_qmlcache.cpp 65 | %(Filename)_qmlcache 67 | 69 | Qt Quick Compiler: generating cache loader 71 | $(ProjectDir)GeneratedFiles\qmlcache_loader.cpp 73 | 74 | 75 | 76 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/qt.targets: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 41 | 44 | 45 | 49 | 50 | 0 53 | 0 56 | 0 59 | 60 | 61 | 65 | 66 | 67 | 68 | 69 | 70 | 74 | 77 | 79 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/qt_settings.targets: -------------------------------------------------------------------------------- 1 |  2 | 31 | 35 | 36 | 38 | HKEY_CURRENT_USER\Software\Digia\Versions 40 | $([MSBuild]::GetRegistryValue('$(QtVersionsRegKey)','VersionNames')) 42 | 43 | 44 | 47 | Project;PropertySheet 48 | 49 | 52 | 56 | Project;PropertySheet 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/rcc/qt_import.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | $(QtMsBuildProps); 39 | $(MSBuildThisFileDirectory)qtrcc.props 40 | 41 | 42 | $(QtMsBuildTargets); 43 | $(MSBuildThisFileDirectory)qtrcc.targets 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/rcc/qtrcc.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 35 | 36 | 40 | 43 | 44 | 48 | 49 | 50 | rcc %(Identity) 51 | 52 | $(QTDIR) 54 | $(QtInstallDir) 56 | 57 | %(FullPath) 58 | 59 | $(ProjectDir)GeneratedFiles\$(Configuration)\qrc_%(Filename).cpp 61 | 62 | $(IntDir)rcc\ 64 | qrc_%(Filename).cpp 66 | 67 | %(Filename) 68 | default 69 | false 70 | output 71 | true 72 | [AllOptions] [AdditionalOptions] 73 | %(OutputFile) 74 | 75 | 76 | 77 | 81 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/repc/qt_import.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | $(QtMsBuildProps); 39 | $(MSBuildThisFileDirectory)qtrepc.props 40 | 41 | 42 | $(QtMsBuildTargets); 43 | $(MSBuildThisFileDirectory)qtrepc.targets 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/repc/qtrepc.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 41 | 44 | 45 | 49 | 50 | 51 | repc %(Identity) 52 | $(QtInstallDir) 53 | $(QTDIR) 54 | %(FullPath) 55 | replica 56 | .h]]> 57 | rep 58 | moc_cpp 59 | true 60 | [AllOptions] [AdditionalOptions] 61 | %(OutputFile) 62 | 63 | 64 | 65 | 69 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/translation/qt_import.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | $(QtMsBuildProps); 39 | $(MSBuildThisFileDirectory)qttranslation.props 40 | 41 | 42 | $(QtMsBuildTargets); 43 | $(MSBuildThisFileDirectory)qttranslation.targets 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/translation/qttranslation.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 41 | 44 | 45 | 49 | 50 | @(ClCompile);@(ClInclude);@(QtMoc);@(QtUic) 52 | 53 | 54 | 58 | 59 | 60 | false 61 | 62 | lupdate %(Identity) 63 | $(QtLUpdateOptions) 64 | default 65 | default 66 | false 67 | false 68 | false 69 | false 70 | false 71 | false 72 | false 73 | false 74 | false 75 | 76 | lrelease %(Identity) 77 | $(OutDir) 78 | %(Filename).qm 79 | $(QtLReleaseOptions) 80 | false 81 | false 82 | false 83 | false 84 | false 85 | 86 | 87 | 88 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/uic/qt_import.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 38 | $(QtMsBuildProps); 39 | $(MSBuildThisFileDirectory)qtuic.props 40 | 41 | 42 | $(QtMsBuildTargets); 43 | $(MSBuildThisFileDirectory)qtuic.targets 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GlosSIConfig/QtMsBuild/uic/qtuic.props: -------------------------------------------------------------------------------- 1 |  2 | 31 | 32 | 36 | 37 | 41 | 44 | 45 | 49 | 50 | 51 | uic %(Identity) 52 | 53 | $(QTDIR) 55 | $(QtInstallDir) 57 | 58 | %(FullPath) 59 | 60 | $(ProjectDir)GeneratedFiles\$(Configuration)\ui_%(Filename).h 62 | 63 | $(IntDir)uic\ 65 | ui_%(Filename).h 67 | 68 | true 69 | [AllOptions] [AdditionalOptions] 70 | %(OutputFile) 71 | 72 | 73 | 74 | 78 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /GlosSIConfig/Resource.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include winres.h\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | 53 | VS_VERSION_INFO VERSIONINFO 54 | FILEVERSION 0,1,2,0072000000004 55 | PRODUCTVERSION 0,1,2,0072000000004 56 | FILEFLAGSMASK 0x3fL 57 | #ifdef _DEBUG 58 | FILEFLAGS 0x1L 59 | #else 60 | FILEFLAGS 0x0L 61 | #endif 62 | FILEOS 0x40004L 63 | FILETYPE 0x1L 64 | FILESUBTYPE 0x0L 65 | BEGIN 66 | BLOCK "StringFileInfo" 67 | BEGIN 68 | BLOCK "000904b0" 69 | BEGIN 70 | VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" 71 | VALUE "FileDescription", "GlosSI - Config" 72 | VALUE "FileVersion", "0.1.2.0-72-gaebb0a4" 73 | VALUE "InternalName", "GlosSIConfig" 74 | VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" 75 | VALUE "OriginalFilename", "GlosSIConfig.exe" 76 | VALUE "ProductName", "GlosSI" 77 | VALUE "ProductVersion", "0.1.2.0-72-gaebb0a4" 78 | END 79 | END 80 | BLOCK "VarFileInfo" 81 | BEGIN 82 | VALUE "Translation", 0x9, 1200 83 | END 84 | END 85 | 86 | 87 | ///////////////////////////////////////////////////////////////////////////// 88 | // 89 | // Icon 90 | // 91 | 92 | // Icon with lowest ID value placed first to ensure application icon 93 | // remains consistent on all systems. 94 | IDI_ICON1 ICON "..\GlosSI_Icon.ico" 95 | 96 | #endif // English (United States) resources 97 | ///////////////////////////////////////////////////////////////////////////// 98 | 99 | 100 | 101 | #ifndef APSTUDIO_INVOKED 102 | ///////////////////////////////////////////////////////////////////////////// 103 | // 104 | // Generated from the TEXTINCLUDE 3 resource. 105 | // 106 | 107 | 108 | ///////////////////////////////////////////////////////////////////////////// 109 | #endif // not APSTUDIO_INVOKED 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /GlosSIConfig/UWPFetch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | namespace UWPFetch { 11 | 12 | QVariantList UWPAppList() 13 | { 14 | if (!IsWindows10OrGreater()) { 15 | return QVariantList(); 16 | } 17 | 18 | std::vector logoNames{ 19 | L"Square150x150Logo", 20 | L"Square310x310Logo", 21 | L"Square44x44Logo", 22 | L"Square71x71Logo", 23 | L"Square70x70Logo", 24 | L"Logo", 25 | L"SmallLogo", 26 | L"Square30x30Logo", 27 | }; 28 | 29 | QVariantList pairs; 30 | 31 | QProcess proc; 32 | proc.setProgram("powershell.exe"); 33 | QStringList args; 34 | args.push_back("-noprofile"); 35 | args.push_back("-ExecutionPolicy"); 36 | args.push_back("Bypass"); 37 | args.push_back("-File"); 38 | args.push_back(".\\GetAUMIDs.ps1"); 39 | proc.setArguments(args); 40 | proc.start(); 41 | proc.waitForFinished(60000); 42 | const auto baseList = QString(proc.readAllStandardOutput()).split(";"); 43 | QVariantList list; 44 | for (const auto& entry : baseList) { 45 | auto subList = entry.split('|'); 46 | if (subList.size() < 4) 47 | continue; 48 | auto name = QString(subList[0]).replace("\r\n", ""); 49 | if (name == "-Error-") 50 | continue; 51 | QVariantMap uwpPair; 52 | uwpPair.insert("AppName", name); 53 | uwpPair.insert("Path", subList[1]); 54 | uwpPair.insert("AppUMId", subList[3]); 55 | 56 | QString icoFName = subList[2]; 57 | std::filesystem::path icoPath(icoFName.toStdString()); 58 | 59 | std::vector possibleextensions = {".scale-100", ".scale-125", ".scale-150", ".scale-200"}; 60 | if (!std::filesystem::exists(icoPath)) { 61 | for (const auto& ext : possibleextensions) { 62 | QString maybeFname = QString(icoFName).replace(".png", ext + ".png"); 63 | std::filesystem::path maybePath(maybeFname.toStdString()); 64 | if (std::filesystem::exists(maybePath)) { 65 | icoPath = maybePath; 66 | break; 67 | } 68 | } 69 | } 70 | 71 | uwpPair.insert("IconPath", QString::fromStdString(icoPath.string())); 72 | 73 | list.push_back(uwpPair); 74 | } 75 | if (list.empty()) { 76 | auto stderrstr = proc.readAllStandardError(); 77 | auto stdoutstr = proc.readAllStandardOutput(); 78 | list.emplaceBack(QVariantMap{ 79 | {"AppName", "Error executing \"GetAUMIDs.ps1\""}, 80 | {"Path", ""}, 81 | {"AppUMId", QString::number(proc.error()) + ":" + stderrstr}, 82 | }); 83 | } 84 | return list; 85 | } 86 | 87 | } // namespace UWPFetch -------------------------------------------------------------------------------- /GlosSIConfig/WinEventFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | #include 19 | #define NOMINMAX 20 | #include 21 | 22 | class WinEventFilter : public QAbstractNativeEventFilter { 23 | public: 24 | WinEventFilter() = default; 25 | 26 | /* 27 | * When having the DWM frame fully extended into client area 28 | * ever since WIN10 a 6px border is displayed on top. 29 | * to remove that one has to catch the WM_NCCALCSIZE event and re-calculate the window-rect 30 | * https://stackoverflow.com/a/2135120/5106063 31 | * https://docs.microsoft.com/en-us/windows/win32/dwm/customframe 32 | */ 33 | bool nativeEventFilter(const QByteArray& eventType, void* message, qintptr* result) override 34 | { 35 | if (QString(eventType) == "windows_generic_MSG") { 36 | auto msg = static_cast(message)->message; 37 | auto lParam = static_cast(message)->lParam; 38 | auto hwnd = static_cast(message)->hwnd; 39 | if (msg == WM_NCCALCSIZE) { 40 | auto sz = reinterpret_cast(lParam); 41 | sz->rgrc[0].top -= 6; 42 | } 43 | } 44 | return false; 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /GlosSIConfig/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | GlosSI - Config 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /GlosSIConfig/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/GlosSIConfig/noise.png -------------------------------------------------------------------------------- /GlosSIConfig/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml/main.qml 4 | qml/RPane.qml 5 | qml/AddSelectTypeDialog.qml 6 | qml/ShortcutCards.qml 7 | qml/ShortcutProps.qml 8 | qml/FluentTextInput.qml 9 | svg/delete_white_24dp.svg 10 | svg/edit_white_24dp.svg 11 | svg/steam.svg 12 | qml/UWPSelectDialog.qml 13 | qml/InfoDialog.qml 14 | steamscreener.png 15 | noise.png 16 | svg/help_outline_white_24dp.svg 17 | qml/SteamNotFoundDialog.qml 18 | qml/SteamInputXboxDisabledDialog.qml 19 | qml/CollapsiblePane.qml 20 | svg/expand_more_white_24dp.svg 21 | GlosSI_Logo_512.png 22 | qml/AdvancedTargetSettings.qml 23 | qml/GlobalConf.qml 24 | svg/settings_fill_white_24dp.svg 25 | qml/EGSSelectDialog.qml 26 | svg/add_photo_alternate_white_24dp.svg 27 | qml/SteamGridDialog.qml 28 | 29 | 30 | -------------------------------------------------------------------------------- /GlosSIConfig/qml/AddSelectTypeDialog.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import QtQuick 6.2 17 | import QtQuick.Controls 6.2 18 | import QtQuick.Controls.Material 6.2 19 | import QtQuick.Dialogs 6.2 20 | 21 | Dialog { 22 | id: dlg 23 | anchors.centerIn: parent 24 | 25 | signal confirmed(var param) 26 | 27 | visible: false 28 | modal: true 29 | dim: true 30 | parent: Overlay.overlay 31 | Overlay.modal: Rectangle { 32 | color: Qt.rgba(0,0,0,0.4) 33 | opacity: backdropOpacity 34 | Behavior on opacity { 35 | NumberAnimation { 36 | duration: 300 37 | } 38 | } 39 | } 40 | property real backdropOpacity: 1.0 41 | 42 | enter: Transition { 43 | NumberAnimation{target: content; property: "y"; from: parent.height; to: 16; duration: 300; easing.type: Easing.OutQuad } 44 | NumberAnimation{target: background; property: "y"; from: parent.height; to: 0; duration: 300; easing.type: Easing.OutQuad } 45 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 0; to: 1; duration: 300; easing.type: Easing.OutQuad } 46 | } 47 | 48 | exit: Transition { 49 | NumberAnimation{target: content; property: "y"; from: 16; to: parent.height; duration: 300; easing.type: Easing.InQuad } 50 | NumberAnimation{target: background; property: "y"; from: 0; to: parent.height; duration: 300; easing.type: Easing.InQuad } 51 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 1; to: 0; duration: 300; easing.type: Easing.InQuad } 52 | } 53 | 54 | background: RPane { 55 | id: background 56 | radius: 4 57 | Material.elevation: 64 58 | bgOpacity: 0.97 59 | } 60 | contentItem: Item { 61 | id: content 62 | readonly property real spacing: 16 63 | implicitWidth: row.width 64 | implicitHeight: title.height + row.height + spacing 65 | Label { 66 | id: title 67 | anchors.top: parent.top 68 | anchors.left: parent.left 69 | text: qsTr("Shortcut type") 70 | font.bold: true 71 | font.pixelSize: 24 72 | } 73 | Row { 74 | id: row 75 | anchors.top: title.bottom 76 | anchors.topMargin: parent.spacing 77 | spacing: 16 78 | Button { 79 | text: qsTr("Add manually") 80 | highlighted: true 81 | onClicked: function(){ 82 | close() 83 | confirmed("man") 84 | } 85 | } 86 | Button { 87 | text: uiModel.isWindows ? qsTr("Win32 Program") : qsTr("Launch Program") 88 | highlighted: true 89 | onClicked: function(){ 90 | close() 91 | confirmed("launch") 92 | } 93 | } 94 | Button { 95 | visible: uiModel.isWindows 96 | text: qsTr("UWP App") 97 | highlighted: true 98 | onClicked: function(){ 99 | close() 100 | confirmed("uwp") 101 | } 102 | } 103 | Button { 104 | visible: uiModel.isWindows 105 | text: qsTr("EGS Game") 106 | highlighted: true 107 | onClicked: function(){ 108 | close() 109 | confirmed("egs") 110 | } 111 | } 112 | } 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /GlosSIConfig/qml/CollapsiblePane.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import QtQuick 2.9 17 | import QtQuick.Controls 2.9 18 | import QtQuick.Controls.Material 2.9 19 | import QtQuick.Controls.Material.impl 2.9 20 | 21 | 22 | RPane { 23 | property alias title: paneTitle.text 24 | width: parent.width 25 | 26 | property alias content: ldr.sourceComponent 27 | clip: true 28 | height: paneHeader.height + collapseColumn.spacing 29 | property bool collapsed: true 30 | id: collapsePane 31 | 32 | Behavior on height { 33 | NumberAnimation { 34 | duration: 300 35 | easing.type: Easing.InOutQuad 36 | } 37 | } 38 | 39 | Column { 40 | id: collapseColumn 41 | width: parent.width 42 | spacing: 16 43 | Item { 44 | id: paneHeader 45 | width: parent.width 46 | height: paneTitle.height + 32 47 | Label { 48 | id: paneTitle 49 | anchors.left: parent.left 50 | anchors.leftMargin: 4 51 | font.bold: true 52 | font.pixelSize: 24 53 | anchors.top: parent.top 54 | anchors.topMargin: 14 55 | } 56 | RoundButton { 57 | width: 48 58 | height: 48 59 | Material.elevation: 0 60 | anchors.rightMargin: 0 61 | anchors.top: parent.top 62 | anchors.topMargin: 0 63 | onClicked: function(){ 64 | collapsed = !collapsed; 65 | if (collapsed) { 66 | collapsePane.height = paneHeader.height + collapseColumn.spacing 67 | } else { 68 | collapsePane.height = paneHeader.height + collapseColumn.spacing * 3 + ldr.item.height 69 | } 70 | } 71 | Image { 72 | id: arrowImg 73 | anchors.centerIn: parent 74 | source: "qrc:/svg/expand_more_white_24dp.svg" 75 | width: 24 76 | height: 24 77 | transform: Rotation{ 78 | angle: collapsed ? 0 : 180 79 | origin.x: arrowImg.width/2 80 | origin.y: arrowImg.height/2 81 | Behavior on angle { 82 | NumberAnimation { 83 | duration: 125 84 | easing.type: Easing.InOutQuad 85 | } 86 | } 87 | } 88 | } 89 | anchors.right: parent.right 90 | } 91 | } 92 | Loader { 93 | id: ldr 94 | width: parent.width 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /GlosSIConfig/qml/FluentTextInput.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import QtQuick 6.2 17 | import QtQuick.Controls 6.2 18 | import QtQuick.Controls.Material 6.2 19 | 20 | TextField { 21 | id: control 22 | selectByMouse: true 23 | padding: 16 24 | bottomInset: padding/2 25 | background: Rectangle { 26 | implicitWidth: control.width + control.padding*2 27 | radius: 4 28 | color: control.enabled ? Qt.rgba(0,0,0,0.3) : Qt.rgba(0.2,0.2,0.2,0.3) 29 | border.color: control.enabled ? Qt.rgba(0.5,0.5,0.5,0.5) : Qt.rgba(0.3,0.3,0.3,0.5) 30 | } 31 | } -------------------------------------------------------------------------------- /GlosSIConfig/qml/InfoDialog.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import QtQuick 6.2 17 | import QtQuick.Controls 6.2 18 | import QtQuick.Controls.Material 6.2 19 | import QtQuick.Dialogs 6.2 20 | 21 | Dialog { 22 | id: dlg 23 | anchors.centerIn: parent 24 | 25 | property var confirmedParam: null 26 | signal confirmed(var param) 27 | signal confirmedExtra(var param) 28 | property alias buttonText: okbutton.text 29 | 30 | visible: false 31 | modal: true 32 | dim: true 33 | parent: Overlay.overlay 34 | Overlay.modal: Rectangle { 35 | color: Qt.rgba(0,0,0,0.4) 36 | opacity: backdropOpacity 37 | Behavior on opacity { 38 | NumberAnimation { 39 | duration: 300 40 | } 41 | } 42 | } 43 | property real backdropOpacity: 1.0 44 | 45 | property alias titleText: title.text 46 | property alias text: text.text 47 | 48 | property bool extraButton: false 49 | property alias extraButtonText: extrabutton.text 50 | property var confirmedExtraParam: null 51 | 52 | enter: Transition { 53 | NumberAnimation{target: content; property: "y"; from: parent.height; to: 16; duration: 300; easing.type: Easing.OutQuad } 54 | NumberAnimation{target: background; property: "y"; from: parent.height; to: 0; duration: 300; easing.type: Easing.OutQuad } 55 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 0; to: 1; duration: 300; easing.type: Easing.OutQuad } 56 | } 57 | 58 | exit: Transition { 59 | NumberAnimation{target: content; property: "y"; from: 16; to: parent.height; duration: 300; easing.type: Easing.InQuad } 60 | NumberAnimation{target: background; property: "y"; from: 0; to: parent.height; duration: 300; easing.type: Easing.InQuad } 61 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 1; to: 0; duration: 300; easing.type: Easing.InQuad } 62 | } 63 | 64 | background: RPane { 65 | id: background 66 | radius: 4 67 | Material.elevation: 64 68 | bgOpacity: 0.97 69 | } 70 | contentItem: Item { 71 | id: content 72 | readonly property real spacing: 16 73 | implicitWidth: Math.max(row.width, col.width) 74 | implicitHeight: title.height + row.height + spacing + col.height 75 | Label { 76 | id: title 77 | anchors.top: parent.top 78 | anchors.left: parent.left 79 | text: dlg.title 80 | font.bold: true 81 | } 82 | Column { 83 | id: col 84 | anchors.top: title.bottom 85 | anchors.topMargin: parent.spacing 86 | spacing: 16 87 | height: text.height + spacing 88 | Label { 89 | id: text 90 | } 91 | } 92 | Row { 93 | id: row 94 | anchors.top: col.bottom 95 | anchors.topMargin: parent.spacing 96 | spacing: 16 97 | height: okbutton.height + spacing + parent.spacing 98 | Button { 99 | id: extrabutton 100 | visible: extraButton 101 | onClicked: function(){ 102 | close() 103 | confirmedExtra(confirmedExtraParam) 104 | } 105 | } 106 | 107 | Button { 108 | id: okbutton 109 | text: qsTr("OK") 110 | onClicked: function(){ 111 | close() 112 | confirmed(confirmedParam) 113 | } 114 | } 115 | anchors.right: parent.right 116 | } 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /GlosSIConfig/qml/RPane.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import QtQuick 2.9 17 | import QtQuick.Controls 2.9 18 | import QtQuick.Controls.Material 2.9 19 | import QtQuick.Controls.Material.impl 2.9 20 | 21 | Pane { 22 | id: control 23 | property int radius: 0 24 | property color color: control.Material.backgroundColor 25 | property real bgOpacity: 1 26 | property string bgImgSource: null 27 | property real bgImgOpacity: -1 28 | background: Rectangle { 29 | color: parent.color 30 | opacity: parent.bgOpacity 31 | radius: control.Material.elevation > 0 ? control.radius : 0 32 | 33 | layer.enabled: control.enabled && control.Material.elevation > 0 34 | layer.effect: ElevationEffect { 35 | elevation: control.Material.elevation 36 | } 37 | Image { 38 | id: bgImage 39 | anchors.top: parent.top 40 | anchors.left: parent.left 41 | anchors.right: parent.right 42 | anchors.bottom: parent.bottom 43 | source: bgImgSource ? bgImgSource : "qrc:/noise.png" 44 | fillMode: bgImgSource ? Image.PreserveAspectCrop : Image.Tile 45 | opacity: bgImgOpacity < 0 ? 0.035 : bgImgOpacity 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /GlosSIConfig/qml/SteamInputXboxDisabledDialog.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import QtQuick 6.2 17 | import QtQuick.Controls 6.2 18 | import QtQuick.Layouts 6.2 19 | import QtQuick.Controls.Material 6.2 20 | 21 | Dialog { 22 | id: dlg 23 | anchors.centerIn: parent 24 | 25 | signal confirmed(var param) 26 | 27 | visible: false 28 | modal: true 29 | dim: true 30 | parent: Overlay.overlay 31 | Overlay.modal: Rectangle { 32 | color: Qt.rgba(0,0,0,0.4) 33 | opacity: backdropOpacity 34 | Behavior on opacity { 35 | NumberAnimation { 36 | duration: 300 37 | } 38 | } 39 | } 40 | property real backdropOpacity: 1.0 41 | 42 | enter: Transition { 43 | NumberAnimation{target: content; property: "y"; from: parent.height; to: 16; duration: 300; easing.type: Easing.OutQuad } 44 | NumberAnimation{target: background; property: "y"; from: parent.height; to: 0; duration: 300; easing.type: Easing.OutQuad } 45 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 0; to: 1; duration: 300; easing.type: Easing.OutQuad } 46 | } 47 | 48 | exit: Transition { 49 | NumberAnimation{target: content; property: "y"; from: 16; to: parent.height; duration: 300; easing.type: Easing.InQuad } 50 | NumberAnimation{target: background; property: "y"; from: 0; to: parent.height; duration: 300; easing.type: Easing.InQuad } 51 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 1; to: 0; duration: 300; easing.type: Easing.InQuad } 52 | } 53 | 54 | background: RPane { 55 | id: background 56 | radius: 4 57 | Material.elevation: 64 58 | bgOpacity: 0.97 59 | } 60 | 61 | contentItem: Item { 62 | id: content 63 | clip: true 64 | Column { 65 | spacing: 4 66 | bottomPadding: 96 67 | Label { 68 | id: titlelabel 69 | text: qsTr("Steam Input Xbox support disabled") 70 | font.pixelSize: 24 71 | font.bold: true 72 | } 73 | Item { 74 | height: 32 75 | } 76 | Label { 77 | text: qsTr("Please enable \"Xbox configuration support\" in Steams controller settings.\n\nGlosSI cannot function properly with this setting disabled\n\nEnable now?") 78 | wrapMode: Text.WordWrap 79 | width: parent.width 80 | } 81 | Row { 82 | anchors.right: parent.right 83 | anchors.topMargin: 16 84 | anchors.rightMargin: 2 85 | spacing: 8 86 | Button { 87 | id: noBtn 88 | text: qsTr("No") 89 | onClicked: dlg.close() 90 | } 91 | Button { 92 | id: yesBtn 93 | text: qsTr("Yes") 94 | onClicked: function() { 95 | uiModel.enableSteamInputXboxSupport(); 96 | dlg.close(); 97 | steamChangedDialog2.open(); 98 | } 99 | } 100 | } 101 | } 102 | InfoDialog { 103 | id: steamChangedDialog2 104 | titleText: qsTr("Steam config changed!") 105 | text: qsTr("Please restart Steam to reload your changes!") 106 | onConfirmed: function (callback) { 107 | callback(); 108 | } 109 | } 110 | } 111 | } -------------------------------------------------------------------------------- /GlosSIConfig/qml/SteamNotFoundDialog.qml: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import QtQuick 17 | import QtQuick.Layouts 18 | import QtQuick.Controls 19 | import QtQuick.Controls.Material 20 | import QtQuick.Dialogs 21 | import Qt5Compat.GraphicalEffects 22 | 23 | Dialog { 24 | id: dlg 25 | anchors.centerIn: parent 26 | 27 | signal confirmed(var param) 28 | 29 | visible: false 30 | modal: true 31 | dim: true 32 | parent: Overlay.overlay 33 | Overlay.modal: Rectangle { 34 | color: Qt.rgba(0,0,0,0.4) 35 | opacity: backdropOpacity 36 | Behavior on opacity { 37 | NumberAnimation { 38 | duration: 300 39 | } 40 | } 41 | } 42 | property real backdropOpacity: 1.0 43 | 44 | enter: Transition { 45 | NumberAnimation{target: content; property: "y"; from: parent.height; to: 16; duration: 300; easing.type: Easing.OutQuad } 46 | NumberAnimation{target: background; property: "y"; from: parent.height; to: 0; duration: 300; easing.type: Easing.OutQuad } 47 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 0; to: 1; duration: 300; easing.type: Easing.OutQuad } 48 | } 49 | 50 | exit: Transition { 51 | NumberAnimation{target: content; property: "y"; from: 16; to: parent.height; duration: 300; easing.type: Easing.InQuad } 52 | NumberAnimation{target: background; property: "y"; from: 0; to: parent.height; duration: 300; easing.type: Easing.InQuad } 53 | NumberAnimation{target: dlg; property: "backdropOpacity"; from: 1; to: 0; duration: 300; easing.type: Easing.InQuad } 54 | } 55 | 56 | background: RPane { 57 | id: background 58 | radius: 4 59 | Material.elevation: 64 60 | bgOpacity: 0.97 61 | } 62 | 63 | contentItem: Item { 64 | id: content 65 | clip: true 66 | Column { 67 | spacing: 4 68 | bottomPadding: 24 69 | Label { 70 | id: titlelabel 71 | text: qsTr("Could not detect Steam") 72 | font.pixelSize: 24 73 | font.bold: true 74 | } 75 | Item { 76 | height: 24 77 | } 78 | Label { 79 | text: qsTr("Please make sure that Steam is running and you are logged in.") 80 | wrapMode: Text.WordWrap 81 | width: parent.width 82 | } 83 | 84 | Button { 85 | text: qsTr("Ok") 86 | onClicked: dlg.close() 87 | } 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /GlosSIConfig/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Resource.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /GlosSIConfig/steamscreener.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/GlosSIConfig/steamscreener.png -------------------------------------------------------------------------------- /GlosSIConfig/svg/add_photo_alternate_white_24dp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GlosSIConfig/svg/delete_white_24dp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GlosSIConfig/svg/edit_white_24dp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GlosSIConfig/svg/expand_more_white_24dp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GlosSIConfig/svg/help_outline_white_24dp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GlosSIConfig/svg/settings_fill_white_24dp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GlosSIConfig/svg/steam.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GlosSITarget/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | UseTab: false 3 | IndentWidth: 4 4 | BreakBeforeBraces: "Stroustrup" 5 | AllowShortIfStatementsOnASingleLine: false 6 | IndentCaseLabels: false 7 | ColumnLimit: 0 8 | PointerAlignment: "Left" 9 | SortIncludes: false -------------------------------------------------------------------------------- /GlosSITarget/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${workspaceFolder}/../deps/SFML/include", 8 | "${workspaceFolder}/../deps/WinReg", 9 | "${workspaceFolder}/../deps/spdlog/include", 10 | "${workspaceFolder}/../deps/ValveFileVDF", 11 | "${workspaceFolder}/../deps/subhook", 12 | "${workspaceFolder}/../deps/ViGEmClient/include", 13 | "${workspaceFolder}/../deps/imgui", 14 | "${workspaceFolder}/../deps/imgui-sfml", 15 | "${workspaceFolder}/../deps/json/include", 16 | "${workspaceFolder}/../deps/traypp/tray/include", 17 | "${workspaceFolder}/../deps/cpp-httplib", 18 | "${workspaceFolder}/../CEFInjectLib" 19 | ], 20 | "defines": [ 21 | "_DEBUG", 22 | "UNICODE", 23 | "_UNICODE", 24 | "SPDLOG_WCHAR_TO_UTF8_SUPPORT", 25 | "SPDLOG_WCHAR_FILENAMES", 26 | "_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING", 27 | "SUBHOOK_STATIC" 28 | ], 29 | "windowsSdkVersion": "10.0.18362.0", 30 | "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe", 31 | "cStandard": "c11", 32 | "cppStandard": "c++20", 33 | "intelliSenseMode": "msvc-x64" 34 | } 35 | ], 36 | "version": 4 37 | } -------------------------------------------------------------------------------- /GlosSITarget/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch GlosSITarget", 9 | "type": "cppvsdbg", 10 | "request": "launch", 11 | "program": "${workspaceFolder}/../x64/Debug/GlosSITarget.exe", 12 | "preLaunchTask": "Build GlosSITarget (Debug)", 13 | "args": [ 14 | "-window" 15 | ], 16 | "stopAtEntry": false, 17 | "cwd": "${workspaceFolder}/../x64/Debug", 18 | "environment": [], 19 | "externalConsole": false, 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /GlosSITarget/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "shell", 6 | "label": "Build GlosSITarget (Debug)", 7 | "command": "msbuild.exe", 8 | "args": [ 9 | "GlosSI.sln", 10 | "/target:GlosSITarget", 11 | "/p:Configuration=Debug", 12 | "/p:Platform=x64" 13 | ], 14 | "options": { 15 | "cwd": "${workspaceFolder}/..", 16 | 17 | }, 18 | "problemMatcher": ["$msCompile"], 19 | "group": { 20 | "kind": "build", 21 | }, 22 | }, 23 | { 24 | "type": "shell", 25 | "label": "Re-Build GlosSITarget (Debug)", 26 | "command": "msbuild.exe", 27 | "args": [ 28 | "GlosSI.sln", 29 | "/target:GlosSITarget:Rebuild", 30 | "/p:Configuration=Debug", 31 | "/p:Platform=x64" 32 | ], 33 | "options": { 34 | "cwd": "${workspaceFolder}/..", 35 | 36 | }, 37 | "problemMatcher": ["$msCompile"], 38 | "group": { 39 | "kind": "build", 40 | }, 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /GlosSITarget/AppLauncher.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #ifdef _WIN32 19 | #define NOMINMAX 20 | #define WIN32_LEAN_AND_MEAN 21 | #include 22 | #endif 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | class AppLauncher { 31 | public: 32 | explicit AppLauncher( 33 | std::vector& process_hwnds, 34 | std::function shutdown = []() {}); 35 | 36 | void launchApp(const std::wstring& path, const std::wstring& args = L""); 37 | void update(); 38 | void close(); 39 | 40 | std::vector launchedPids(); 41 | void addPids(const std::vector& pids); 42 | 43 | private: 44 | std::function shutdown_; 45 | sf::Clock process_check_clock_; 46 | std::mutex pid_mutex_; 47 | 48 | #ifdef _WIN32 49 | static bool IsProcessRunning(DWORD pid); 50 | void getChildPids(DWORD parent_pid); 51 | void getProcessHwnds(); 52 | std::vector& process_hwnds_; 53 | 54 | bool has_extra_launchers_ = false; 55 | bool launcher_has_launched_game_ = false; 56 | bool findLauncherPids(); 57 | 58 | 59 | std::wstring launched_uwp_path_; 60 | 61 | static void UnPatchValveHooks(); 62 | void launchWin32App(const std::wstring& path, const std::wstring& args = L"", bool watchdog = false); 63 | void launchUWPApp(LPCWSTR package_full_name, const std::wstring& args = L""); 64 | void launchURL(const std::wstring& url, const std::wstring& args = L"", const std::wstring& verb = L"open"); 65 | STARTUPINFO info{sizeof(info)}; 66 | PROCESS_INFORMATION process_info{}; 67 | std::vector pids_; 68 | #endif 69 | }; 70 | -------------------------------------------------------------------------------- /GlosSITarget/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.7.2) 2 | 3 | project( 4 | GlosSITarget 5 | VERSION 1.0 6 | LANGUAGES CXX) 7 | 8 | set(CMAKE_CXX_STANDARD 20) 9 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 10 | set(CMAKE_CXX_EXTENSIONS OFF) 11 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) 12 | 13 | 14 | add_executable(${PROJECT_NAME} 15 | main.cpp 16 | SteamTarget.cpp 17 | TargetWindow.cpp 18 | ) 19 | 20 | target_include_directories(${PROJECT_NAME} PRIVATE ../deps/SFML/include) 21 | if (CMAKE_BUILD_TYPE EQUAL "DEBUG") 22 | target_link_directories(${PROJECT_NAME} PRIVATE ../deps/SFML/out/Debug/lib) 23 | target_link_libraries( ${PROJECT_NAME} PRIVATE 24 | sfml-system-d 25 | sfml-window-d 26 | sfml-graphics-d 27 | ) 28 | else() 29 | target_link_directories(${PROJECT_NAME} PRIVATE ../deps/SFML/out/Release/lib) 30 | target_link_libraries( ${PROJECT_NAME} PRIVATE 31 | sfml-system 32 | sfml-window 33 | sfml-graphics 34 | ) 35 | endif() -------------------------------------------------------------------------------- /GlosSITarget/CommonHttpEndpoints.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "HttpServer.h" 3 | #include "../common/Settings.h" 4 | #include "../common/steam_util.h" 5 | 6 | namespace CHTE { 7 | 8 | inline void addEndpoints() 9 | { 10 | 11 | HttpServer::AddEndpoint( 12 | {"/running", 13 | HttpServer::Method::GET, 14 | [](const httplib::Request& req, httplib::Response& res) { 15 | // TODO: extend this when "passive" running of global mods is implemented 16 | res.set_content(nlohmann::json{{"state", nlohmann::json{{"running", true}}}}.dump(), "text/json"); 17 | }}); 18 | 19 | HttpServer::AddEndpoint( 20 | {"/settings", 21 | HttpServer::Method::GET, 22 | [](const httplib::Request& req, httplib::Response& res) { 23 | res.set_content(Settings::toJson().dump(), "text/json"); 24 | }, 25 | "json"}); 26 | 27 | HttpServer::AddEndpoint( 28 | {"/steam_settings", 29 | HttpServer::Method::GET, 30 | [](const httplib::Request& req, httplib::Response& res) { 31 | res.set_content(util::steam::getSteamConfig().dump(4), "text/json"); 32 | }, 33 | "json"}); 34 | 35 | HttpServer::AddEndpoint({ 36 | "/log", 37 | HttpServer::Method::POST, 38 | [](const httplib::Request& req, httplib::Response& res) { 39 | struct LogEntry { 40 | std::string level; 41 | std::string message; 42 | }; 43 | auto entry = LogEntry{}; 44 | try { 45 | const nlohmann::json postbody = nlohmann::json::parse(req.body); 46 | entry.level = postbody.at("level"); 47 | entry.message = postbody.at("message"); 48 | } 49 | catch (std::exception& e) { 50 | res.status = 401; 51 | res.set_content(nlohmann::json{ 52 | {"code", 401}, 53 | {"name", "Bad Request"}, 54 | {"message", e.what()}, 55 | } 56 | .dump(), 57 | "text/json"); 58 | } 59 | if (entry.level == "info") { 60 | spdlog::info("GlosSITweaks: {}", entry.message); 61 | } 62 | else if (entry.level == "warn") { 63 | spdlog::warn("GlosSITweaks: {}", entry.message); 64 | } 65 | else if (entry.level == "error") { 66 | spdlog::error("GlosSITweaks: {}", entry.message); 67 | } 68 | else if (entry.level == "debug") { 69 | spdlog::debug("GlosSITweaks: {}", entry.message); 70 | } 71 | else { 72 | spdlog::trace("GlosSITweaks: {}", entry.message); 73 | } 74 | }, 75 | 76 | }); 77 | 78 | }; 79 | 80 | } // namespace CHTE 81 | -------------------------------------------------------------------------------- /GlosSITarget/DllInjector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "../common/util.h" 6 | 7 | namespace DllInjector { 8 | 9 | inline bool TakeDebugPrivilege() 10 | { 11 | HANDLE process = GetCurrentProcess(), token; 12 | TOKEN_PRIVILEGES priv; 13 | LUID luid = {NULL}; 14 | 15 | if (!OpenProcessToken(process, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) { 16 | CloseHandle(process); 17 | spdlog::error("Failed to open process token"); 18 | return false; 19 | } 20 | LookupPrivilegeValue(0, SE_DEBUG_NAME, &luid); 21 | 22 | priv.PrivilegeCount = 1; 23 | priv.Privileges[0].Luid = luid; 24 | priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 25 | if (!AdjustTokenPrivileges(token, false, &priv, sizeof(priv), NULL, NULL)) { 26 | spdlog::error("Failed to take debug privilege token"); 27 | } 28 | 29 | CloseHandle(token); 30 | CloseHandle(process); 31 | return true; 32 | } 33 | 34 | inline bool Inject(DWORD pid, const std::wstring& lib_path) 35 | { 36 | HANDLE process = NULL, alloc_address = NULL, remote_thread = NULL; 37 | LPTHREAD_START_ROUTINE thread_routine = NULL; 38 | 39 | size_t path_size = (lib_path.length() + 1) * sizeof(wchar_t); 40 | 41 | process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION | PROCESS_VM_WRITE, false, pid); 42 | 43 | if (!process) { 44 | spdlog::error("Failed to open process"); 45 | return false; 46 | } 47 | 48 | alloc_address = VirtualAllocEx(process, NULL, path_size, MEM_COMMIT, PAGE_READWRITE); 49 | 50 | if (!VirtualAllocEx(process, NULL, path_size, MEM_COMMIT, PAGE_READWRITE)) { 51 | spdlog::error("Failed to allocate memory in target process"); 52 | CloseHandle(process); 53 | return false; 54 | } 55 | 56 | if (!WriteProcessMemory(process, (LPVOID)alloc_address, lib_path.c_str(), path_size, NULL)) { 57 | spdlog::error("Failed to write memory in target process"); 58 | VirtualFreeEx(process, alloc_address, path_size, MEM_DECOMMIT); 59 | CloseHandle(process); 60 | return false; 61 | } 62 | 63 | thread_routine = reinterpret_cast(GetProcAddress(GetModuleHandle(L"Kernel32"), "LoadLibraryW")); 64 | if (!thread_routine) { 65 | spdlog::error("Failed to get address of LoadLibraryW"); 66 | VirtualFreeEx(process, alloc_address, path_size, MEM_DECOMMIT); 67 | CloseHandle(process); 68 | return false; 69 | } 70 | 71 | remote_thread = CreateRemoteThread(process, NULL, 0, thread_routine, alloc_address, 0, NULL); 72 | 73 | if (!remote_thread) { 74 | spdlog::error("Failed to create remote thread"); 75 | VirtualFreeEx(process, alloc_address, path_size, MEM_DECOMMIT); 76 | CloseHandle(process); 77 | return false; 78 | } 79 | 80 | WaitForSingleObject(remote_thread, INFINITE); 81 | 82 | CloseHandle(remote_thread); 83 | VirtualFreeEx(process, alloc_address, path_size, MEM_DECOMMIT); 84 | CloseHandle(process); 85 | spdlog::debug("Successfully injected"); 86 | return true; 87 | } 88 | 89 | inline bool findModule(DWORD pid, std::wstring& lib_path, HMODULE& hMod) 90 | { 91 | MODULEENTRY32W entry = {sizeof(entry)}; 92 | HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid); 93 | 94 | if (Module32FirstW(snapshot, &entry) == TRUE) { 95 | while (Module32NextW(snapshot, &entry) == TRUE) { 96 | std::wstring ModuleName(entry.szModule); 97 | std::wstring ExePath(entry.szExePath); 98 | if (ModuleName == lib_path || ExePath == lib_path) { 99 | hMod = (HMODULE)entry.modBaseAddr; 100 | CloseHandle(snapshot); 101 | return true; 102 | } 103 | } 104 | } 105 | CloseHandle(snapshot); 106 | spdlog::error(L"Failed to find module \"{}\"", lib_path); 107 | return false; 108 | } 109 | 110 | inline void injectDllInto(std::filesystem::path dllPath, const std::wstring& processName) 111 | { 112 | if (std::filesystem::exists(dllPath)) { 113 | const auto explorer_pid = util::win::process::PidByName(processName); 114 | if (explorer_pid != 0) { 115 | if (DllInjector::TakeDebugPrivilege()) { 116 | // No need to eject, as the dll is self-ejecting. 117 | if (DllInjector::Inject(explorer_pid, dllPath.wstring())) { 118 | spdlog::info(L"Successfully injected {} into {}", dllPath.filename().wstring(), processName); 119 | } 120 | } 121 | } 122 | else { 123 | spdlog::error(L"{} not found", processName); // needs loglevel WTF 124 | } 125 | } 126 | else { 127 | spdlog::error(L"{} not found", dllPath.wstring()); 128 | } 129 | } 130 | 131 | }; // namespace DllInjector 132 | -------------------------------------------------------------------------------- /GlosSITarget/HttpServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | class AppLauncher; 23 | 24 | class HttpServer { 25 | 26 | public: 27 | explicit HttpServer(std::function close); 28 | 29 | // C++ enums suck. 30 | enum Method { 31 | GET, 32 | POST, 33 | PUT, 34 | PATCH, 35 | }; 36 | // but im not in the mood of adding yet another dependency for just that shit here. 37 | static std::string ToString(Method m); 38 | 39 | struct Endpoint { 40 | std::string path; 41 | Method method; 42 | std::function handler; 43 | nlohmann::json response_hint = nullptr; 44 | nlohmann::json payload_hint = nullptr; 45 | }; 46 | 47 | static void AddEndpoint(const Endpoint&& e); 48 | 49 | void run(); 50 | void stop(); 51 | 52 | 53 | private: 54 | httplib::Server server_; 55 | std::thread server_thread_; 56 | uint16_t port_ = 8756; 57 | 58 | std::function close_; 59 | 60 | static inline std::vector endpoints_; 61 | 62 | }; -------------------------------------------------------------------------------- /GlosSITarget/InputRedirector.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | #ifdef _WIN32 19 | #define NOMINMAX 20 | #define WIN32_LEAN_AND_MEAN 21 | #include 22 | #include 23 | #include 24 | #include 25 | #endif 26 | 27 | class InputRedirector { 28 | public: 29 | InputRedirector(); 30 | ~InputRedirector(); 31 | 32 | void run(); 33 | void stop(); 34 | 35 | private: 36 | void runLoop(); 37 | 38 | int max_controllers_ = -1; 39 | static constexpr int start_delay_ms_ = 2000; 40 | bool run_ = false; 41 | int overlay_elem_id_ = -1; 42 | #ifdef _WIN32 43 | PVIGEM_CLIENT driver_; 44 | 45 | // variables for overlay element; run in different thread 46 | static inline std::atomic enable_rumble_ = true; 47 | static inline std::atomic controller_settings_changed_ = false; 48 | 49 | bool vigem_connected_; 50 | 51 | PVIGEM_TARGET vt_pad_[XUSER_MAX_COUNT]{}; 52 | static void CALLBACK x360ControllerCallback(PVIGEM_CLIENT client, PVIGEM_TARGET Target, UCHAR LargeMotor, UCHAR SmallMotor, UCHAR LedNumber, LPVOID UserData); 53 | void unplugVigemPad(int idx); 54 | 55 | static void CALLBACK ds4ControllerCallback(PVIGEM_CLIENT client, PVIGEM_TARGET Target, UCHAR LargeMotor, UCHAR SmallMotor, DS4_LIGHTBAR_COLOR LightbarColor, LPVOID UserData); 56 | 57 | #endif 58 | 59 | std::thread controller_thread_; 60 | }; 61 | -------------------------------------------------------------------------------- /GlosSITarget/Overlay.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | #include 19 | #include 20 | 21 | #define IMGUI_USER_CONFIG "imconfig.h" 22 | #include "imgui-SFML.h" 23 | #include "imgui.h" 24 | 25 | #include 26 | 27 | #include 28 | 29 | class Overlay { 30 | public: 31 | Overlay(sf::RenderWindow& window, std::function on_close, std::function trigger_state_change, bool force_enable = false); 32 | 33 | void setEnabled(bool enabled); 34 | bool isEnabled() const; 35 | bool toggle(); 36 | void update(); 37 | static void ProcessEvent(sf::Event evnt); 38 | static void Shutdown(); 39 | static void AddLog(const spdlog::details::log_msg& msg); 40 | 41 | static int AddOverlayElem(const std::function& elem_fn, bool force_show_ = false); 42 | static void RemoveOverlayElem(int id); 43 | 44 | private: 45 | sf::RenderWindow& window_; 46 | sf::Clock update_clock_; 47 | bool enabled_ = true; 48 | std::function on_close_; 49 | std::function trigger_state_change_; 50 | void showLogs(ImGuiID dockspace_id); 51 | bool closeOverlayButton() const; 52 | [[nodiscard]] bool closeButton() const; 53 | void showSplash(uint8_t alpha = 128); 54 | bool force_enable_ = false; 55 | bool log_expanded_ = true; 56 | sf::Clock time_since_start_clock_; 57 | 58 | sf::Texture logo_texture_; 59 | sf::Sprite logo_sprite_; 60 | 61 | struct Log { 62 | std::chrono::system_clock::time_point time; 63 | spdlog::level::level_enum level; 64 | std::string payload; 65 | }; 66 | static inline std::vector LOG_MSGS_; 67 | static constexpr int LOG_RETENTION_TIME_ = 5; 68 | static constexpr int HIDE_NORMAL_LOGS_AFTER_S = 20; 69 | static constexpr int SPLASH_DURATION_S_ = 3; 70 | 71 | static inline int overlay_element_id_ = 0; 72 | static inline std::map> OVERLAY_ELEMS_; 73 | 74 | static inline std::map> FORCED_OVERLAY_ELEMS_; 75 | 76 | #ifdef _WIN32 77 | std::string config_file_name_; 78 | #endif 79 | }; 80 | -------------------------------------------------------------------------------- /GlosSITarget/OverlayLogSink.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Overlay.h" 5 | 6 | 7 | namespace spdlog { 8 | namespace sinks { 9 | 10 | template 11 | class overlay_sink : public spdlog::sinks::base_sink { 12 | public: 13 | overlay_sink() = default; 14 | 15 | protected: 16 | void sink_it_(const spdlog::details::log_msg& msg) override 17 | { 18 | Overlay::AddLog(msg); 19 | } 20 | 21 | void flush_() override 22 | { 23 | // Do nothing because statement executed in sink_it_(). 24 | } 25 | 26 | void set_pattern_(const std::string& pattern) override 27 | { 28 | // Don't format log message. 29 | } 30 | 31 | void set_formatter_(std::unique_ptr sink_formatter) override 32 | { 33 | // Don't format log message. 34 | } 35 | }; 36 | 37 | using overlay_sink_mt = overlay_sink; 38 | 39 | } // namespace sinks 40 | } // namespace spdlog -------------------------------------------------------------------------------- /GlosSITarget/ProcessPriority.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "imgui.h" 6 | #include "Overlay.h" 7 | 8 | namespace ProcessPriority { 9 | 10 | static int current_priority = HIGH_PRIORITY_CLASS; 11 | 12 | inline void init() 13 | { 14 | SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); 15 | spdlog::trace("Set process priority to HIGH_PRIORITY_CLASS"); 16 | 17 | Overlay::AddOverlayElem([](bool window_has_focus, ImGuiID dockspace_id) { 18 | ImGui::SetNextWindowDockID(dockspace_id, ImGuiCond_FirstUseEver); 19 | ImGui::Begin("Process Priority"); 20 | ImGui::Text("Might help with input-lag or bad game performance"); 21 | if (ImGui::RadioButton("Realtime", current_priority == REALTIME_PRIORITY_CLASS)) { 22 | SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); 23 | current_priority = REALTIME_PRIORITY_CLASS; 24 | spdlog::trace("Set process priority to REALTIME_PRIORITY_CLASS"); 25 | } 26 | if (ImGui::RadioButton("High", current_priority == HIGH_PRIORITY_CLASS)) { 27 | SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); 28 | current_priority = HIGH_PRIORITY_CLASS; 29 | spdlog::trace("Set process priority to HIGH_PRIORITY_CLASS"); 30 | } 31 | if (ImGui::RadioButton("Above Normal", current_priority == ABOVE_NORMAL_PRIORITY_CLASS)) { 32 | SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS); 33 | current_priority = ABOVE_NORMAL_PRIORITY_CLASS; 34 | spdlog::trace("Set process priority to ABOVE_NORMAL_PRIORITY_CLASS"); 35 | } 36 | if (ImGui::RadioButton("Normal", current_priority == NORMAL_PRIORITY_CLASS)) { 37 | SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); 38 | current_priority = NORMAL_PRIORITY_CLASS; 39 | spdlog::trace("Set process priority to NORMAL_PRIORITY_CLASS"); 40 | } 41 | if (ImGui::RadioButton("Below Normal", current_priority == BELOW_NORMAL_PRIORITY_CLASS)) { 42 | SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS); 43 | current_priority = BELOW_NORMAL_PRIORITY_CLASS; 44 | spdlog::trace("Set process priority to BELOW_NORMAL_PRIORITY_CLASS"); 45 | } 46 | if (ImGui::RadioButton("Low", current_priority == IDLE_PRIORITY_CLASS)) { 47 | SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); 48 | current_priority = IDLE_PRIORITY_CLASS; 49 | spdlog::trace("Set process priority to IDLE_PRIORITY_CLASS"); 50 | } 51 | ImGui::End(); 52 | }); 53 | } 54 | 55 | } // namespace ProcessPriority 56 | -------------------------------------------------------------------------------- /GlosSITarget/Resource.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | 53 | VS_VERSION_INFO VERSIONINFO 54 | FILEVERSION 0,1,2,0073004510400 55 | PRODUCTVERSION 0,1,2,0073004510400 56 | FILEFLAGSMASK 0x3fL 57 | #ifdef _DEBUG 58 | FILEFLAGS 0x1L 59 | #else 60 | FILEFLAGS 0x0L 61 | #endif 62 | FILEOS 0x40004L 63 | FILETYPE 0x1L 64 | FILESUBTYPE 0x0L 65 | BEGIN 66 | BLOCK "StringFileInfo" 67 | BEGIN 68 | BLOCK "000904b0" 69 | BEGIN 70 | VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" 71 | VALUE "FileDescription", "GlosSI - SteamTarget" 72 | VALUE "FileVersion", "0.1.2.0-73-g451c4f0" 73 | VALUE "InternalName", "GlosSITarget" 74 | VALUE "LegalCopyright", "Copyright (C) 2021-2022 Peter Repukat - FlatspotSoftware" 75 | VALUE "OriginalFilename", "GlosSITarget.exe" 76 | VALUE "ProductName", "GlosSI" 77 | VALUE "ProductVersion", "0.1.2.0-73-g451c4f0" 78 | END 79 | END 80 | BLOCK "VarFileInfo" 81 | BEGIN 82 | VALUE "Translation", 0x9, 1200 83 | END 84 | END 85 | 86 | 87 | ///////////////////////////////////////////////////////////////////////////// 88 | // 89 | // Icon 90 | // 91 | 92 | // Icon with lowest ID value placed first to ensure application icon 93 | // remains consistent on all systems. 94 | IDI_ICON1 ICON "..\\GlosSI_Icon.ico" 95 | 96 | #endif // English (United States) resources 97 | ///////////////////////////////////////////////////////////////////////////// 98 | 99 | 100 | 101 | #ifndef APSTUDIO_INVOKED 102 | ///////////////////////////////////////////////////////////////////////////// 103 | // 104 | // Generated from the TEXTINCLUDE 3 resource. 105 | // 106 | 107 | 108 | ///////////////////////////////////////////////////////////////////////////// 109 | #endif // not APSTUDIO_INVOKED 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /GlosSITarget/SteamOverlayDetector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #include "SteamOverlayDetector.h" 17 | 18 | #include 19 | 20 | #include "..\common\Settings.h" 21 | 22 | #ifdef _WIN32 23 | #define NOMINMAX 24 | #include 25 | #endif 26 | 27 | SteamOverlayDetector::SteamOverlayDetector(std::function overlay_changed) 28 | : overlay_changed_(std::move(overlay_changed)) 29 | { 30 | } 31 | 32 | void SteamOverlayDetector::update() 33 | { 34 | #ifdef _WIN32 35 | // Steam hooks into Windows messages 36 | // as long as the overlay is open, every msg (except for input messages?) 37 | // get's the message field set to `0` 38 | // to detect the overlay, just exploit this. 39 | // if the message is 0 3 frames consecutively -> overlay is open 40 | // not -> closed 41 | // 42 | // i'm guessing something very similar is done on linux 43 | // however 44 | // reversing on linux SUUUUUUUCKS! 45 | MSG msg; 46 | // okey to use nullptr as hwnd. get EVERY message 47 | if (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) { 48 | // filter out some messages as not all get altered by steam... 49 | 50 | if (Settings::common.extendedLogging && msg.message != 512 && msg.message != 5374) { 51 | spdlog::trace("PeekMessage: Window msg: {}", msg.message); 52 | } 53 | 54 | if (msg.message < 1000 && msg.message > 0) { 55 | return; 56 | } 57 | if (msg.message == 0 && !overlay_open_) { 58 | msg_count_++; 59 | if (msg_count_ >= 3) { 60 | msg_count_ = 0; 61 | overlay_open_ = true; 62 | spdlog::debug("Overlay opened"); 63 | overlay_changed_(overlay_open_); 64 | } 65 | } 66 | if (msg.message != 0 && overlay_open_) { 67 | msg_count_++; 68 | if (msg_count_ >= 3) { 69 | msg_count_ = 0; 70 | overlay_open_ = false; 71 | spdlog::debug("Overlay closed"); 72 | overlay_changed_(overlay_open_); 73 | } 74 | } 75 | } 76 | #endif 77 | } 78 | 79 | bool SteamOverlayDetector::IsSteamInjected() 80 | { 81 | #ifdef _WIN32 82 | return GetModuleHandle(L"GameOverlayRenderer64.dll") != nullptr; 83 | #endif 84 | } 85 | -------------------------------------------------------------------------------- /GlosSITarget/SteamOverlayDetector.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | #include 19 | 20 | #ifdef _WIN32 21 | #define NOMINMAX 22 | #include 23 | #endif 24 | 25 | class SteamOverlayDetector { 26 | public: 27 | explicit SteamOverlayDetector( 28 | std::function overlay_changed = [](bool) {}); 29 | void update(); 30 | static bool IsSteamInjected(); 31 | 32 | private: 33 | std::function overlay_changed_; 34 | #ifdef _WIN32 35 | bool overlay_open_ = false; 36 | int msg_count_ = 0; 37 | #endif 38 | }; 39 | -------------------------------------------------------------------------------- /GlosSITarget/SteamTarget.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #define WIN32_LEAN_AND_MEAN 18 | 19 | #include "SteamOverlayDetector.h" 20 | 21 | #include "TargetWindow.h" 22 | 23 | #ifdef _WIN32 24 | #include "../common/HidHide.h" 25 | #include "InputRedirector.h" 26 | #include 27 | #endif 28 | 29 | #include 30 | 31 | #include "AppLauncher.h" 32 | #include "CEFInject.h" 33 | #include "Overlay.h" 34 | #include "HttpServer.h" 35 | 36 | #include "../common/steam_util.h" 37 | 38 | namespace Tray { 39 | class Tray; 40 | } 41 | class SteamTarget { 42 | public: 43 | explicit SteamTarget(); 44 | int run(); 45 | 46 | private: 47 | void onOverlayChanged(bool overlay_open); 48 | void toggleGlossiOverlay(); 49 | void focusWindow(WindowHandle hndl); 50 | 51 | std::filesystem::path steam_path_ = util::steam::getSteamPath(); 52 | std::wstring steam_user_id_ = util::steam::getSteamUserId(); 53 | 54 | CEFInject::SteamTweaks steam_tweaks_; 55 | bool cef_tweaks_enabled_ = true; 56 | bool steam_overlay_present_ = false; 57 | bool fully_initialized_ = false; 58 | bool can_fully_initialize_ = true; 59 | void init_FuckingRenameMe(); 60 | 61 | // Keep controllerConfig even is window is switched. 62 | // On Windoze hooking "GetForeGroundWindow" is enough; 63 | void keepControllerConfig(bool keep); 64 | 65 | #ifdef _WIN32 66 | static HWND keepFgWindowHookFn(); 67 | static inline subhook::Hook getFgWinHook; 68 | static inline std::vector force_config_hwnds_ = {}; 69 | static inline HWND last_real_hwnd_ = nullptr; 70 | #endif 71 | 72 | std::unique_ptr createTrayMenu(); 73 | 74 | /* 75 | * Run once per frame 76 | * detects steam configured overlay hotkey, and simulates key presses to window 77 | * 78 | * actually opens the overlay, even if window is not currently focused. 79 | */ 80 | void overlayHotkeyWorkaround(); 81 | 82 | bool run_ = false; 83 | std::vector overlay_hotkey_ = util::steam::getOverlayHotkey(steam_path_, steam_user_id_); 84 | 85 | #ifdef _WIN32 86 | HidHide hidhide_; 87 | InputRedirector input_redirector_; 88 | #endif 89 | TargetWindow window_; 90 | std::weak_ptr overlay_; 91 | SteamOverlayDetector detector_; 92 | AppLauncher launcher_; 93 | HttpServer server_; 94 | WindowHandle last_foreground_window_ = nullptr; 95 | static inline WindowHandle target_window_handle_ = nullptr; 96 | 97 | sf::Clock overlay_trigger_clock_; 98 | float overlay_trigger_max_seconds_ = 2.5; 99 | bool overlay_trigger_flag_ = false; 100 | 101 | bool delayed_shutdown_ = false; 102 | sf::Clock delay_shutdown_clock_; 103 | }; 104 | -------------------------------------------------------------------------------- /GlosSITarget/TargetWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #include "Overlay.h" 18 | 19 | #include 20 | 21 | #include 22 | 23 | // Redfine window handle, should impl. change 24 | #ifdef _WIN32 25 | #include 26 | using WindowHandle = HWND; 27 | #else 28 | using WindowHandle = int; // ??? 29 | #endif 30 | 31 | class TargetWindow { 32 | public: 33 | explicit TargetWindow( 34 | std::function on_close = []() {}, 35 | std::function toggle_overlay_state = []() {}, 36 | std::vector screenshot_hotkey = {"KEY_F12"}, 37 | std::function on_window_changed = []() {} 38 | ); 39 | 40 | void setFpsLimit(unsigned int fps_limit); 41 | void setClickThrough(bool click_through); 42 | void setTransparent(bool transparent) const; 43 | void update(); 44 | void close(); 45 | 46 | std::shared_ptr getOverlay() const; 47 | 48 | /* 49 | * Run once per frame 50 | * - detects steam configured screenshot hotkey 51 | * - takes actual screenshot 52 | * - renders it to window 53 | * - simulates screenshot keys 54 | * - Wait a few millis... 55 | * (- steam takes screenshot) 56 | * - return to normal 57 | * 58 | */ 59 | void screenShotWorkaround(); 60 | 61 | WindowHandle getSystemHandle() const; 62 | 63 | #ifdef _WIN32 64 | static WORD GetWindowDPI(HWND hWnd); 65 | #endif 66 | 67 | private: 68 | const std::function on_close_; 69 | const std::function toggle_overlay_state_; 70 | sf::RenderWindow window_; 71 | std::vector screenshot_keys_; 72 | const std::function on_window_changed_; 73 | 74 | sf::VideoMode old_desktop_mode_; 75 | sf::Clock check_resolution_clock_; 76 | static constexpr int RES_CHECK_SECONDS = 1; 77 | 78 | unsigned int screen_refresh_rate_ = 0; 79 | 80 | 81 | std::shared_ptr overlay_; 82 | 83 | static unsigned int calcAutoRefreshRate(unsigned int rate); 84 | void createWindow(); 85 | 86 | bool toggle_window_mode_after_frame_ = false; 87 | bool toggle_hidealttab_after_frame_ = false; 88 | }; 89 | -------------------------------------------------------------------------------- /GlosSITarget/UWPOverlayEnabler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "DllInjector.h" 7 | #include "Overlay.h" 8 | 9 | namespace UWPOverlayEnabler { 10 | 11 | namespace internal { 12 | 13 | inline std::filesystem::path EnablerPath() 14 | { 15 | wchar_t buff[MAX_PATH]; 16 | GetModuleFileName(GetModuleHandle(NULL), buff, MAX_PATH); 17 | const std::wstring path(buff); 18 | return path.substr(0, 1 + path.find_last_of(L'\\')) + L"UWPOverlayEnablerDLL.dll"; 19 | } 20 | 21 | 22 | } // namespace internal 23 | 24 | inline void EnableUwpOverlay() 25 | { 26 | const auto enabler_path = internal::EnablerPath(); 27 | DllInjector::injectDllInto(enabler_path, L"explorer.exe"); 28 | } 29 | 30 | inline void AddUwpOverlayOvWidget() 31 | { 32 | Overlay::AddOverlayElem([](bool window_has_focus, ImGuiID dockspace_id) { 33 | ImGui::SetNextWindowDockID(dockspace_id, ImGuiCond_FirstUseEver); 34 | ImGui::Begin("UWP-Overlay"); 35 | ImGui::Text("To enable the overlay on top of \"fullscreen\" UWP-Apps,"); 36 | ImGui::Text("a .dll has to be injected into explorer.exe"); 37 | ImGui::Spacing(); 38 | ImGui::Text("This method uses undocumented windows functions"); 39 | ImGui::Text("and might cause issues."); 40 | ImGui::Spacing(); 41 | if (ImGui::Button("Enable")) { 42 | EnableUwpOverlay(); 43 | } 44 | ImGui::Text("If the overlay isn't working right away:"); 45 | ImGui::Text("try opening Windows start menu, as this triggers the hook"); 46 | ImGui::End(); 47 | }); 48 | } 49 | 50 | } // namespace UWPOverlayEnabler -------------------------------------------------------------------------------- /GlosSITarget/imconfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "imgui-SFML_export.h" 7 | 8 | #define IM_VEC2_CLASS_EXTRA \ 9 | template \ 10 | ImVec2(const sf::Vector2& v) \ 11 | { \ 12 | x = static_cast(v.x); \ 13 | y = static_cast(v.y); \ 14 | } \ 15 | \ 16 | template \ 17 | operator sf::Vector2() const \ 18 | { \ 19 | return sf::Vector2(x, y); \ 20 | } 21 | 22 | #define IM_VEC4_CLASS_EXTRA \ 23 | ImVec4(const sf::Color& c) : x(c.r / 255.f), y(c.g / 255.f), z(c.b / 255.f), w(c.a / 255.f) {} \ 24 | operator sf::Color() const \ 25 | { \ 26 | return sf::Color(static_cast(x * 255.f), static_cast(y * 255.f), \ 27 | static_cast(z * 255.f), static_cast(w * 255.f)); \ 28 | } 29 | 30 | #define ImTextureID unsigned int 31 | -------------------------------------------------------------------------------- /GlosSITarget/imgui.ini: -------------------------------------------------------------------------------- 1 | [Window][Debug##Default] 2 | Pos=60,60 3 | Size=400,400 4 | Collapsed=0 5 | 6 | [Window][Log] 7 | Pos=80,65 8 | Size=583,843 9 | Collapsed=0 10 | 11 | [Window][##CloseButton] 12 | Pos=2503,-24 13 | Size=80,56 14 | Collapsed=0 15 | 16 | [Window][Hidden Devices] 17 | Pos=751,66 18 | Size=664,751 19 | Collapsed=0 20 | 21 | [Window][Dear ImGui Demo] 22 | Pos=1531,148 23 | Size=550,680 24 | Collapsed=0 25 | 26 | [Window][Dear ImGui Style Editor] 27 | Pos=1022,358 28 | Size=339,902 29 | Collapsed=0 30 | 31 | [Window][Example: Log] 32 | Pos=397,318 33 | Size=785,402 34 | Collapsed=0 35 | 36 | [Window][About Dear ImGui] 37 | Pos=975,520 38 | Size=570,442 39 | Collapsed=0 40 | 41 | -------------------------------------------------------------------------------- /GlosSITarget/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Resource.rc 4 | // 5 | #define IDI_ICON1 105 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 106 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /GlosSITarget/steam_sf_keymap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | #include 19 | 20 | #define QQ(x) #x 21 | #define QUOTE(x) QQ(x) 22 | 23 | #define KEYCONVSF(KEY) \ 24 | { \ 25 | QUOTE(KEY), sf::Keyboard::Key::KEY \ 26 | } 27 | 28 | namespace keymap { 29 | static std::unordered_map sfkey = { 30 | {"Shift", sf::Keyboard::Key::LShift}, 31 | {"Alt", sf::Keyboard::Key::LAlt}, 32 | {"Ctrl", sf::Keyboard::Key::LControl}, 33 | {"Del", sf::Keyboard::Key::Delete}, 34 | {"Ins", sf::Keyboard::Key::Insert}, 35 | {"Home", sf::Keyboard::Key::Home}, 36 | {"Space", sf::Keyboard::Key::Space}, 37 | {"Backspace", sf::Keyboard::Key::Backspace}, 38 | {"Enter", sf::Keyboard::Key::Enter}, 39 | {"KEY_TAB", sf::Keyboard::Key::Tab}, 40 | // TODO: more special keys with keylayout mapping... nope.. 41 | {"KEY_0", sf::Keyboard::Key::Num0}, 42 | {"KEY_1", sf::Keyboard::Key::Num1}, 43 | {"KEY_2", sf::Keyboard::Key::Num2}, 44 | {"KEY_3", sf::Keyboard::Key::Num3}, 45 | {"KEY_4", sf::Keyboard::Key::Num4}, 46 | {"KEY_5", sf::Keyboard::Key::Num5}, 47 | {"KEY_6", sf::Keyboard::Key::Num6}, 48 | {"KEY_7", sf::Keyboard::Key::Num7}, 49 | {"KEY_8", sf::Keyboard::Key::Num8}, 50 | {"KEY_9", sf::Keyboard::Key::Num9}, 51 | KEYCONVSF(A), 52 | KEYCONVSF(B), 53 | KEYCONVSF(C), 54 | KEYCONVSF(D), 55 | KEYCONVSF(E), 56 | KEYCONVSF(F), 57 | KEYCONVSF(G), 58 | KEYCONVSF(H), 59 | KEYCONVSF(I), 60 | KEYCONVSF(J), 61 | KEYCONVSF(K), 62 | KEYCONVSF(L), 63 | KEYCONVSF(M), 64 | KEYCONVSF(N), 65 | KEYCONVSF(O), 66 | KEYCONVSF(P), 67 | KEYCONVSF(Q), 68 | KEYCONVSF(R), 69 | KEYCONVSF(S), 70 | KEYCONVSF(T), 71 | KEYCONVSF(U), 72 | KEYCONVSF(V), 73 | KEYCONVSF(W), 74 | KEYCONVSF(X), 75 | KEYCONVSF(Y), 76 | KEYCONVSF(Z), 77 | {"KEY_F1", sf::Keyboard::Key::F1}, 78 | {"KEY_F2", sf::Keyboard::Key::F2}, 79 | {"KEY_F3", sf::Keyboard::Key::F3}, 80 | {"KEY_F4", sf::Keyboard::Key::F4}, 81 | {"KEY_F5", sf::Keyboard::Key::F5}, 82 | {"KEY_F6", sf::Keyboard::Key::F6}, 83 | {"KEY_F7", sf::Keyboard::Key::F7}, 84 | {"KEY_F8", sf::Keyboard::Key::F8}, 85 | {"KEY_F9", sf::Keyboard::Key::F9}, 86 | {"KEY_F10", sf::Keyboard::Key::F10}, 87 | {"KEY_F11", sf::Keyboard::Key::F11}, 88 | {"KEY_F12", sf::Keyboard::Key::F12}}; 89 | 90 | #ifdef _WIN32 91 | #define NOMINMAX 92 | #include 93 | //yep.. there are smarter ways to tho this... 94 | static std::unordered_map winkey = { 95 | {"Shift", VK_SHIFT}, 96 | {"Alt", VK_MENU}, 97 | {"Ctrl", VK_CONTROL}, 98 | {"Del", VK_DELETE}, 99 | {"Ins", VK_INSERT}, 100 | {"Home", VK_HOME}, 101 | {"Space", VK_SPACE}, 102 | {"Backspace", VK_BACK}, 103 | {"Enter", VK_RETURN}, 104 | {"KEY_TAB", VK_TAB}, 105 | // TODO: more special keys with keylayout mapping... nope.. 106 | {"KEY_0", 0x30}, 107 | {"KEY_1", 0x31}, 108 | {"KEY_2", 0x32}, 109 | {"KEY_3", 0x33}, 110 | {"KEY_4", 0x34}, 111 | {"KEY_5", 0x35}, 112 | {"KEY_6", 0x36}, 113 | {"KEY_7", 0x37}, 114 | {"KEY_8", 0x38}, 115 | {"KEY_9", 0x39}, 116 | {"KEY_A", 0x41}, 117 | {"KEY_B", 0x42}, 118 | {"KEY_C", 0x43}, 119 | {"KEY_D", 0x44}, 120 | {"KEY_E", 0x45}, 121 | {"KEY_F", 0x46}, 122 | {"KEY_G", 0x47}, 123 | {"KEY_H", 0x48}, 124 | {"KEY_I", 0x49}, 125 | {"KEY_J", 0x4A}, 126 | {"KEY_K", 0x4B}, 127 | {"KEY_L", 0x4C}, 128 | {"KEY_M", 0x4D}, 129 | {"KEY_N", 0x4E}, 130 | {"KEY_O", 0x5F}, 131 | {"KEY_P", 0x50}, 132 | {"KEY_Q", 0x51}, 133 | {"KEY_R", 0x52}, 134 | {"KEY_S", 0x53}, 135 | {"KEY_T", 0x54}, 136 | {"KEY_U", 0x55}, 137 | {"KEY_V", 0x56}, 138 | {"KEY_W", 0x57}, 139 | {"KEY_X", 0x58}, 140 | {"KEY_Y", 0x59}, 141 | {"KEY_Z", 0x5A}, 142 | {"KEY_F1", VK_F1}, 143 | {"KEY_F2", VK_F2}, 144 | {"KEY_F3", VK_F3}, 145 | {"KEY_F4", VK_F4}, 146 | {"KEY_F5", VK_F5}, 147 | {"KEY_F6", VK_F6}, 148 | {"KEY_F7", VK_F7}, 149 | {"KEY_F8", VK_F8}, 150 | {"KEY_F9", VK_F9}, 151 | {"KEY_F10", VK_F10}, 152 | {"KEY_F11", VK_F11}, 153 | {"KEY_F12", VK_F12}}; 154 | #endif 155 | } // namespace keymap 156 | -------------------------------------------------------------------------------- /GlosSIWatchdog/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "shell", 6 | "label": "Build GlosSIWatchdog (Debug)", 7 | "command": "msbuild.exe", 8 | "args": [ 9 | "GlosSI.sln", 10 | "/target:GlosSIWatchdog", 11 | "/p:Configuration=Debug", 12 | "/p:Platform=x64" 13 | ], 14 | "options": { 15 | "cwd": "${workspaceFolder}/..", 16 | }, 17 | "problemMatcher": ["$msCompile"], 18 | "group": { 19 | "kind": "build", 20 | }, 21 | }, 22 | { 23 | "type": "shell", 24 | "label": "Re-Build GlosSIWatchdog (Debug)", 25 | "command": "msbuild.exe", 26 | "args": [ 27 | "GlosSI.sln", 28 | "/target:GlosSIWatchdog:Rebuild", 29 | "/p:Configuration=Debug", 30 | "/p:Platform=x64" 31 | ], 32 | "options": { 33 | "cwd": "${workspaceFolder}/..", 34 | }, 35 | "problemMatcher": ["$msCompile"], 36 | "group": { 37 | "kind": "build", 38 | }, 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /GlosSIWatchdog/GlosSIWatchdog.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | 53 | VS_VERSION_INFO VERSIONINFO 54 | FILEVERSION 1,0,0,1 55 | PRODUCTVERSION 1,0,0,1 56 | FILEFLAGSMASK 0x3fL 57 | #ifdef _DEBUG 58 | FILEFLAGS 0x1L 59 | #else 60 | FILEFLAGS 0x0L 61 | #endif 62 | FILEOS 0x40004L 63 | FILETYPE 0x1L 64 | FILESUBTYPE 0x0L 65 | BEGIN 66 | BLOCK "StringFileInfo" 67 | BEGIN 68 | BLOCK "040704b0" 69 | BEGIN 70 | VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" 71 | VALUE "FileDescription", "GlosSI - SteamTarget Watchdog" 72 | VALUE "FileVersion", "1.0.0.1" 73 | VALUE "InternalName", "GlosSIWatchdog" 74 | VALUE "LegalCopyright", "Copyright (C) 2021-2022 Peter Repukat - FlatspotSoftware" 75 | VALUE "OriginalFilename", "GlosSIWatchdog.exe" 76 | VALUE "ProductName", "GlosSI" 77 | VALUE "ProductVersion", "1.0.0.1" 78 | END 79 | END 80 | BLOCK "VarFileInfo" 81 | BEGIN 82 | VALUE "Translation", 0x407, 1200 83 | END 84 | END 85 | 86 | #endif // English (United States) resources 87 | ///////////////////////////////////////////////////////////////////////////// 88 | 89 | 90 | 91 | #ifndef APSTUDIO_INVOKED 92 | ///////////////////////////////////////////////////////////////////////////// 93 | // 94 | // Generated from the TEXTINCLUDE 3 resource. 95 | // 96 | 97 | 98 | ///////////////////////////////////////////////////////////////////////////// 99 | #endif // not APSTUDIO_INVOKED 100 | 101 | -------------------------------------------------------------------------------- /GlosSIWatchdog/GlosSIWatchdog.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Header Files 31 | 32 | 33 | 34 | 35 | Resource Files 36 | 37 | 38 | -------------------------------------------------------------------------------- /GlosSIWatchdog/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by GlosSIWatchdog.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /GlosSI_Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/GlosSI_Icon.ico -------------------------------------------------------------------------------- /GlosSI_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/GlosSI_Logo.png -------------------------------------------------------------------------------- /GlosSI_Logo_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/GlosSI_Logo_512.png -------------------------------------------------------------------------------- /Installer/buildInstaller.ps1: -------------------------------------------------------------------------------- 1 | $env:Path += ';C:\Program Files (x86)\NSIS\Bin' 2 | 3 | makensis.exe Installer.nsi -------------------------------------------------------------------------------- /QT_License: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/QT_License -------------------------------------------------------------------------------- /SteamTweaks/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | tsconfig.tsbuildinfo 4 | .rollup.tscache/ -------------------------------------------------------------------------------- /SteamTweaks/.nvmrc: -------------------------------------------------------------------------------- 1 | 19 -------------------------------------------------------------------------------- /SteamTweaks/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Attach to Steam CEF", 5 | "port": 8080, 6 | "request": "attach", 7 | "type": "chrome", 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /SteamTweaks/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "glossi_steamtweaks", 3 | "version": "0.0.0", 4 | "type": "module", 5 | "scripts": { 6 | "clean": "npx rimraf dist .rollup.tscache tsconfig.tsbuildinfo ", 7 | "build": "npx rollup -c rollup.config.js", 8 | "build:clean": "npm run clean && npm run build", 9 | "build:copy": "npx rimraf ../x64/Debug/SteamTweaks && npm run build && cd dist && npx copyfiles -a -V ./**/* ../../x64/Debug/SteamTweaks" 10 | }, 11 | "author": "Peter Repukat - FlatspotSoftware", 12 | "license": "Apache-2.0", 13 | "devDependencies": { 14 | "@rollup/plugin-typescript": "^11.0.0", 15 | "@typescript-eslint/eslint-plugin": "^5.49.0", 16 | "@typescript-eslint/parser": "^5.49.0", 17 | "copyfiles": "^2.4.1", 18 | "eslint": "^8.33.0", 19 | "eslint-plugin-import": "^2.27.5", 20 | "eslint-plugin-no-null": "^1.0.2", 21 | "eslint-plugin-prefer-arrow": "^1.2.3", 22 | "rollup": "^3.12.0", 23 | "typescript": "^4.9.4", 24 | "rimraf": "^4.1.2" 25 | }, 26 | "dependencies": { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SteamTweaks/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from '@rollup/plugin-typescript'; 2 | import { readdirSync, lstatSync } from 'fs'; 3 | import path from 'path'; 4 | 5 | const getFileListForDir = (dir) => { 6 | return readdirSync(dir).map((file) => { 7 | const absolute = path.resolve(dir, file); 8 | if (file.endsWith('.ts')) { 9 | return absolute; 10 | } 11 | if (lstatSync(absolute).isDirectory()) { 12 | return getFileListForDir(absolute) 13 | } 14 | }).flat(999); 15 | 16 | } 17 | 18 | 19 | const tsPluginConf = typescript({ 20 | cacheDir: '.rollup.tscache' 21 | }); 22 | 23 | export default [ 24 | { 25 | input: 'src/GlosSITweaks.ts', 26 | output: { 27 | dir: 'dist', 28 | sourcemap: "inline", 29 | format: 'iife', 30 | // name: 'GlosSITweaks' // don't use name; don't pollute global namespace 31 | }, 32 | plugins: [tsPluginConf], 33 | }, 34 | ...getFileListForDir('src/Tweaks').map((file) => { 35 | return { 36 | input: file, 37 | output: { 38 | file: file.replace('src', 'dist').replace(/\.ts$/, '.js'), 39 | sourcemap: "inline", 40 | format: 'iife', 41 | // name: path.basename(file).replace(/\.ts$/, '') // don't use name; don't pollute global namespace 42 | }, 43 | plugins: [tsPluginConf], 44 | } 45 | }) 46 | ]; -------------------------------------------------------------------------------- /SteamTweaks/src/@types/GlosSISettings.d.ts: -------------------------------------------------------------------------------- 1 | export interface GlosSISettings { 2 | controller: { 3 | allowDesktopConfig: boolean; 4 | emulateDS4: boolean; 5 | maxControllers: number; 6 | }; 7 | devices: { 8 | hideDevices: boolean; 9 | realDeviceIds: boolean; 10 | }; 11 | extendedLogging: boolean; 12 | globalModeGameId: string; 13 | globalModeUseGamepadUI: boolean; 14 | icon?: string; 15 | ignoreEGS: boolean; 16 | killEGS: boolean; 17 | launch: { 18 | closeOnExit: boolean; 19 | ignoreLauncher: boolean; 20 | killLauncher: boolean; 21 | launch: boolean; 22 | launchAppArgs?: string; 23 | launchPath?: string; 24 | launcherProcesses: string[]; 25 | waitForChildProcs: boolean; 26 | }; 27 | name?: string; 28 | snapshotNotify: boolean; 29 | standaloneModeGameId: string; 30 | standaloneUseGamepadUI: boolean; 31 | minimizeSteamGamepadUI: boolean; 32 | steamPath: string; 33 | steamUserId: string; 34 | steamgridApiKey: string; 35 | version: number; 36 | window: { 37 | disableGlosSIOverlay: boolean; 38 | disableOverlay: boolean; 39 | hideAltTab: boolean; 40 | maxFps?: number; 41 | scale?: number; 42 | windowMode: boolean; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /SteamTweaks/src/@types/SteamClient.d.ts: -------------------------------------------------------------------------------- 1 | export interface SteamClient { 2 | Settings: { 3 | // Current stable (As time of commit); Beta does not have this anymore... 4 | SetInGameOverlayShowFPSCorner?: (value: 0|1|2|3|4) => void; 5 | SetInGameOverlayShowFPSContrast?: (value: boolean) => void; 6 | // TODO: find a way to change setting on beta (and soon stable...) 7 | }; 8 | UI: { 9 | GetUiMode: () => Promise; 10 | SetUiMode: (mode: SteamUiMode) => void; 11 | }; 12 | Window: { 13 | Minimize(); 14 | HideWindow(); 15 | }; 16 | } 17 | 18 | export type FullSteamClient = Required; 19 | 20 | declare global { 21 | interface Window { 22 | SteamClient: SteamClient; 23 | } 24 | // eslint-disable-next-line 25 | declare const SteamClient: SteamClient; 26 | } 27 | -------------------------------------------------------------------------------- /SteamTweaks/src/Tweaks/GamepadUI/MinimizeSteamGamepadUI.ts: -------------------------------------------------------------------------------- 1 | import { initTweak } from '../../common/tweakApi'; 2 | 3 | 4 | initTweak('MinimizeSteamGamepadUI', async () => { 5 | 6 | const [isGamepadUI, minimizeGPUI] = await Promise.all([ 7 | // (async () => (await SteamClient.UI.GetUiMode()) === SteamUiMode.GamepadUI)(), 8 | true, // Steam is always GamepadUI if injected into GamepadUI, duh! 9 | (async () => (await GlosSIApi.SteamTarget.getGlosSISettings()).minimizeSteamGamepadUI)() 10 | ]); 11 | if (isGamepadUI && minimizeGPUI) { 12 | SteamClient.Window.Minimize(); 13 | return true; 14 | } 15 | if (!isGamepadUI && minimizeGPUI) { 16 | GlosSIApi.SteamTarget.log('warn', 'MinimizeSteamGamepadUI is enabled but Steam is not in GamepadUI mode'); 17 | } 18 | return false; 19 | }).then((minimized: boolean) => { 20 | GlosSIApi.SteamTarget.log('debug', 'MinimizeSteamGamepadUI installed; Minimized GamepadUI:', minimized); 21 | }).catch((e) =>GlosSIApi.SteamTarget.log('error', 'MinimizeSteamGamepadUI failed to install', e)); 22 | -------------------------------------------------------------------------------- /SteamTweaks/src/Tweaks/Overlay/SharedContext/HideFPSCounter.ts: -------------------------------------------------------------------------------- 1 | import type { SteamConfig } from '../../../common/util/types'; 2 | import { initTweak } from '../../../common/tweakApi'; 3 | 4 | 5 | const backup: { originalFpsCorner?: number } = {}; 6 | initTweak('HideFPSCounter', { 7 | install: async () => { 8 | backup.originalFpsCorner = Number( 9 | ((await GlosSIApi.SteamTarget.getSteamSettings()).system as SteamConfig) 10 | .InGameOverlayShowFPSCorner 11 | ) as 0 | 1 | 2 | 3 | 4; 12 | if (!SteamClient.Settings.SetInGameOverlayShowFPSCorner) { 13 | GlosSIApi.SteamTarget.log('warn', 14 | 'HideFPSCounter: SteamClient.Settings.SetInGameOverlayShowFPSCorner is not available.' 15 | +'Can\'t hide FPS Counter corner.' 16 | ); 17 | } 18 | SteamClient.Settings.SetInGameOverlayShowFPSCorner?.(0); 19 | }, 20 | uninstall: () => { 21 | if (!SteamClient.Settings.SetInGameOverlayShowFPSCorner) { 22 | return; 23 | } 24 | GlosSIApi.SteamTarget.log('debug','uninstalling HideFPSCounter Tweak. Restoring FPS Counter corner: ', backup.originalFpsCorner); 25 | SteamClient.Settings.SetInGameOverlayShowFPSCorner?.((backup.originalFpsCorner ?? 0) as 0 | 1 | 2 | 3 | 4); 26 | setTimeout(() => { 27 | // steam might not actually register the setting?! Try again like 10 seconds later... ¯\_(ツ)_/¯ 28 | SteamClient.Settings.SetInGameOverlayShowFPSCorner?.((backup.originalFpsCorner ?? 0) as 0 | 1 | 2 | 3 | 4); 29 | }, 10 * 1000); 30 | } 31 | }).then(() => { 32 | GlosSIApi.SteamTarget.log('debug', 'HideFPSCounter installed'); 33 | }).catch((e) => GlosSIApi.SteamTarget.log('error', 'HideFPSCounter failed to install', e)); 34 | -------------------------------------------------------------------------------- /SteamTweaks/src/common/Steam.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line no-shadow 2 | export enum SteamUiMode { 3 | Desktop = 0, 4 | Unknown1 = 1, 5 | Unknown2 = 2, 6 | Unknown3 = 3, 7 | GamepadUI = 4, 8 | } 9 | -------------------------------------------------------------------------------- /SteamTweaks/src/common/tweakApi.ts: -------------------------------------------------------------------------------- 1 | 2 | export const initTweak = (name: string, tweakMain: (() => T)|{ 3 | install: () => T; 4 | uninstall: () => void; 5 | }, force = false): T => { 6 | if (!force && window.GlosSITweaks[name]) { 7 | throw new Error(`Tweak ${name} is already installed!`); 8 | } 9 | 10 | if (typeof tweakMain === 'object') { 11 | window.GlosSITweaks[name] = { install: tweakMain.install, uninstall: () => { 12 | try { 13 | tweakMain.uninstall(); 14 | } catch (e) { 15 | GlosSIApi.SteamTarget.log('error', e); 16 | } 17 | delete window.GlosSITweaks[name]; 18 | } }; 19 | } else { 20 | window.GlosSITweaks[name] = { install: tweakMain }; 21 | } 22 | try { 23 | return window.GlosSITweaks[name].install() as T; 24 | } catch (e) { 25 | GlosSIApi.SteamTarget.log('error', e); 26 | throw e; 27 | } 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /SteamTweaks/src/common/util/types.d.ts: -------------------------------------------------------------------------------- 1 | export interface SteamConfig { 2 | [key: string]: string|SteamConfig; 3 | } 4 | -------------------------------------------------------------------------------- /SteamTweaks/src/common/util/util.ts: -------------------------------------------------------------------------------- 1 | export const fetchWithTimeout = async (input: RequestInfo | URL, init?: RequestInit & { timeout: number }) => { 2 | const { timeout = 8000 } = init || {}; 3 | 4 | const controller = new AbortController(); 5 | const id = setTimeout(() => controller.abort(), timeout); 6 | const response = await fetch(input, { 7 | ...(init ||{}), 8 | signal: controller.signal 9 | }); 10 | clearTimeout(id); 11 | return response; 12 | }; 13 | -------------------------------------------------------------------------------- /SteamTweaks/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "module": "ES2022", 5 | "noImplicitAny": true, 6 | "rootDir": "./src", 7 | "outDir": "./dist", 8 | "inlineSourceMap": true, 9 | "esModuleInterop": true, 10 | "strict": true, 11 | "skipLibCheck": true, 12 | "useDefineForClassFields": true, 13 | "forceConsistentCasingInFileNames": true, 14 | "incremental": true, 15 | "lib": [ 16 | "esnext", 17 | "DOM" 18 | ], 19 | }, 20 | "include": [ 21 | "src/**/*" 22 | ], 23 | "exclude": [ 24 | "node_modules", 25 | ] 26 | } -------------------------------------------------------------------------------- /THIRD_PARTY_LICENSES.txt: -------------------------------------------------------------------------------- 1 | ViGEm Bus Driver 2 | 3 | 4 | BSD 3-Clause License 5 | 6 | Copyright (c) 2016-2020, Nefarius Software Solutions e.U. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright notice, this 13 | list of conditions and the following disclaimer. 14 | 15 | 2. Redistributions in binary form must reproduce the above copyright notice, 16 | this list of conditions and the following disclaimer in the documentation 17 | and/or other materials provided with the distribution. 18 | 19 | 3. Neither the name of the copyright holder nor the names of its 20 | contributors may be used to endorse or promote products derived from 21 | this software without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 27 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | ------------------------------------------------------------------------------- 35 | 36 | ViGEmClient 37 | 38 | 39 | MIT License 40 | 41 | Copyright (c) 2018 Benjamin Höglinger-Stelzer 42 | 43 | Permission is hereby granted, free of charge, to any person obtaining a copy 44 | of this software and associated documentation files (the "Software"), to deal 45 | in the Software without restriction, including without limitation the rights 46 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 47 | copies of the Software, and to permit persons to whom the Software is 48 | furnished to do so, subject to the following conditions: 49 | 50 | The above copyright notice and this permission notice shall be included in all 51 | copies or substantial portions of the Software. 52 | 53 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 54 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 55 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 56 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 57 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 58 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 59 | SOFTWARE. 60 | 61 | ------------------------------------------------------------------------------- 62 | 63 | HidHide 64 | 65 | 66 | MIT License 67 | 68 | Copyright (c) 2020 Eric Korff de Gidts 69 | 70 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 71 | 72 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 73 | 74 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 75 | -------------------------------------------------------------------------------- /UWPOverlayEnablerDLL/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "shell", 6 | "label": "Build UWPOverlayEnablerDLL (Debug)", 7 | "command": "msbuild.exe", 8 | "args": [ 9 | "GlosSI.sln", 10 | "/target:UWPOverlayEnablerDLL", 11 | "/p:Configuration=Debug", 12 | "/p:Platform=x64" 13 | ], 14 | "options": { 15 | "cwd": "${workspaceFolder}/..", 16 | }, 17 | "problemMatcher": ["$msCompile"], 18 | "group": { 19 | "kind": "build", 20 | }, 21 | }, 22 | { 23 | "type": "shell", 24 | "label": "Re-Build UWPOverlayEnablerDLL (Debug)", 25 | "command": "msbuild.exe", 26 | "args": [ 27 | "GlosSI.sln", 28 | "/target:UWPOverlayEnablerDLL:Rebuild", 29 | "/p:Configuration=Debug", 30 | "/p:Platform=x64" 31 | ], 32 | "options": { 33 | "cwd": "${workspaceFolder}/..", 34 | }, 35 | "problemMatcher": ["$msCompile"], 36 | "group": { 37 | "kind": "build", 38 | }, 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /UWPOverlayEnablerDLL/UWPOverlayEnablerDLL.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /ViGEm_BuildConfig.patch: -------------------------------------------------------------------------------- 1 | diff --git forkSrcPrefix/src/ViGEmClient.vcxproj forkDstPrefix/src/ViGEmClient.vcxproj 2 | index 7c186414e62a6334fbcd518d506f55db57491dfe..2955df4d391b37bf0b71e17df8bd161c1014a0c4 100644 3 | --- forkSrcPrefix/src/ViGEmClient.vcxproj 4 | +++ forkDstPrefix/src/ViGEmClient.vcxproj 5 | @@ -49,52 +49,52 @@ 6 | 7 | StaticLibrary 8 | true 9 | - v142 10 | + v143 11 | Unicode 12 | 13 | 14 | DynamicLibrary 15 | true 16 | - v142 17 | + v143 18 | Unicode 19 | 20 | 21 | StaticLibrary 22 | false 23 | - v142 24 | + v143 25 | true 26 | Unicode 27 | 28 | 29 | DynamicLibrary 30 | false 31 | - v142 32 | + v143 33 | true 34 | Unicode 35 | 36 | 37 | StaticLibrary 38 | true 39 | - v142 40 | + v143 41 | Unicode 42 | 43 | 44 | DynamicLibrary 45 | true 46 | - v142 47 | + v143 48 | Unicode 49 | 50 | 51 | StaticLibrary 52 | false 53 | - v142 54 | + v143 55 | true 56 | Unicode 57 | 58 | 59 | DynamicLibrary 60 | false 61 | - v142 62 | + v143 63 | true 64 | Unicode 65 | 66 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | Remove-Item -Recurse -Force "x64\Release" 2 | 3 | .\prebuild.ps1 4 | 5 | $env:_CL_="/MD" 6 | msbuild.exe GlosSI.sln /t:Build /p:Configuration=Release /p:Platform=x64 7 | 8 | cd ./SteamTweaks 9 | npm i 10 | npm run build 11 | cd .. 12 | 13 | cd ./x64/Release/ 14 | 15 | $env:Path += ';C:\Qt\6.3.1\msvc2019_64\bin' 16 | $env:Path += ';C:\Program Files\7-Zip' 17 | 18 | Get-ChildItem -Rec | Where {$_.Extension -match "lib"} | Remove-Item 19 | $env:Path = "$env:QTDIR\bin;$env:Path" 20 | 21 | windeployqt.exe --release --qmldir ../../GlosSIConfig/qml ./GlosSIConfig.exe 22 | 23 | Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-graphics-2.dll" -Destination "." 24 | Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-system-2.dll" -Destination "." 25 | Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-window-2.dll" -Destination "." 26 | Copy-Item "..\..\GlosSIConfig\GetAUMIDs.ps1" -Destination "." 27 | Copy-Item "..\..\HidHideSetup.exe" -Destination "." 28 | Copy-Item "..\..\ViGEmBusSetup_x64.exe" -Destination "." 29 | Copy-Item "..\..\vc_redist.x64.exe" -Destination "." 30 | Copy-Item "..\..\LICENSE" -Destination "./LICENSE" 31 | Copy-Item "..\..\QT_License" -Destination "./QT_License" 32 | Copy-Item "..\..\THIRD_PARTY_LICENSES.txt" -Destination "./THIRD_PARTY_LICENSES.txt" 33 | Copy-Item "..\..\SteamTweaks\dist" -Destination "./SteamTweaks" -Recurse 34 | 35 | 36 | #7z a GlosSI-snapshot.zip * 37 | 38 | cd ../.. 39 | 40 | -------------------------------------------------------------------------------- /buildSFML.ps1: -------------------------------------------------------------------------------- 1 | cd deps/SFML 2 | 3 | if ($env:APPVEYOR -like "") { 4 | cmake.exe -S . -B out/Debug -DCMAKE_BUILD_TYPE=Debug 5 | cmake.exe --build out/Debug --config Debug 6 | } 7 | 8 | $env:_CL_ = "/MDd" 9 | cmake.exe -S . -B out/Release -DCMAKE_BUILD_TYPE=RelWithDebInfo 10 | $env:_CL_ = "/MD" 11 | cmake.exe --build out/Release --config RelWithDebInfo 12 | 13 | cd ../.. -------------------------------------------------------------------------------- /buildSFML.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | cd deps/SFML 5 | 6 | cmake -S . -B out/Debug -DCMAKE_BUILD_TYPE=Debug 7 | cmake --build out/Debug --config Debug 8 | 9 | cmake -S . -B out/Release -DCMAKE_BUILD_TYPE=RelWithDebInfo 10 | cmake --build out/Release --config RelWithDebInfo -------------------------------------------------------------------------------- /buildViGEmClient.ps1: -------------------------------------------------------------------------------- 1 | cd deps/ViGEmClient 2 | 3 | git apply ../../ViGEm_BuildConfig.patch 4 | 5 | $env:_CL_="/MDd" 6 | msbuild.exe ViGEmCLient.sln /t:Build /p:Configuration=Debug_LIB /p:Platform=x64 7 | $env:_CL_="/MD" 8 | msbuild.exe ViGEmCLient.sln /t:Build /p:Configuration=Release_LIB /p:Platform=x64 9 | 10 | cd ../.. -------------------------------------------------------------------------------- /bundle-zip.ps1: -------------------------------------------------------------------------------- 1 | powershell.exe .\download_release_deps.ps1 2 | 3 | cd ./x64/Release/ 4 | 5 | Get-ChildItem -Rec | Where {$_.Extension -match "lib"} | Remove-Item 6 | $env:Path = "$env:QTDIR\bin;$env:Path" 7 | 8 | windeployqt.exe --release --qmldir ../../GlosSIConfig/qml ./GlosSIConfig.exe 9 | 10 | 11 | Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-graphics-2.dll" -Destination "." 12 | Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-system-2.dll" -Destination "." 13 | Copy-Item "..\..\deps\SFML\out\Release\lib\RelWithDebInfo\sfml-window-2.dll" -Destination "." 14 | Copy-Item "..\..\GlosSIConfig\GetAUMIDs.ps1" -Destination "." 15 | Copy-Item "..\..\HidHideSetup.exe" -Destination "." 16 | Copy-Item "..\..\ViGEmBusSetup_x64.exe" -Destination "." 17 | Copy-Item "..\..\vc_redist.x64.exe" -Destination "." 18 | Copy-Item "..\..\LICENSE" -Destination "./LICENSE" 19 | Copy-Item "..\..\QT_License" -Destination "./QT_License" 20 | Copy-Item "..\..\THIRD_PARTY_LICENSES.txt" -Destination "./THIRD_PARTY_LICENSES.txt" 21 | Copy-Item "..\..\steamgrid.exe" -Destination "./steamgrid.exe" 22 | Copy-Item "..\..\SteamTweaks\dist" -Destination "./SteamTweaks" -Recurse 23 | Copy-Item "C:\Qt\Tools\OpenSSL\Win_x64\bin\libcrypto-1_1-x64.dll" -Destination "./libcrypto-1_1-x64.dll" 24 | Copy-Item "C:\Qt\Tools\OpenSSL\Win_x64\bin\libssl-1_1-x64.dll" -Destination "./libssl-1_1-x64.dll" 25 | 26 | 7z a GlosSI-snapshot.zip * -------------------------------------------------------------------------------- /common/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${workspaceFolder}/../deps/SFML/include", 8 | "${workspaceFolder}/../deps/WinReg", 9 | "${workspaceFolder}/../deps/spdlog/include", 10 | "${workspaceFolder}/../deps/ValveFileVDF", 11 | "${workspaceFolder}/../deps/subhook", 12 | "${workspaceFolder}/../deps/ViGEmClient/include", 13 | "${workspaceFolder}/../deps/imgui", 14 | "${workspaceFolder}/../deps/imgui-sfml", 15 | "${workspaceFolder}/../deps/json/include", 16 | "${workspaceFolder}/../deps/traypp/tray/include", 17 | "${workspaceFolder}/../deps/cpp-httplib", 18 | "${workspaceFolder}/../CEFInjectLib" 19 | ], 20 | "defines": [ 21 | "_DEBUG", 22 | "UNICODE", 23 | "_UNICODE" 24 | ], 25 | "windowsSdkVersion": "10.0.18362.0", 26 | "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe", 27 | "cStandard": "c11", 28 | "cppStandard": "c++20", 29 | "intelliSenseMode": "msvc-x64" 30 | } 31 | ], 32 | "version": 4 33 | } -------------------------------------------------------------------------------- /common/UnhookUtil.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #include "../common/UnhookUtil.h" 17 | 18 | #include "util.h" 19 | 20 | #ifndef CONFIGAPP 21 | #define SPDLOG_WCHAR_TO_UTF8_SUPPORT 22 | #define SPDLOG_WCHAR_FILENAMES 23 | #include 24 | 25 | #include "Settings.h" 26 | #endif 27 | 28 | void UnhookUtil::UnPatchHook(const std::string& name, HMODULE module) 29 | { 30 | #ifndef CONFIGAPP 31 | 32 | 33 | std::map original_bytes_from_file; 34 | 35 | auto configDirPath = util::path::getDataDirPath(); 36 | if (std::filesystem::exists(configDirPath)) { 37 | auto unhook_file_path = configDirPath / "unhook_bytes"; 38 | if (std::filesystem::exists(unhook_file_path)) { 39 | 40 | std::ifstream ifile; 41 | ifile.open(unhook_file_path, std::ios::binary | std::ios::in); 42 | if (ifile.is_open()) { 43 | 44 | std::string funcName; 45 | char buff; 46 | do { 47 | if (ifile.eof()) { 48 | break; 49 | } 50 | ifile.read(&buff, sizeof(char)); 51 | if (buff != ':') { 52 | funcName.push_back(buff); 53 | } 54 | else { 55 | char bytes[8]; 56 | ifile.read(bytes, sizeof(char) * 8); 57 | ifile.read(&buff, sizeof(char)); // newline 58 | original_bytes_from_file[funcName] = std::string(bytes, 8); 59 | funcName = ""; 60 | } 61 | } while (!ifile.eof()); 62 | 63 | ifile.close(); 64 | } 65 | } 66 | } 67 | 68 | 69 | 70 | spdlog::trace("Patching \"{}\"...", name); 71 | 72 | BYTE* address = reinterpret_cast(GetProcAddress(module, name.c_str())); 73 | if (!address) { 74 | spdlog::error("failed to unpatch \"{}\"", name); 75 | } 76 | std::string bytes; 77 | 78 | if (original_bytes_from_file.contains(name)) { 79 | bytes = original_bytes_from_file.at(name); 80 | spdlog::trace("Using originalBytes from file for {}", name); 81 | } 82 | else { 83 | if (Settings::isWin10 && UNHOOK_BYTES_ORIGINAL_WIN10.contains(name)) { 84 | bytes = UNHOOK_BYTES_ORIGINAL_WIN10.at(name); 85 | } 86 | else { 87 | bytes = UNHOOK_BYTES_ORIGINAL_22000.at(name); 88 | } 89 | spdlog::trace("Using fallback originalBytes for {}", name); 90 | } 91 | DWORD dw_old_protect, dw_bkup; 92 | const auto len = bytes.size(); 93 | if (!VirtualProtect(address, len, PAGE_EXECUTE_READWRITE, &dw_old_protect)) { // Change permissions of memory.. 94 | spdlog::error("Couldn't change permissions of memory for \"{}\"", name); 95 | return; 96 | } 97 | const auto opcode = *(address); 98 | if (!std::ranges::any_of(JUMP_INSTR_OPCODES, [&opcode](const auto& op) { return op == opcode; })) { 99 | spdlog::debug("\"{}\" Doesn't appear to be hooked, skipping!", name); 100 | } 101 | else { 102 | for (DWORD i = 0; i < len; i++) // unpatch Valve's hook 103 | { 104 | *(address + i) = bytes[i]; 105 | } 106 | spdlog::trace("Unpatched \"{}\"", name); 107 | } 108 | VirtualProtect(address, len, dw_old_protect, &dw_bkup); // Revert permission change... 109 | #endif 110 | } 111 | 112 | std::string UnhookUtil::ReadOriginalBytes(const std::string& name, const std::wstring& moduleName) 113 | { 114 | auto module = LoadLibraryW(moduleName.c_str()); 115 | auto address = reinterpret_cast(GetProcAddress(module, name.c_str())); 116 | std::string res; 117 | res.resize(8); 118 | 119 | for (int i = 0; i < 8; i++) { 120 | res[i] = static_cast(*(address + i)); 121 | } 122 | return res; 123 | } 124 | -------------------------------------------------------------------------------- /common/UnhookUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #define NOMINMAX 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | namespace UnhookUtil { 26 | void UnPatchHook(const std::string& name, HMODULE module); 27 | 28 | std::string ReadOriginalBytes(const std::string& name, const std::wstring& moduleName); 29 | 30 | static inline const std::vector JUMP_INSTR_OPCODES = { 31 | 0xE9, 32 | 0xE8, 33 | 0xEB, 34 | 0xEA, 35 | 0xFF }; 36 | 37 | // Valve Hooks various functions and hides Gaming devices like this. 38 | // To be able to query them, unpatch the hook with the original bytes... 39 | 40 | // Bytes here are just fallbacks; originalbytes will get read from GlosSIConfig and stored in %APPDATA%\GlosSI\unhook_bytes 41 | 42 | // 22000 ^= Windows build number 43 | static inline const std::map UNHOOK_BYTES_ORIGINAL_22000 = { 44 | {"SetupDiEnumDeviceInfo", "\x48\x89\x5C\x24\x08"}, 45 | {"SetupDiGetClassDevsW", "\x48\x89\x5C\x24\x08"}, 46 | {"HidD_GetPreparsedData", "\x48\x89\x5C\x24\x18"}, 47 | {"HidP_GetCaps", "\x4C\x8B\xD1\x48\x85\xC9"}, 48 | {"HidD_GetAttributes", "\x40\x53\x48\x83\xEC"}, 49 | {"HidD_GetProductString", "\x48\x83\xEC\x48\x48"}, 50 | {"HidP_GetUsages", "\x4C\x89\x4C\x24\x20"}, 51 | {"HidP_GetData", "\x4C\x89\x44\x24\x18"}, 52 | {"HidP_GetValueCaps", "\x48\x83\xEC\x48\x49"}, 53 | {"HidP_GetUsageValue", "\x40\x53\x55\x56\x48"}, 54 | {"HidP_GetButtonCaps", "\x48\x83\xEC\x48\x49"}, 55 | // Valve hooks "CreateProcess" to detect child-processes 56 | {"CreateProcessW", "\x4C\x8B\xDC\x48\x83"}, 57 | }; 58 | 59 | // SetupApi.dll is different on Win10 than on Win11 60 | static inline const std::map UNHOOK_BYTES_ORIGINAL_WIN10 = { 61 | {"SetupDiEnumDeviceInfo", "\x40\x53\x56\x57\x41\x54\x41\x55"}, 62 | {"SetupDiGetClassDevsW", "\x48\x8B\xC4\x48\x89\x58\x08"}, 63 | }; 64 | 65 | 66 | } // namespace UnhookUtil 67 | -------------------------------------------------------------------------------- /common/common.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | -------------------------------------------------------------------------------- /common/nlohmann_json_wstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021-2023 Peter Repukat - FlatspotSoftware 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | 20 | #include 21 | 22 | #include "util.h" 23 | 24 | 25 | namespace nlohmann { 26 | template <> 27 | struct adl_serializer { 28 | static void to_json(json& j, const std::wstring& str) { 29 | j = util::string::to_string(str); 30 | } 31 | 32 | static void from_json(const json& j, std::wstring& str) { 33 | str = util::string::to_wstring(j.get()); 34 | } 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /docs/BUILDING.md: -------------------------------------------------------------------------------- 1 | # Building GlosSI 2 | 3 | ## Windows 4 | 5 | Requirements: 6 | 7 | - git 8 | - Visual Studio 2022 (Community edition is fine) 9 | - [Qt 6.X](https://www.qt.io/download-qt-installer) (GlosSIConfig only) 10 | - [Qt Visual Studio addin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022) (GlosSIConfig only) 11 | 12 | In a "Developer Powershell for VS 2022" run: 13 | 14 | ```powershell 15 | git submodule init 16 | git submodule update --recursive 17 | 18 | .\prebuild.ps1 19 | 20 | # Open GlosSI.sln and hit build! 21 | Invoke-Item GlosSI.sln 22 | ``` 23 | 24 | (Note: It can be the case that the first build fails as there are versioning files created when building. Just hit build again and you should be good to go!) 25 | 26 | In addition to the above, you will need to install the required drivers: 27 | `ViGEmBusSetup_x64.exe` and `HidHideMSI.exe` 28 | Both of these can be downloaded from [ViGEm's website](https://vigem.org/Downloads/) or by use of the `download_release_deps.ps1` script. 29 | 30 | --- 31 | 32 | ## Linux 33 | 34 | Linux support is currently not really implemented. 35 | No guarantees that the build will even work. (It's probably broken) 36 | That said, very limited linux support is planned for the future. 37 | No Guarantees that the build works out! 38 | **GlosSITarget:** 39 | 40 | ```shell 41 | git submodule init 42 | git submodule update --recursive 43 | 44 | # build custom fork of SFML 45 | # do not use SFML you might've already installed 46 | ./buildSFML.sh 47 | cd GlosSITarget 48 | cmake -S . -B build 49 | cmake --build build 50 | ``` 51 | 52 | **GlosSIConfig:** 53 | 54 | TODO 55 | -------------------------------------------------------------------------------- /docs/appid_trick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/docs/appid_trick.png -------------------------------------------------------------------------------- /docs/glossi_add_shortcut.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/docs/glossi_add_shortcut.gif -------------------------------------------------------------------------------- /docs/imgui_controls_v6_Xbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/docs/imgui_controls_v6_Xbox.png -------------------------------------------------------------------------------- /docs/overlay_screenie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alia5/GlosSI/917b9efab8be3c029520bf944da41c9be78d97c7/docs/overlay_screenie.png -------------------------------------------------------------------------------- /download_release_deps.ps1: -------------------------------------------------------------------------------- 1 | Invoke-WebRequest -o ViGEmBusSetup_x64.exe https://github.com/nefarius/ViGEmBus/releases/download/v1.22.0/ViGEmBus_1.22.0_x64_x86_arm64.exe 2 | Invoke-WebRequest -o HidHideSetup.exe https://github.com/nefarius/HidHide/releases/download/v1.4.192.0/HidHide_1.4.192_x64.exe 3 | Invoke-WebRequest -o vc_redist.x64.exe https://aka.ms/vs/16/release/vc_redist.x64.exe -------------------------------------------------------------------------------- /glossi.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "common" 5 | }, 6 | { 7 | "path": "CEFInjectLib" 8 | }, 9 | { 10 | "path": "GlosSIConfig" 11 | }, 12 | { 13 | "path": "GlosSITarget" 14 | }, 15 | { 16 | "path": "GlosSIWatchdog" 17 | }, 18 | { 19 | "path": "UWPOverlayEnablerDLL" 20 | }, 21 | { 22 | "path": "Installer" 23 | }, 24 | { 25 | "path": "SteamTweaks" 26 | }, 27 | { 28 | "name": "root", 29 | "path": "." 30 | }, 31 | ], 32 | "settings": { 33 | "files.associations": { 34 | "algorithm": "cpp", 35 | "chrono": "cpp", 36 | "filesystem": "cpp", 37 | "xstring": "cpp", 38 | "xutility": "cpp", 39 | "xhash": "cpp", 40 | "xtree": "cpp", 41 | "map": "cpp", 42 | "any": "cpp", 43 | "array": "cpp", 44 | "atomic": "cpp", 45 | "bit": "cpp", 46 | "cctype": "cpp", 47 | "charconv": "cpp", 48 | "clocale": "cpp", 49 | "cmath": "cpp", 50 | "codecvt": "cpp", 51 | "compare": "cpp", 52 | "concepts": "cpp", 53 | "condition_variable": "cpp", 54 | "coroutine": "cpp", 55 | "csignal": "cpp", 56 | "cstdarg": "cpp", 57 | "cstddef": "cpp", 58 | "cstdint": "cpp", 59 | "cstdio": "cpp", 60 | "cstdlib": "cpp", 61 | "cstring": "cpp", 62 | "ctime": "cpp", 63 | "cwchar": "cpp", 64 | "deque": "cpp", 65 | "exception": "cpp", 66 | "resumable": "cpp", 67 | "format": "cpp", 68 | "forward_list": "cpp", 69 | "fstream": "cpp", 70 | "functional": "cpp", 71 | "future": "cpp", 72 | "initializer_list": "cpp", 73 | "iomanip": "cpp", 74 | "ios": "cpp", 75 | "iosfwd": "cpp", 76 | "iostream": "cpp", 77 | "istream": "cpp", 78 | "iterator": "cpp", 79 | "limits": "cpp", 80 | "list": "cpp", 81 | "locale": "cpp", 82 | "memory": "cpp", 83 | "mutex": "cpp", 84 | "new": "cpp", 85 | "numeric": "cpp", 86 | "optional": "cpp", 87 | "ostream": "cpp", 88 | "queue": "cpp", 89 | "random": "cpp", 90 | "ranges": "cpp", 91 | "ratio": "cpp", 92 | "regex": "cpp", 93 | "set": "cpp", 94 | "span": "cpp", 95 | "sstream": "cpp", 96 | "stack": "cpp", 97 | "stdexcept": "cpp", 98 | "stop_token": "cpp", 99 | "streambuf": "cpp", 100 | "string": "cpp", 101 | "system_error": "cpp", 102 | "thread": "cpp", 103 | "tuple": "cpp", 104 | "type_traits": "cpp", 105 | "typeinfo": "cpp", 106 | "unordered_map": "cpp", 107 | "unordered_set": "cpp", 108 | "utility": "cpp", 109 | "valarray": "cpp", 110 | "variant": "cpp", 111 | "vector": "cpp", 112 | "xfacet": "cpp", 113 | "xiosbase": "cpp", 114 | "xlocale": "cpp", 115 | "xlocbuf": "cpp", 116 | "xlocinfo": "cpp", 117 | "xlocmes": "cpp", 118 | "xlocmon": "cpp", 119 | "xlocnum": "cpp", 120 | "xloctime": "cpp", 121 | "xmemory": "cpp", 122 | "xstddef": "cpp", 123 | "xtr1common": "cpp" 124 | } 125 | // uncomment if not already in user settings and wanting to debug/build c++ code (vs 2022 required!) 126 | // "terminal.integrated.profiles.windows": { 127 | // "Developer PowerShell for VS 2022": { 128 | // "source": "PowerShell", 129 | // "icon": "terminal-powershell", 130 | // "args": [ 131 | // "-c", 132 | // "$vsPath = & '${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe' -property installationpath; Import-Module \"$vsPath/Common7/Tools/Microsoft.VisualStudio.DevShell.dll\"; Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation; powershell.exe" 133 | // ] 134 | // } 135 | // }, 136 | } 137 | } -------------------------------------------------------------------------------- /prebuild.ps1: -------------------------------------------------------------------------------- 1 | git submodule init 2 | git submodule update --recursive --force 3 | 4 | .\buildSFML.ps1 5 | .\buildViGEmClient.ps1 6 | 7 | cd deps/traypp 8 | 9 | git apply ../../traypp_unicode.patch 10 | 11 | cd ../../ 12 | 13 | cd .\GlosSIConfig\ 14 | 15 | ..\version_help.ps1 16 | 17 | $apiKeyText = " 18 | /* Autogenerated version info file */ 19 | #pragma once 20 | 21 | inline const char* steamgridb_key = ""$env:STEAMGRIDDB_KEY""; 22 | " 23 | 24 | if (!(Test-Path 'steamgrid_api_keys.h')) { 25 | New-Item -Path "." -Name "steamgrid_api_keys.h" -ItemType "file" -Value $apiKeyText 26 | } 27 | 28 | cd ../ 29 | 30 | if (!(Test-Path 'steamgrid.exe')) { 31 | Invoke-WebRequest -o steamgrid.zip https://github.com/boppreh/steamgrid/releases/download/v3.4.0/steamgrid_windows.zip 32 | 7z e steamgrid.zip steamgrid.exe 33 | } 34 | -------------------------------------------------------------------------------- /tail_config_logs.ps1: -------------------------------------------------------------------------------- 1 | Get-Content "$env:appdata\GlosSI\glossiconfig.log" -Wait -------------------------------------------------------------------------------- /tail_target_logs.ps1: -------------------------------------------------------------------------------- 1 | Get-Content "$env:appdata\GlosSI\GlosSItarget.log" -Wait -------------------------------------------------------------------------------- /traypp_unicode.patch: -------------------------------------------------------------------------------- 1 | diff --git a/tray/include/core/windows/tray.hpp b/tray/include/core/windows/tray.hpp 2 | index ab5949922b41c519a6632544286811f379f36392..6f658feda1aae2c1770648b3bffc3af201672fe6 100755 3 | --- a/tray/include/core/windows/tray.hpp 4 | +++ b/tray/include/core/windows/tray.hpp 5 | @@ -11,7 +11,7 @@ namespace Tray 6 | { 7 | HWND hwnd = nullptr; 8 | HMENU menu = nullptr; 9 | - WNDCLASSEX windowClass; 10 | + WNDCLASSEXA windowClass; 11 | NOTIFYICONDATA notifyData; 12 | 13 | std::vector> allocations; 14 | diff --git a/tray/src/core/windows/image.cpp b/tray/src/core/windows/image.cpp 15 | index 75a7868350bd1069521345826163eb9275607277..1ecb1de7edaeaff871426238862531dcf4015a76 100755 16 | --- a/tray/src/core/windows/image.cpp 17 | +++ b/tray/src/core/windows/image.cpp 18 | @@ -5,7 +5,7 @@ 19 | Tray::Image::Image(HBITMAP image) : image(image) {} 20 | Tray::Image::Image(const char *path) : Image(std::string(path)) {} 21 | Tray::Image::Image(const std::string &path) 22 | - : image(reinterpret_cast(LoadImage(nullptr, path.c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE))) 23 | + : image(reinterpret_cast(LoadImageA(nullptr, path.c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE))) 24 | { 25 | if (image == nullptr) 26 | { 27 | diff --git a/tray/src/core/windows/tray.cpp b/tray/src/core/windows/tray.cpp 28 | index 38111083207e3e9512f24749360172b995cf2bb0..8d9326b5d700b91c81ba0aef7d8dfcea1c9e19ca 100755 29 | --- a/tray/src/core/windows/tray.cpp 30 | +++ b/tray/src/core/windows/tray.cpp 31 | @@ -23,14 +23,14 @@ Tray::Tray::Tray(std::string identifier, Icon icon) : BaseTray(std::move(identif 32 | windowClass.lpszClassName = this->identifier.c_str(); 33 | windowClass.hInstance = GetModuleHandle(nullptr); 34 | 35 | - if (RegisterClassEx(&windowClass) == 0) 36 | + if (RegisterClassExA(&windowClass) == 0) 37 | { 38 | throw std::runtime_error("Failed to register class"); 39 | } 40 | 41 | // NOLINTNEXTLINE 42 | - hwnd = CreateWindow(this->identifier.c_str(), nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, windowClass.hInstance, 43 | - nullptr); 44 | + hwnd = CreateWindowA(this->identifier.c_str(), nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, windowClass.hInstance, 45 | + nullptr); 46 | if (hwnd == nullptr) 47 | { 48 | throw std::runtime_error("Failed to create window"); 49 | @@ -64,7 +64,7 @@ void Tray::Tray::exit() 50 | DestroyIcon(notifyData.hIcon); 51 | DestroyMenu(menu); 52 | 53 | - UnregisterClass(identifier.c_str(), GetModuleHandle(nullptr)); 54 | + UnregisterClassA(identifier.c_str(), GetModuleHandle(nullptr)); 55 | PostMessage(hwnd, WM_QUIT, 0, 0); 56 | allocations.clear(); 57 | 58 | @@ -97,11 +97,11 @@ HMENU Tray::Tray::construct(const std::vector> &entri 59 | { 60 | auto *item = entry.get(); 61 | 62 | - auto name = std::shared_ptr(new char[item->getText().size() + 1]); 63 | - strcpy(name.get(), item->getText().c_str()); // NOLINT 64 | + auto name = std::make_shared(item->getText().size() + 1); 65 | + strcpy_s(name.get(), item->getText().size() + 1, item->getText().c_str()); // NOLINT 66 | parent->allocations.emplace_back(name); 67 | 68 | - MENUITEMINFO winItem{0}; 69 | + MENUITEMINFOA winItem{0}; 70 | 71 | winItem.wID = ++id; 72 | winItem.dwTypeData = name.get(); 73 | @@ -158,7 +158,7 @@ HMENU Tray::Tray::construct(const std::vector> &entri 74 | } 75 | } 76 | 77 | - InsertMenuItem(menu, id, TRUE, &winItem); 78 | + InsertMenuItemA(menu, id, TRUE, &winItem); 79 | } 80 | 81 | return menu; 82 | -------------------------------------------------------------------------------- /version_appveyor.ps1: -------------------------------------------------------------------------------- 1 | $tag = git describe --tags --always $(git rev-list --all --max-count=1) 2 | if (-Not ($tag -match ".+\..+\..+\..+")) { 3 | $tag = "0.0.0." + $tag 4 | } 5 | Update-AppveyorBuild -Version $tag 6 | -------------------------------------------------------------------------------- /version_help.ps1: -------------------------------------------------------------------------------- 1 | $tag = git describe --tags --always 2 | if (-Not ($tag -match ".+\..+\..+\..+")) { 3 | $tag = "0.0.0." + $tag 4 | } 5 | $commatag = $tag -replace "\.","," 6 | $commatag = $commatag -replace "-","0" 7 | $commatag = $commatag -replace "[A-z]","0" 8 | ((Get-Content -path ./Resource.rc -Raw) -replace "FILEVERSION .*,.*,.*,.*", ("FILEVERSION " + $commatag)) | Set-Content -Path ./Resource.rc 9 | ((Get-Content -path ./Resource.rc -Raw) -replace "PRODUCTVERSION .*,.*,.*,.*", ("PRODUCTVERSION " + $commatag)) | Set-Content -Path ./Resource.rc 10 | ((Get-Content -path ./Resource.rc -Raw) -replace '"FileVersion", ".*"', ('"FileVersion", "' + $tag + '"')) | Set-Content -Path ./Resource.rc 11 | ((Get-Content -path ./Resource.rc -Raw) -replace '"ProductVersion", ".*"', ('"ProductVersion", "' + $tag + '"')) | Set-Content -Path ./Resource.rc 12 | 13 | $cleanTag = git describe --tags --abbrev=0 14 | $versionFileText = " 15 | /* Autogenerated version info file */ 16 | #pragma once 17 | 18 | namespace version { 19 | inline const auto VERSION_STR = ""$tag""; 20 | inline const auto IS_SNAPSHOT = $( If ($tag.Length -gt 10) {'true'} Else {'false'}); 21 | inline const auto VERSION_MAJOR = $($cleanTag.Split('.')[0]); 22 | inline const auto VERSION_MINOR = $($cleanTag.Split('.')[1]); 23 | inline const auto VERSION_PATCH = $($cleanTag.Split('.')[2]); 24 | inline const auto VERSION_REVISION = $($cleanTag.Split('.')[3]); 25 | } 26 | 27 | " 28 | 29 | if (!(Test-Path '../version.hpp')) { 30 | New-Item -Path ".." -Name "version.hpp" -ItemType "file" -Value $versionFileText 31 | } else { 32 | Set-Content -Path "../version.hpp" -Value $versionFileText 33 | } 34 | 35 | 36 | if ((Test-Path '../Installer/Installer.nsi')) { 37 | ((Get-Content -path '../Installer/Installer.nsi' -Raw) -replace '!define VERSION ".*"', ('!define VERSION "' + $tag + '"')) | Set-Content -Path '../Installer/Installer.nsi' 38 | } --------------------------------------------------------------------------------