Display short url and normal one, small changes and fixes

This commit is contained in:
Natsumi
2021-12-06 02:08:36 +13:00
parent 78bc71bd6b
commit b998e04274
4 changed files with 67 additions and 34 deletions

View File

@@ -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)
{