diff --git a/.gitmodules b/.gitmodules index 673c325..a4c3185 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "deps/json"] path = deps/json url = https://github.com/nlohmann/json +[submodule "deps/traypp"] + path = deps/traypp + url = git@github.com:Soundux/traypp.git diff --git a/GlosSITarget/GlosSITarget.vcxproj b/GlosSITarget/GlosSITarget.vcxproj index 466039f..d15db58 100644 --- a/GlosSITarget/GlosSITarget.vcxproj +++ b/GlosSITarget/GlosSITarget.vcxproj @@ -80,7 +80,7 @@ true - ..\deps\SFML\include;..\deps\WinReg;..\deps\spdlog\include;..\deps\ValveFileVDF;..\deps\subhook;..\deps\ViGEmClient\include;..\deps\imgui;..\deps\imgui-sfml;..\deps\json\include;$(ExternalIncludePath) + ..\deps\SFML\include;..\deps\WinReg;..\deps\spdlog\include;..\deps\ValveFileVDF;..\deps\subhook;..\deps\ViGEmClient\include;..\deps\imgui;..\deps\imgui-sfml;..\deps\json\include;..\deps\traypp\tray\include;$(ExternalIncludePath) ..\deps\SFML\out\Debug\lib\Debug;..\deps\ViGEmClient\lib\debug\x64;$(LibraryPath) false true @@ -88,7 +88,7 @@ false - ..\deps\SFML\include;..\deps\WinReg;..\deps\spdlog\include;..\deps\ValveFileVDF;..\deps\subhook;..\deps\ViGEmClient\include;..\deps\imgui;..\deps\imgui-sfml;..\deps\json\include;$(ExternalIncludePath) + ..\deps\SFML\include;..\deps\WinReg;..\deps\spdlog\include;..\deps\ValveFileVDF;..\deps\subhook;..\deps\ViGEmClient\include;..\deps\imgui;..\deps\imgui-sfml;..\deps\json\include;..\deps\traypp\tray\include;$(ExternalIncludePath) ..\deps\SFML\out\Release\lib\RelWithDebInfo;..\deps\ViGEmClient\lib\release\x64;$(LibraryPath) ResourceCompile true @@ -174,6 +174,18 @@ + + + + + + + + + + + + diff --git a/GlosSITarget/GlosSITarget.vcxproj.filters b/GlosSITarget/GlosSITarget.vcxproj.filters index 68b6120..cf146d1 100644 --- a/GlosSITarget/GlosSITarget.vcxproj.filters +++ b/GlosSITarget/GlosSITarget.vcxproj.filters @@ -31,6 +31,9 @@ {5e050d12-af62-455e-afb1-d8a253f06ab8} + + {fae52f0e-0152-49bd-8d74-a327f54bb789} + @@ -75,6 +78,42 @@ Source Files + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + + + Source Files\tray + diff --git a/GlosSITarget/Resource.rc b/GlosSITarget/Resource.rc index fdbbc31..3ac2d79 100644 --- a/GlosSITarget/Resource.rc +++ b/GlosSITarget/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,4,101004450861 - PRODUCTVERSION 0,0,4,101004450861 + FILEVERSION 0,0,4,1023002300004 + PRODUCTVERSION 0,0,4,1023002300004 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "FileDescription", "GlosSI - SteamTarget" - VALUE "FileVersion", "0.0.4.1-1-g445f861" + VALUE "FileVersion", "0.0.4.1-23-g23aebd4" VALUE "InternalName", "GlosSITarget" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSITarget.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.4.1-1-g445f861" + VALUE "ProductVersion", "0.0.4.1-23-g23aebd4" END END BLOCK "VarFileInfo" @@ -83,6 +83,16 @@ BEGIN END END + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "D:\\Alia5\\Documents\\Visual_Studio_Projects\\GloSC\\GloSC_Icon.ico" + #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// @@ -130,584 +140,6 @@ END - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/GlosSITarget/SteamTarget.cpp b/GlosSITarget/SteamTarget.cpp index 54396ac..1ef3bf3 100644 --- a/GlosSITarget/SteamTarget.cpp +++ b/GlosSITarget/SteamTarget.cpp @@ -27,6 +27,7 @@ limitations under the License. #ifdef _WIN32 #include "UWPOverlayEnabler.h" +#include #endif SteamTarget::SteamTarget(int argc, char* argv[]) @@ -88,6 +89,32 @@ Application will not function!"); } keepControllerConfig(true); + +#ifdef _WIN32 + HICON icon = 0; + TCHAR path[MAX_PATH]; + GetModuleFileName(nullptr, path, MAX_PATH); + icon = (HICON)LoadImage( + 0, + path, + IMAGE_ICON, + GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), + LR_LOADFROMFILE | LR_LOADMAP3DCOLORS); + if (!icon) { + ExtractIconEx(path, 0, &icon, nullptr, 1); + } + Tray::Tray tray{"GlosSITarget", icon}; +#else + Tray::Tray tray{"GlosSITarget", "ico.png"}; +#endif + + tray.addEntry(Tray::Button{ + "Quit", [this, &tray]() { + tray.exit(); + run_ = false; + }}); + while (run_) { detector_.update(); overlayHotkeyWorkaround(); diff --git a/GlosSITarget/TargetWindow.cpp b/GlosSITarget/TargetWindow.cpp index db88967..d40a470 100644 --- a/GlosSITarget/TargetWindow.cpp +++ b/GlosSITarget/TargetWindow.cpp @@ -22,7 +22,6 @@ limitations under the License. #include #include - #ifdef _WIN32 #include #include @@ -296,7 +295,8 @@ void TargetWindow::createWindow(bool window_mode) spdlog::debug("Limiting overlay to FPS to {}", dev_mode.dmDisplayFrequency); } - overlay_ = std::make_shared(window_, [this]() { close(); }, toggle_overlay_state_, windowed_); + overlay_ = std::make_shared( + window_, [this]() { close(); }, toggle_overlay_state_, windowed_); ImGuiIO& io = ImGui::GetIO(); io.FontGlobalScale = dpi / 96.f; @@ -316,4 +316,11 @@ void TargetWindow::createWindow(bool window_mode) ImGui::SFML::UpdateFontTexture(); } on_window_changed_(); + +#ifdef _WIN32 + if (Settings::window.disableOverlay) { + setFpsLimit(1); + ShowWindow(hwnd, SW_HIDE); + } +#endif } diff --git a/GlosSITarget/resource.h b/GlosSITarget/resource.h index 7ca31da..060508e 100644 --- a/GlosSITarget/resource.h +++ b/GlosSITarget/resource.h @@ -1,12 +1,14 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Resource.rc +// +#define IDI_ICON1 105 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_RESOURCE_VALUE 106 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/deps/traypp b/deps/traypp new file mode 160000 index 0000000..8ea6862 --- /dev/null +++ b/deps/traypp @@ -0,0 +1 @@ +Subproject commit 8ea68626a484de06d48ebcba8db99f8fd393ddd4