From a16875bfc221b1f7aa833abef7ef78ed6686ca1e Mon Sep 17 00:00:00 2001 From: Natsumi Date: Wed, 21 Oct 2020 21:22:17 +1300 Subject: [PATCH] Toggle for VR device visibility on wrist overlay --- html/src/app.js | 3 +++ html/src/index.pug | 3 +++ html/src/vr.js | 17 +++++++++++------ html/src/vr.pug | 2 -- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index 6ef7477d..bfee6313 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -5479,14 +5479,17 @@ CefSharp.BindObjectAsync( $app.data.openVR = VRCXStorage.GetBool('openVR'); $app.data.openVRAlways = VRCXStorage.GetBool('openVRAlways'); $app.data.hidePrivateFromFeed = VRCXStorage.GetBool('VRCX_hidePrivateFromFeed'); + $app.data.hideDevicesFromFeed = VRCXStorage.GetBool('VRCX_hideDevicesFromFeed'); var saveOpenVROption = function () { VRCXStorage.SetBool('openVR', this.openVR); VRCXStorage.SetBool('openVRAlways', this.openVRAlways); VRCXStorage.SetBool('VRCX_hidePrivateFromFeed', this.hidePrivateFromFeed); + VRCXStorage.SetBool('VRCX_hideDevicesFromFeed', this.hideDevicesFromFeed); }; $app.watch.openVR = saveOpenVROption; $app.watch.openVRAlways = saveOpenVROption; $app.watch.hidePrivateFromFeed = saveOpenVROption; + $app.watch.hideDevicesFromFeed = saveOpenVROption; $app.data.isDarkMode = VRCXStorage.GetBool('isDarkMode'); $appDarkStyle.disabled = $app.data.isDarkMode === false; $app.watch.isDarkMode = function () { diff --git a/html/src/index.pug b/html/src/index.pug index af4a7692..9eca6f62 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -497,6 +497,9 @@ html div(style="font-size:12px;margin-top:5px") span(style="display:inline-block;min-width:150px") Force Run el-switch(v-model="openVRAlways") + div(style="font-size:12px;margin-top:5px") + span(style="display:inline-block;min-width:150px") Hide VR devices + el-switch(v-model="hideDevicesFromFeed") div(style="font-size:12px;margin-top:5px") span(style="display:inline-block;min-width:150px") Hide Private worlds el-switch(v-model="hidePrivateFromFeed") diff --git a/html/src/vr.js b/html/src/vr.js index 2323a7ed..b5bc142e 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -664,12 +664,17 @@ CefSharp.BindObjectAsync( VRCX.CpuUsage().then((cpuUsage) => { this.cpuUsage = cpuUsage.toFixed(2); }); - VRCX.GetVRDevices().then((devices) => { - devices.forEach((device) => { - device[2] = parseInt(device[2], 10); - }); - this.devices = devices; - }); + if (VRCXStorage.GetBool('VRCX_hideDevicesFromFeed') === false) { + VRCX.GetVRDevices().then((devices) => { + devices.forEach((device) => { + device[2] = parseInt(device[2], 10); + }); + this.devices = devices; + }); + } + else { + this.devices = ""; + } this.updateSharedFeed(); }; diff --git a/html/src/vr.pug b/html/src/vr.pug index a8c5de9c..5289332e 100644 --- a/html/src/vr.pug +++ b/html/src/vr.pug @@ -91,8 +91,6 @@ html img(v-else src="images/other_status_ready.png" style="width:32px;height:32px") br span {{ device[2] }}% - div(v-else) - span No SteamVR Devices .x-container span(style="float:right") {{ currentTime | formatDate('YYYY-MM-DD HH:MI:SS AMPM') }} span CPU {{ cpuUsage }}%