diff --git a/GlosSITarget/AppLauncher.cpp b/GlosSITarget/AppLauncher.cpp index a5eacf2..b2350c7 100644 --- a/GlosSITarget/AppLauncher.cpp +++ b/GlosSITarget/AppLauncher.cpp @@ -147,7 +147,7 @@ void AppLauncher::getChildPids(DWORD parent_pid) do { if (pe.th32ParentProcessID == parent_pid) { if (std::ranges::find(pids_, pe.th32ProcessID) == pids_.end()) { - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { spdlog::info("Found new child process with PID \"{}\"", pe.th32ProcessID); } pids_.push_back(pe.th32ProcessID); diff --git a/GlosSITarget/HidHide.cpp b/GlosSITarget/HidHide.cpp index 6667828..086383d 100644 --- a/GlosSITarget/HidHide.cpp +++ b/GlosSITarget/HidHide.cpp @@ -122,7 +122,7 @@ void HidHide::hideDevices(const std::filesystem::path& steam_path) whitelist.push_back(path); } } - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { std::ranges::for_each(whitelist, [](const auto& exe) { spdlog::trace(L"Whitelisted executable: {}", exe); }); @@ -130,7 +130,7 @@ void HidHide::hideDevices(const std::filesystem::path& steam_path) setAppWhiteList(whitelist); avail_devices_ = GetHidDeviceList(); - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { std::ranges::for_each(avail_devices_, [](const auto& dev) { spdlog::trace(L"AvailDevice device: {}", dev.name); }); @@ -157,7 +157,7 @@ void HidHide::hideDevices(const std::filesystem::path& steam_path) setBlacklistDevices(blacklisted_devices_); setActive(true); spdlog::info("Hid Gaming Devices; Enabling Overlay element..."); - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { std::ranges::for_each(blacklisted_devices_, [](const auto& dev) { spdlog::trace(L"Blacklisted device: {}", dev); }); @@ -205,14 +205,14 @@ void HidHide::enableOverlayElement() // UnPatchValveHooks(); openCtrlDevice(); bool hidehide_state_store = hidhide_active_; - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { spdlog::debug("Refreshing HID devices"); } if (hidhide_active_) { setActive(false); } avail_devices_ = GetHidDeviceList(); - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { std::ranges::for_each(avail_devices_, [](const auto& dev) { spdlog::trace(L"AvailDevice device: {}", dev.name); }); @@ -248,7 +248,7 @@ void HidHide::enableOverlayElement() blacklisted_devices_.end()); } setBlacklistDevices(blacklisted_devices_); - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { std::ranges::for_each(blacklisted_devices_, [](const auto& dev) { spdlog::trace(L"Blacklisted device: {}", dev); }); @@ -355,7 +355,7 @@ void HidHide::setActive(bool active) return; } hidhide_active_ = active; - if (Settings::extendedLogging) { + if (Settings::common.extendedLogging) { spdlog::debug("HidHide State set to {}", active); } } diff --git a/GlosSITarget/Overlay.cpp b/GlosSITarget/Overlay.cpp index 39b3d31..c5427d5 100644 --- a/GlosSITarget/Overlay.cpp +++ b/GlosSITarget/Overlay.cpp @@ -199,7 +199,7 @@ void Overlay::update() Settings::StoreSettings(); } } - ImGui::Checkbox("Extended logging", &Settings::extendedLogging); + ImGui::Checkbox("Extended logging", &Settings::common.extendedLogging); ImGuiID dockspace_id = ImGui::GetID("GlosSI-DockSpace"); ImGui::DockSpace(dockspace_id); diff --git a/GlosSITarget/Settings.h b/GlosSITarget/Settings.h index 56bc0d6..0625073 100644 --- a/GlosSITarget/Settings.h +++ b/GlosSITarget/Settings.h @@ -59,12 +59,12 @@ inline struct Controller { bool emulateDS4 = false; } controller; -inline struct Cli { +inline struct Common { bool no_uwp_overlay = false; bool disable_watchdog = false; -} cli; -inline bool extendedLogging = false; + bool extendedLogging = false; +} common; inline std::filesystem::path settings_path_ = ""; diff --git a/GlosSITarget/SteamOverlayDetector.cpp b/GlosSITarget/SteamOverlayDetector.cpp index 12fdf86..76d2b9a 100644 --- a/GlosSITarget/SteamOverlayDetector.cpp +++ b/GlosSITarget/SteamOverlayDetector.cpp @@ -47,7 +47,7 @@ void SteamOverlayDetector::update() if (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) { // filter out some messages as not all get altered by steam... - if (Settings::extendedLogging && msg.message != 512 && msg.message != 5374) { + if (Settings::common.extendedLogging && msg.message != 512 && msg.message != 5374) { spdlog::trace("PeekMessage: Window msg: {}", msg.message); } diff --git a/GlosSITarget/SteamTarget.cpp b/GlosSITarget/SteamTarget.cpp index 4c11e07..fc3c357 100644 --- a/GlosSITarget/SteamTarget.cpp +++ b/GlosSITarget/SteamTarget.cpp @@ -50,7 +50,7 @@ SteamTarget::SteamTarget() { target_window_handle_ = window_.getSystemHandle(); #ifdef _WIN32 - if (Settings::cli.no_uwp_overlay) { + if (Settings::common.no_uwp_overlay) { UWPOverlayEnabler::AddUwpOverlayOvWidget(); } else { @@ -78,7 +78,7 @@ Application will not function!"); steam_overlay_present_ = true; #ifdef WIN32 - if (!Settings::cli.disable_watchdog) { + if (!Settings::common.disable_watchdog) { wchar_t buff[MAX_PATH]; GetModuleFileName(GetModuleHandle(NULL), buff, MAX_PATH); std::wstring watchDogPath(buff);