diff --git a/AppApi.cs b/AppApi.cs index 8562daf0..04400f27 100644 --- a/AppApi.cs +++ b/AppApi.cs @@ -212,14 +212,9 @@ namespace VRCX } } - public void StartVR() + public void SetVR(bool active, bool hmdOverlay, bool wristOverlay) { - VRCXVR.Instance.SetActive(true); - } - - public void StopVR() - { - VRCXVR.Instance.SetActive(false); + VRCXVR.Instance.SetActive(active, hmdOverlay, wristOverlay); } public void RefreshVR() diff --git a/VRCXVR.cs b/VRCXVR.cs index 0587c122..a409ccfd 100644 --- a/VRCXVR.cs +++ b/VRCXVR.cs @@ -37,6 +37,8 @@ namespace VRCX public static OffScreenBrowser _browser1; public static OffScreenBrowser _browser2; private bool _active; + private bool _hmdOverlayActive; + private bool _wristOverlayActive; static VRCXVR() { @@ -136,14 +138,13 @@ namespace VRCX while (_thread != null) { - if ("true".Equals(SharedVariable.Instance.Get("config:vrcx_overlaywrist"))) - { + if (_wristOverlayActive) _browser1.RenderToTexture(_texture1); - } - _browser2.RenderToTexture(_texture2); + if (_hmdOverlayActive) + _browser2.RenderToTexture(_texture2); try { - Thread.Sleep(16); + Thread.Sleep(32); } catch { @@ -244,9 +245,11 @@ namespace VRCX } - public void SetActive(bool active) + public void SetActive(bool active, bool hmdOverlay, bool wristOverlay) { _active = active; + _hmdOverlayActive = hmdOverlay; + _wristOverlayActive = wristOverlay; } public void Refresh() diff --git a/html/src/app.js b/html/src/app.js index 95576bca..0b04a6ad 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -9986,9 +9986,14 @@ speechSynthesis.getVoices(); isSteamVRRunning && (isGameRunning || this.openVRAlways) ) { - AppApi.StartVR(); + var hmdOverlay = false; + if (this.overlayNotifications || this.progressPie) { + hmdOverlay = true; + } + // active, hmdOverlay, wristOverlay + AppApi.SetVR(true, hmdOverlay, this.overlayWrist); } else { - AppApi.StopVR(); + AppApi.SetVR(false, false, false); } }; diff --git a/html/src/index.pug b/html/src/index.pug index 9f964708..8f3ee03f 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1407,7 +1407,7 @@ html div. #[i.el-icon-user] Public {{ worldDialog.ref.publicOccupants | commaNumber }} #[i.el-icon-user-solid(style="margin-left:10px")] Private {{ worldDialog.ref.privateOccupants | commaNumber }} - #[i.el-icon-check(style="margin-left:10px")] Capacity {{ worldDialog.ref.capacity | commaNumber }} + #[i.el-icon-check(style="margin-left:10px")] Capacity {{ worldDialog.ref.capacity | commaNumber }} ({{ worldDialog.ref.capacity * 2 | commaNumber }}) div(v-for="room in worldDialog.rooms" :key="room.id") div(style="margin:5px 0") span.x-link(@click="showLaunchDialog(room.$location.tag)") @@ -1458,7 +1458,8 @@ html .x-friend-item(style="cursor:default") .detail span.name Favorites - span.extra {{ worldDialog.ref.favorites | commaNumber }} ({{ Math.round(((worldDialog.ref.favorites - worldDialog.ref.visits) / worldDialog.ref.visits * 100 + 100) * 100) / 100 }}%) + span.extra {{ worldDialog.ref.favorites | commaNumber }} + | #[template(v-if="worldDialog.ref.favorites > 0") ({{ Math.round(((worldDialog.ref.favorites - worldDialog.ref.visits) / worldDialog.ref.visits * 100 + 100) * 100) / 100 }}%)] .x-friend-item(style="cursor:default") .detail span.name Visits @@ -1466,7 +1467,7 @@ html .x-friend-item(style="cursor:default") .detail span.name Capacity - span.extra(v-text="worldDialog.ref.capacity") + span.extra {{ worldDialog.ref.capacity | commaNumber }} ({{ worldDialog.ref.capacity * 2 | commaNumber }}) .x-friend-item(style="cursor:default") .detail span.name Heat