|
|
|
@ -68,12 +68,14 @@ void HidHide::closeCtrlDevice()
|
|
|
|
|
|
|
|
|
|
void HidHide::hideDevices(const std::filesystem::path& steam_path)
|
|
|
|
|
{
|
|
|
|
|
steam_path_ = steam_path;
|
|
|
|
|
enableOverlayElement();
|
|
|
|
|
if (!Settings::devices.hideDevices) {
|
|
|
|
|
spdlog::info("Hiding devices is disabled; Not un-patching valve hooks, not looking for HidHide");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
spdlog::debug("Device hiding enabled;");
|
|
|
|
|
spdlog::debug("Setting up device hiding...");
|
|
|
|
|
|
|
|
|
|
UnPatchValveHooks();
|
|
|
|
|
|
|
|
|
@ -149,9 +151,9 @@ void HidHide::hideDevices(const std::filesystem::path& steam_path)
|
|
|
|
|
spdlog::trace(L"Blacklisted device: {}", dev);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
enableOverlayElement();
|
|
|
|
|
}
|
|
|
|
|
closeCtrlDevice();
|
|
|
|
|
device_hiding_setup_ = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HidHide::disableHidHide()
|
|
|
|
@ -217,6 +219,7 @@ void HidHide::enableOverlayElement()
|
|
|
|
|
Overlay::AddOverlayElem([this](bool window_has_focus, ImGuiID dockspace_id) {
|
|
|
|
|
ImGui::SetNextWindowDockID(dockspace_id, ImGuiCond_FirstUseEver);
|
|
|
|
|
if (ImGui::Begin("Hidden Devices")) {
|
|
|
|
|
if (device_hiding_setup_) {
|
|
|
|
|
if (window_has_focus && (overlay_elem_clock_.getElapsedTime().asSeconds() > OVERLAY_ELEM_REFRESH_INTERVAL_S_)) {
|
|
|
|
|
// UnPatchValveHooks();
|
|
|
|
|
openCtrlDevice();
|
|
|
|
@ -234,7 +237,7 @@ void HidHide::enableOverlayElement()
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
blacklisted_devices_ = getBlackListDevices();
|
|
|
|
|
if (hidehide_state_store) {
|
|
|
|
|
if (hidehide_state_store && Settings::devices.hideDevices) {
|
|
|
|
|
setActive(true);
|
|
|
|
|
}
|
|
|
|
|
closeCtrlDevice();
|
|
|
|
@ -273,12 +276,20 @@ void HidHide::enableOverlayElement()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
ImGui::EndChild();
|
|
|
|
|
if (ImGui::Checkbox("Devices Hidden", &hidhide_active_)) {
|
|
|
|
|
} else {
|
|
|
|
|
ImGui::Text("Enable \"Hide Devices\" to see a list of gaming-devices");
|
|
|
|
|
}
|
|
|
|
|
if (ImGui::Checkbox("Hide devices", &Settings::devices.hideDevices)) {
|
|
|
|
|
if (!device_hiding_setup_) {
|
|
|
|
|
hideDevices(steam_path_);
|
|
|
|
|
}
|
|
|
|
|
if (hidhide_active_ != Settings::devices.hideDevices) {
|
|
|
|
|
openCtrlDevice();
|
|
|
|
|
setActive(hidhide_active_);
|
|
|
|
|
setActive(Settings::devices.hideDevices);
|
|
|
|
|
closeCtrlDevice();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ImGui::End();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|