diff --git a/assets/config_default.ini b/assets/config_default.ini index aa35078..ae4bbfd 100644 --- a/assets/config_default.ini +++ b/assets/config_default.ini @@ -129,6 +129,9 @@ PerformanceMonitorShowTrackers=true PerformanceMonitorShowViveWireless=false PerformanceMonitorDisableGPUCounters=false +[Misc] +ApplySteamVR2DashboardOffset=true + [CustomActions] Count=3 Action0Name=Middle Mouse Button diff --git a/src/DesktopPlus/DesktopPlus.rc b/src/DesktopPlus/DesktopPlus.rc index 10c0d87..68338e4 100644 Binary files a/src/DesktopPlus/DesktopPlus.rc and b/src/DesktopPlus/DesktopPlus.rc differ diff --git a/src/DesktopPlus/OutputManager.cpp b/src/DesktopPlus/OutputManager.cpp index 00395d4..bf4efcc 100644 --- a/src/DesktopPlus/OutputManager.cpp +++ b/src/DesktopPlus/OutputManager.cpp @@ -1207,6 +1207,7 @@ bool OutputManager::HandleIPCMessage(const MSG& msg) case configid_bool_overlay_enabled: case configid_bool_overlay_gazefade_enabled: case configid_bool_overlay_update_invisible: + case configid_bool_misc_apply_steamvr2_dashboard_offset: { ApplySettingTransform(); break; @@ -5396,6 +5397,25 @@ Matrix4 OutputManager::DragGetBaseOffsetMatrix() UpdateDashboardHMD_Y(); } + //Adjust origin if GamepadUI (SteamVR 2 dashboard) exists + if (ConfigManager::Get().GetConfigBool(configid_bool_misc_apply_steamvr2_dashboard_offset)) + { + vr::VROverlayHandle_t handle_gamepad_ui = vr::k_ulOverlayHandleInvalid; + vr::VROverlay()->FindOverlay("valve.steam.gamepadui.bar", &handle_gamepad_ui); + + if (handle_gamepad_ui != vr::k_ulOverlayHandleInvalid) + { + //Magic number, from taking the difference of both version's dashboard origins at the same HMD position + const Matrix4 matrix_to_old_dash( 1.14634132f, 3.725290300e-09f, -3.725290300e-09f, 0.00000000f, + 0.00000000f, 0.878148496f, 0.736854136f, 0.00000000f, + 7.45058060e-09f, -0.736854076f, 0.878148496f, 0.00000000f, + -5.96046448e-08f, 2.174717430f, 0.123533726f, 1.00000000f); + + //Move origin point roughly back to where it was in the old dashboard + matrix = matrix * matrix_to_old_dash; + } + } + Vector3 pos_offset = matrix.getTranslation(); pos_offset.y = m_DashboardHMD_Y; matrix.setTranslation(pos_offset); diff --git a/src/DesktopPlusUI/DesktopPlusUI.rc b/src/DesktopPlusUI/DesktopPlusUI.rc index 3cb86f8..f54e1ce 100644 Binary files a/src/DesktopPlusUI/DesktopPlusUI.rc and b/src/DesktopPlusUI/DesktopPlusUI.rc differ diff --git a/src/DesktopPlusUI/WindowSettings.cpp b/src/DesktopPlusUI/WindowSettings.cpp index cf83349..aec0ad6 100644 --- a/src/DesktopPlusUI/WindowSettings.cpp +++ b/src/DesktopPlusUI/WindowSettings.cpp @@ -953,6 +953,20 @@ void WindowSettings::UpdateCatOverlayTabGeneral() ImGui::Columns(1); + if (mode_origin == ovrl_origin_dashboard) + { + ImGui::Columns(2, "ColumnPositionWide", false); + ImGui::SetColumnWidth(0, column_width_0 * 2.0f); + + bool& apply_steamvr2_offset = ConfigManager::Get().GetConfigBoolRef(configid_bool_misc_apply_steamvr2_dashboard_offset); + if (ImGui::Checkbox("Apply SteamVR 2 Dashboard Offset", &apply_steamvr2_offset)) + { + IPCManager::Get().PostMessageToDashboardApp(ipcmsg_set_config, ConfigManager::GetWParamForConfigID(configid_bool_misc_apply_steamvr2_dashboard_offset), apply_steamvr2_offset); + } + ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x); + ImGui::FixedHelpMarker("Applies backward compatibility offset to dashboard origin overlays when the SteamVR 2 dashboard is detected.\nThis setting applies to all overlays."); + } + PopupOverlayDetachedPositionChange(); } @@ -3091,7 +3105,7 @@ void WindowSettings::UpdateCatMisc() ImGui::Columns(2, "ColumnVersionInfo", false); ImGui::SetColumnWidth(0, column_width_0 * 2.0f); - ImGui::Text("Desktop+ Version 2.8.3"); + ImGui::Text("Desktop+ Version 2.8.4"); ImGui::Columns(1); } diff --git a/src/DesktopPlusWinRT/DesktopPlusWinRT.rc b/src/DesktopPlusWinRT/DesktopPlusWinRT.rc index a6d3bb4..6f02f1d 100644 --- a/src/DesktopPlusWinRT/DesktopPlusWinRT.rc +++ b/src/DesktopPlusWinRT/DesktopPlusWinRT.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,3,0 - PRODUCTVERSION 2,8,3,0 + FILEVERSION 2,8,4,0 + PRODUCTVERSION 2,8,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "elvissteinjr" VALUE "FileDescription", "Desktop+ WinRT Wrapper" - VALUE "FileVersion", "2.8.3.0" + VALUE "FileVersion", "2.8.4.0" VALUE "LegalCopyright", "Copyright © 2019 - 2023 elvissteinjr" VALUE "ProductName", "Desktop+ WinRT" - VALUE "ProductVersion", "2.8.3.0" + VALUE "ProductVersion", "2.8.4.0" END END BLOCK "VarFileInfo" diff --git a/src/Shared/ConfigManager.cpp b/src/Shared/ConfigManager.cpp index 4e62ca1..952e64d 100644 --- a/src/Shared/ConfigManager.cpp +++ b/src/Shared/ConfigManager.cpp @@ -555,8 +555,9 @@ bool ConfigManager::LoadConfigFromFile() m_ConfigBool[configid_bool_performance_monitor_show_vive_wireless] = config.ReadBool("Performance", "PerformanceMonitorShowViveWireless", false); m_ConfigBool[configid_bool_performance_monitor_disable_gpu_counters] = config.ReadBool("Performance", "PerformanceMonitorDisableGPUCounters", false); - m_ConfigBool[configid_bool_misc_no_steam] = config.ReadBool("Misc", "NoSteam", false); - m_ConfigBool[configid_bool_misc_uiaccess_was_enabled] = config.ReadBool("Misc", "UIAccessWasEnabled", false); + m_ConfigBool[configid_bool_misc_no_steam] = config.ReadBool("Misc", "NoSteam", false); + m_ConfigBool[configid_bool_misc_uiaccess_was_enabled] = config.ReadBool("Misc", "UIAccessWasEnabled", false); + m_ConfigBool[configid_bool_misc_apply_steamvr2_dashboard_offset] = config.ReadBool("Misc", "ApplySteamVR2DashboardOffset", true); //Load custom actions (this is where using ini feels dumb, but it still kinda works) auto& custom_actions = m_ActionManager.GetCustomActions(); @@ -927,6 +928,7 @@ void ConfigManager::SaveConfigToFile() config.WriteBool("Performance", "PerformanceMonitorDisableGPUCounters", m_ConfigBool[configid_bool_performance_monitor_disable_gpu_counters]); config.WriteBool("Misc", "NoSteam", m_ConfigBool[configid_bool_misc_no_steam]); + config.WriteBool("Misc", "ApplySteamVR2DashboardOffset", m_ConfigBool[configid_bool_misc_apply_steamvr2_dashboard_offset]); config.WriteBool("Misc", "UIAccessWasEnabled", (m_ConfigBool[configid_bool_misc_uiaccess_was_enabled] || m_ConfigBool[configid_bool_state_misc_uiaccess_enabled])); //Save custom actions diff --git a/src/Shared/ConfigManager.h b/src/Shared/ConfigManager.h index d08413a..479933a 100644 --- a/src/Shared/ConfigManager.h +++ b/src/Shared/ConfigManager.h @@ -67,6 +67,7 @@ enum ConfigID_Bool configid_bool_windows_winrt_auto_focus_scene_app, configid_bool_misc_no_steam, //Restarts without Steam when it detects to have been launched by Steam configid_bool_misc_uiaccess_was_enabled, //Tracks if UIAccess was enabled to show a warning after it isn't anymore due to updates or modified executable + configid_bool_misc_apply_steamvr2_dashboard_offset, //Applies backward compatibility offset transform when the SteamVR 2 dashboard is detected configid_bool_state_overlay_dragmode, configid_bool_state_overlay_selectmode, configid_bool_state_overlay_dragselectmode_show_hidden, //True if mode is from a popup