diff --git a/AppApi.cs b/AppApi.cs index 8cc7cea9..9bd48e9b 100644 --- a/AppApi.cs +++ b/AppApi.cs @@ -211,9 +211,14 @@ namespace VRCX } } - public void SetVR(bool active, bool hmdOverlay, bool wristOverlay) + public void SetVR(bool active, bool hmdOverlay, bool wristOverlay, bool menuButton) { - VRCXVR.Instance.SetActive(active, hmdOverlay, wristOverlay); + VRCXVR.Instance.SetActive(active, hmdOverlay, wristOverlay, menuButton); + } + + public void TriggerLeftHand() + { + VRCXVR.Instance.TriggerLeftHand(); } public void RefreshVR() diff --git a/VRCXVR.cs b/VRCXVR.cs index a409ccfd..2340a5f9 100644 --- a/VRCXVR.cs +++ b/VRCXVR.cs @@ -39,6 +39,7 @@ namespace VRCX private bool _active; private bool _hmdOverlayActive; private bool _wristOverlayActive; + private bool _menuButton; static VRCXVR() { @@ -245,11 +246,12 @@ namespace VRCX } - public void SetActive(bool active, bool hmdOverlay, bool wristOverlay) + public void SetActive(bool active, bool hmdOverlay, bool wristOverlay, bool menuButton) { _active = active; _hmdOverlayActive = hmdOverlay; _wristOverlayActive = wristOverlay; + _menuButton = menuButton; } public void Refresh() @@ -300,7 +302,6 @@ namespace VRCX sb.Clear(); system.GetStringTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_TrackingSystemName_String, sb, (uint)sb.Capacity, ref err); var isOculus = sb.ToString().IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0; - var button = "true".Equals(SharedVariable.Instance.Get("config:vrcx_overlaybutton")); // Oculus : B/Y, Bit 1, Mask 2 // Oculus : A/X, Bit 7, Mask 128 // Vive : Menu, Bit 1, Mask 2, @@ -310,7 +311,7 @@ namespace VRCX role == ETrackedControllerRole.RightHand) { if (system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state)) && - (state.ulButtonPressed & (button ? 2u : (isOculus ? 128u : 4u))) != 0) + (state.ulButtonPressed & (_menuButton ? 2u : (isOculus ? 128u : 4u))) != 0) { if (role == ETrackedControllerRole.LeftHand) { diff --git a/html/src/app.js b/html/src/app.js index 3a92cc78..d92e8259 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -8281,18 +8281,6 @@ speechSynthesis.getVoices(); ) { photonBots.unshift(id); } - if (joinTime && joinTime + 10000 < dtNow && !hasInstantiated) { - if (!this.photonLobbyBots.includes(id)) { - this.addEntryPhotonEvent({ - photonId: id, - displayName: ref.displayName, - userId: ref.id, - text: 'photon bot has joined', - created_at: new Date().toJSON() - }); - } - photonBots.unshift(id); - } if (isInvisible) { if (!this.photonLobbyBots.includes(id)) { this.addEntryPhotonEvent({ @@ -8304,8 +8292,22 @@ speechSynthesis.getVoices(); }); } photonBots.unshift(id); - } - if (avatarEyeHeight < 0) { + } else if (avatarEyeHeight < 0) { + if (!this.photonLobbyBots.includes(id)) { + this.addEntryPhotonEvent({ + photonId: id, + displayName: ref.displayName, + userId: ref.id, + text: 'photon bot has joined', + created_at: new Date().toJSON() + }); + } + photonBots.unshift(id); + } else if ( + joinTime && + joinTime + 10000 < dtNow && + !hasInstantiated + ) { if (!this.photonLobbyBots.includes(id)) { this.addEntryPhotonEvent({ photonId: id, @@ -8439,6 +8441,11 @@ speechSynthesis.getVoices(); this.lookupUser(ref); } } + } else { + this.$message({ + message: 'Missing user info', + type: 'error' + }); } }; @@ -9074,6 +9081,10 @@ speechSynthesis.getVoices(); /VideoPlay\(PyPyDance\) "(.+?)",([\d.]+),([\d.]+),"(.+?)\s*(?:)?"/g.exec( gameLog.data ); + if (!data) { + console.error('failed to parse', gameLog.data); + return; + } var videoUrl = data[1]; var videoPos = Number(data[2]); var videoLength = Number(data[3]); @@ -9139,9 +9150,13 @@ speechSynthesis.getVoices(); $app.methods.addGameLogVRDancing = function (gameLog, location) { var data = - /VideoPlay\(VRDancing\) "(.+?)",([\d.]+),([\d.]+),([\d.]+),"(.+?)","(.+?)"/g.exec( + /VideoPlay\(VRDancing\) "(.+?)",([\d.]+),([\d.]+),(-?[\d.]+),"(.+?)","(.+?)"/g.exec( gameLog.data ); + if (!data) { + console.error('failed to parse', gameLog.data); + return; + } var videoUrl = data[1]; var videoPos = Number(data[2]); var videoLength = Number(data[3]); @@ -9468,7 +9483,8 @@ speechSynthesis.getVoices(); appId = '784094509008551956'; bigIcon = 'pypy'; } else if ( - L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83' + L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83' || + L.worldId === 'wrld_dd6d2888-dbdc-47c2-bc98-3d631b2acd7c' ) { appId = '846232616054030376'; bigIcon = 'vr_dancing'; @@ -9683,11 +9699,11 @@ speechSynthesis.getVoices(); params.tag = ref.tag; } if (!this.searchWorldLabs) { - if (params.tag) { - params.tag += ',system_approved'; - } else { - params.tag = 'system_approved'; - } + if (params.tag) { + params.tag += ',system_approved'; + } else { + params.tag = 'system_approved'; + } } // TODO: option.platform this.searchWorldParams = params; @@ -11214,7 +11230,7 @@ speechSynthesis.getVoices(); 'sharedFeedFilters', JSON.stringify(this.sharedFeedFilters) ); - this.updateVRConfigVars(); + this.updateSharedFeed(true); }; $app.methods.cancelSharedFeedFilters = function () { @@ -11274,7 +11290,8 @@ speechSynthesis.getVoices(); $app.methods.isDanceWorld = function (location) { var danceWorlds = [ 'wrld_f20326da-f1ac-45fc-a062-609723b097b1', - 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83' + 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83', + 'wrld_dd6d2888-dbdc-47c2-bc98-3d631b2acd7c' ]; var L = API.parseLocation(location); if (danceWorlds.includes(L.worldId)) { @@ -11384,10 +11401,15 @@ speechSynthesis.getVoices(); ) { hmdOverlay = true; } - // active, hmdOverlay, wristOverlay - AppApi.SetVR(true, hmdOverlay, this.overlayWrist); + // active, hmdOverlay, wristOverlay, menuButton + AppApi.SetVR( + true, + hmdOverlay, + this.overlayWrist, + this.overlaybutton + ); } else { - AppApi.SetVR(false, false, false); + AppApi.SetVR(false, false, false, false); } }; @@ -14304,7 +14326,8 @@ speechSynthesis.getVoices(); loading: false, desktop: configRepository.getBool('launchAsDesktop'), location: '', - url: '' + url: '', + shortUrl: '' }; $app.watch['launchDialog.desktop'] = function () { @@ -14317,7 +14340,7 @@ speechSynthesis.getVoices(); API.$on('INSTANCE:SHORTNAME', function (args) { var url = `https://vrch.at/${args.json}`; - $app.launchDialog.url = url; + $app.launchDialog.shortUrl = url; }); $app.methods.showLaunchDialog = function (tag) { @@ -14332,6 +14355,7 @@ speechSynthesis.getVoices(); } else { D.location = L.worldId; } + D.shortUrl = ''; D.url = getLaunchURL(L.worldId, L.instanceId); D.visible = true; API.getInstanceShortName({ diff --git a/html/src/index.pug b/html/src/index.pug index 3721fe59..6413b28d 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -2029,7 +2029,10 @@ html //- dialog: launch el-dialog.x-dialog(ref="launchDialog" :visible.sync="launchDialog.visible" title="Launch" width="400px") - div #[span(v-text="launchDialog.url" style="word-break:break-all;font-size:12px")] + div #[span(v-text="launchDialog.shortUrl" style="word-break:break-all;font-size:12px")] + el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips") + el-button(@click="copyInstanceUrl(launchDialog.shortUrl)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle) + div(style="margin-top:10px") #[span(v-text="launchDialog.url" style="word-break:break-all;font-size:12px")] el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips") el-button(@click="copyInstanceUrl(launchDialog.url)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle) template(#footer)