Fix overlay fps, add capacity hard cap

This commit is contained in:
Natsumi
2021-11-12 12:15:38 +13:00
parent e80102dd03
commit c3fd45e58f
4 changed files with 22 additions and 18 deletions
+2 -7
View File
@@ -212,14 +212,9 @@ namespace VRCX
} }
} }
public void StartVR() public void SetVR(bool active, bool hmdOverlay, bool wristOverlay)
{ {
VRCXVR.Instance.SetActive(true); VRCXVR.Instance.SetActive(active, hmdOverlay, wristOverlay);
}
public void StopVR()
{
VRCXVR.Instance.SetActive(false);
} }
public void RefreshVR() public void RefreshVR()
+8 -5
View File
@@ -37,6 +37,8 @@ namespace VRCX
public static OffScreenBrowser _browser1; public static OffScreenBrowser _browser1;
public static OffScreenBrowser _browser2; public static OffScreenBrowser _browser2;
private bool _active; private bool _active;
private bool _hmdOverlayActive;
private bool _wristOverlayActive;
static VRCXVR() static VRCXVR()
{ {
@@ -136,14 +138,13 @@ namespace VRCX
while (_thread != null) while (_thread != null)
{ {
if ("true".Equals(SharedVariable.Instance.Get("config:vrcx_overlaywrist"))) if (_wristOverlayActive)
{
_browser1.RenderToTexture(_texture1); _browser1.RenderToTexture(_texture1);
} if (_hmdOverlayActive)
_browser2.RenderToTexture(_texture2); _browser2.RenderToTexture(_texture2);
try try
{ {
Thread.Sleep(16); Thread.Sleep(32);
} }
catch catch
{ {
@@ -244,9 +245,11 @@ namespace VRCX
} }
public void SetActive(bool active) public void SetActive(bool active, bool hmdOverlay, bool wristOverlay)
{ {
_active = active; _active = active;
_hmdOverlayActive = hmdOverlay;
_wristOverlayActive = wristOverlay;
} }
public void Refresh() public void Refresh()
+7 -2
View File
@@ -9986,9 +9986,14 @@ speechSynthesis.getVoices();
isSteamVRRunning && isSteamVRRunning &&
(isGameRunning || this.openVRAlways) (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 { } else {
AppApi.StopVR(); AppApi.SetVR(false, false, false);
} }
}; };
+4 -3
View File
@@ -1407,7 +1407,7 @@ html
div. div.
#[i.el-icon-user] Public {{ worldDialog.ref.publicOccupants | commaNumber }} #[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-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(v-for="room in worldDialog.rooms" :key="room.id")
div(style="margin:5px 0") div(style="margin:5px 0")
span.x-link(@click="showLaunchDialog(room.$location.tag)") span.x-link(@click="showLaunchDialog(room.$location.tag)")
@@ -1458,7 +1458,8 @@ html
.x-friend-item(style="cursor:default") .x-friend-item(style="cursor:default")
.detail .detail
span.name Favorites 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") .x-friend-item(style="cursor:default")
.detail .detail
span.name Visits span.name Visits
@@ -1466,7 +1467,7 @@ html
.x-friend-item(style="cursor:default") .x-friend-item(style="cursor:default")
.detail .detail
span.name Capacity 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") .x-friend-item(style="cursor:default")
.detail .detail
span.name Heat span.name Heat