Exemplo n.º 1
0
 // Token: 0x06006183 RID: 24963 RVA: 0x002269F0 File Offset: 0x00224DF0
 private void OnEnable()
 {
     if (this.toggle)
     {
         if (VRCInputManager.IsRequired(this.method))
         {
             this.toggle.interactable = false;
             this.toggle.isOn         = true;
         }
         else if (!VRCInputManager.IsSupported(this.method))
         {
             this.toggle.interactable = false;
             this.toggle.isOn         = false;
         }
         else
         {
             this.toggle.interactable = true;
             this.toggle.isOn         = VRCInputManager.IsEnabled(this.method);
         }
     }
     if (this.disable)
     {
         bool active = VRCInputManager.IsEnabled(this.method) && VRCInputManager.IsSupported(this.method);
         foreach (VRCInputManager.InputMethod input in this.disableExclusiveOf)
         {
             if (VRCInputManager.IsSupported(input) && VRCInputManager.IsEnabled(input))
             {
                 active = false;
             }
         }
         this.disable.SetActive(active);
     }
 }
Exemplo n.º 2
0
 // Token: 0x0600566C RID: 22124 RVA: 0x001DBD84 File Offset: 0x001DA184
 public override void ConnectInputs(Dictionary <string, VRCInput> inputs)
 {
     this.inVertical           = inputs["Vertical"];
     this.inHorizontal         = inputs["Horizontal"];
     this.inLookHorizontal     = inputs["LookHorizontal"];
     this.inLookVertical       = inputs["LookVertical"];
     this.inJump               = inputs["Jump"];
     this.inRun                = inputs["Run"];
     this.inBack               = inputs["Back"];
     this.inMenu               = inputs["Menu"];
     this.inComfortLeft        = inputs["ComfortLeft"];
     this.inComfortRight       = inputs["ComfortRight"];
     this.inGrabRight          = inputs["GrabRight"];
     this.inUseRight           = inputs["UseRight"];
     this.inGrabLeft           = inputs["GrabLeft"];
     this.inUseLeft            = inputs["UseLeft"];
     this.inTouchpadLeftClick  = inputs["TouchpadLeftClick"];
     this.inTouchpadLeftX      = inputs["TouchpadLeftX"];
     this.inTouchpadLeftY      = inputs["TouchpadLeftY"];
     this.inTouchpadRightClick = inputs["TouchpadRightClick"];
     this.inTouchpadRightX     = inputs["TouchpadRightX"];
     this.inTouchpadRightY     = inputs["TouchpadRightY"];
     this.inUseAxisLeft        = inputs["UseAxisLeft"];
     this.inUseAxisRight       = inputs["UseAxisRight"];
     this.inGrabAxisLeft       = inputs["GrabAxisLeft"];
     this.inGrabAxisRight      = inputs["GrabAxisRight"];
     this._inFaceTouchL        = VRCInputManager.FindInput("FaceTouchLeft");
     this._inFaceTouchR        = VRCInputManager.FindInput("FaceTouchRight");
     this._inFaceButtonTouchL  = VRCInputManager.FindInput("FaceButtonTouchLeft");
     this._inFaceButtonTouchR  = VRCInputManager.FindInput("FaceButtonTouchRight");
     this._inTriggerTouchL     = VRCInputManager.FindInput("TriggerTouchLeft");
     this._inTriggerTouchR     = VRCInputManager.FindInput("TriggerTouchRight");
     this._inThumbRestTouchL   = VRCInputManager.FindInput("ThumbRestTouchLeft");
     this._inThumbRestTouchR   = VRCInputManager.FindInput("ThumbRestTouchRight");
 }
Exemplo n.º 3
0
 // Token: 0x060051CD RID: 20941 RVA: 0x001C0680 File Offset: 0x001BEA80
 private void Awake()
 {
     this.inUseLeft   = VRCInputManager.FindInput("UseLeft");
     this.inUseRight  = VRCInputManager.FindInput("UseRight");
     this.inGrabLeft  = VRCInputManager.FindInput("GrabLeft");
     this.inGrabRight = VRCInputManager.FindInput("GrabRight");
 }
Exemplo n.º 4
0
 // Token: 0x0600617A RID: 24954 RVA: 0x0022680C File Offset: 0x00224C0C
 private void StringAccepted(string s, List <KeyCode> keyCodes, Text t)
 {
     this.text = s;
     if (!string.IsNullOrEmpty(this.textField.text))
     {
         this.textField.gameObject.SetActive(true);
         if (this.placeholder != null)
         {
             this.placeholder.gameObject.SetActive(false);
         }
     }
     else
     {
         this.textField.gameObject.SetActive(false);
         if (this.placeholder != null)
         {
             this.placeholder.gameObject.SetActive(true);
         }
     }
     VRCUiPopupManager.Instance.HideCurrentPopup();
     VRCInputManager.UseKeyboardOnlyForText(false);
     this.onEndEdit.Invoke(s);
     if (this.onDoneInputting != null)
     {
         this.onDoneInputting(s);
     }
 }
Exemplo n.º 5
0
 // Token: 0x06005FFC RID: 24572 RVA: 0x0021C438 File Offset: 0x0021A838
 private void Awake()
 {
     this.root     = base.transform.Find("Gestures").gameObject;
     this.piebase  = this.root.transform.Find("Pie").GetComponent <Image>();
     this.icons    = new Image[7];
     this.icons[0] = this.root.transform.Find("fist").GetComponent <Image>();
     this.icons[1] = this.root.transform.Find("point").GetComponent <Image>();
     this.icons[2] = this.root.transform.Find("peace").GetComponent <Image>();
     this.icons[3] = this.root.transform.Find("rocknroll").GetComponent <Image>();
     this.icons[4] = this.root.transform.Find("palm").GetComponent <Image>();
     this.icons[5] = this.root.transform.Find("gun").GetComponent <Image>();
     this.icons[6] = this.root.transform.Find("thumb").GetComponent <Image>();
     if (this.rightHand)
     {
         this._inputX          = VRCInputManager.FindInput("PieMenuRightX");
         this._inputY          = VRCInputManager.FindInput("PieMenuRightY");
         this._gestureSelect   = VRCInputManager.FindInput("PieMenuRightShow");
         this._gestureActivate = VRCInputManager.FindInput("PieMenuRightActivate");
     }
     else
     {
         this._inputX          = VRCInputManager.FindInput("PieMenuLeftX");
         this._inputY          = VRCInputManager.FindInput("PieMenuLeftY");
         this._gestureSelect   = VRCInputManager.FindInput("PieMenuLeftShow");
         this._gestureActivate = VRCInputManager.FindInput("PieMenuLeftActivate");
     }
     this.SelectItem(0);
     this.root.SetActive(false);
 }
Exemplo n.º 6
0
 // Token: 0x060062B0 RID: 25264 RVA: 0x00232CA0 File Offset: 0x002310A0
 private void UpdateActiveCursorSet()
 {
     if (this.activeCursor == VRCUiCursorManager.CursorType.None)
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Gaze;
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Vive) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Vive))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Hydra) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Hydra))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Oculus) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Oculus))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
     }
     if (VRCInputManager.AnyKey(VRCInputManager.InputMethod.Hydra) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Vive) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Oculus))
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Hands;
     }
     else if ((VRCInputManager.AnyKey(VRCInputManager.InputMethod.Controller) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Keyboard)) && HMDManager.IsHmdDetected())
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Gaze;
     }
     else if (VRCInputManager.AnyKey(VRCInputManager.InputMethod.Mouse))
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Mouse;
     }
 }
Exemplo n.º 7
0
 // Token: 0x0600615E RID: 24926 RVA: 0x00225FB4 File Offset: 0x002243B4
 protected override void Start()
 {
     base.Start();
     this.inAxisHorizontal = VRCInputManager.FindInput("Horizontal");
     this.inAxisVertical   = VRCInputManager.FindInput("Vertical");
     this.inSubmit         = VRCInputManager.FindInput("Select");
     this.inCancel         = VRCInputManager.FindInput("Back");
 }
Exemplo n.º 8
0
 // Token: 0x0600618E RID: 24974 RVA: 0x00226D1C File Offset: 0x0022511C
 private bool GetValueBool()
 {
     if (string.IsNullOrEmpty(this.PlayerPrefsString))
     {
         return(VRCInputManager.GetSetting(this.setting));
     }
     return(PlayerPrefs.GetInt(this.PlayerPrefsString) != 0);
 }
Exemplo n.º 9
0
 // Token: 0x06004CD8 RID: 19672 RVA: 0x0019BF6E File Offset: 0x0019A36E
 public static void Mute()
 {
     Debug.Log("Attmepting to to mute mic");
     VRCInputManager.talkToggle    = false;
     VRCInputManager.talkDefaultOn = false;
     VRCInputManager.SettingsChanged(VRCInputManager.InputSetting.ToggleTalk);
     DefaultTalkController.voiceMuted = false;
 }
Exemplo n.º 10
0
        public override void OnSceneWasInitialized(int buildIndex, string sceneName)
        {
            if (buildIndex != -1)
            {
                return;
            }

            useRight = VRCInputManager.Method_Public_Static_VRCInput_String_0("UseRight");
            useLeft  = VRCInputManager.Method_Public_Static_VRCInput_String_0("UseLeft");
        }
Exemplo n.º 11
0
 // Token: 0x06006004 RID: 24580 RVA: 0x0021C924 File Offset: 0x0021AD24
 private void Start()
 {
     this.dotImage         = base.transform.Find("VoiceDot").GetComponent <Image>();
     this.dotDisabledImage = base.transform.Find("VoiceDotDisabled").GetComponent <Image>();
     this.dotColor         = this.dotImage.color;
     this.keybdTip         = base.transform.Find("PushToTalkKeybd").gameObject;
     this.xboxTip          = base.transform.Find("PushToTalkXbox").gameObject;
     this.DisableTips();
     this.inVoice = VRCInputManager.FindInput("Voice");
 }
Exemplo n.º 12
0
    // Token: 0x0600517B RID: 20859 RVA: 0x001BE994 File Offset: 0x001BCD94
    private void SendHmdAnalytic()
    {
        string analyticName = "hmdType";
        string value        = "none";
        string value2       = "none";
        string value3       = "steam";

        if (HMDManager.IsHmdDetected())
        {
            if (SteamVR.instance.hmd_TrackingSystemName == "oculus")
            {
                value = "oculus";
            }
            else
            {
                value = "vive";
            }
        }
        switch (VRCInputManager.GetLastUsedInputMethod())
        {
        case VRCInputMethod.Keyboard:
            value2 = "keyboard";
            break;

        case VRCInputMethod.Mouse:
            value2 = "keyboard";
            break;

        case VRCInputMethod.Controller:
            value2 = "controller";
            break;

        case VRCInputMethod.Vive:
            value2 = "hand";
            break;

        case VRCInputMethod.Oculus:
            value2 = "hand";
            break;
        }
        Dictionary <string, object> dictionary = new Dictionary <string, object>();

        dictionary["deviceId"]     = ApiModel.DeviceID;
        dictionary["buildType"]    = value3;
        dictionary["hmdType"]      = value;
        dictionary["inputType"]    = value2;
        dictionary["platform"]     = Application.platform.ToString();
        dictionary["store"]        = VRCApplicationSetup.GetBuildStoreID();
        dictionary["buildVersion"] = VRCApplicationSetup.GetBuildVersionString();
        Debug.Log("Sending deviceInfo analytic: " + string.Join(", ", (from kvp in dictionary
                                                                       select kvp.Key + " = " + kvp.Value).ToArray <string>()));
        base.StartCoroutine(this.SendUnityHmdAnalytic(analyticName, dictionary));
        global::Analytics.Send(ApiAnalyticEvent.EventType.deviceInfo, dictionary, null, null);
    }
Exemplo n.º 13
0
 // Token: 0x06005561 RID: 21857 RVA: 0x001D74C4 File Offset: 0x001D58C4
 private void ShowUISelectTooltip(string id, bool rightHand)
 {
     if (VRCInputManager.IsUsingHandController())
     {
         this.ActivateControllerLabel(id, (!rightHand) ? ControllerHand.Left : ControllerHand.Right, ControllerInputUI.Trigger, "Aim At Player And Press To Select", -1f, -1);
     }
     else
     {
         this.ActivateObjectLabel(null, id, TutorialLabelType.PopupAttached, ControllerHand.None, "Aim At Player And Press To Select", ControllerActionUI.UISelect, string.Empty, ControllerActionUI.None, -1f, -1, AttachMode.PositionOnly, true);
     }
 }
Exemplo n.º 14
0
 // Token: 0x06006191 RID: 24977 RVA: 0x00226DE2 File Offset: 0x002251E2
 public void SetValue(float val)
 {
     if (this._locked)
     {
         return;
     }
     if (!string.IsNullOrEmpty(this.PlayerPrefsString))
     {
         PlayerPrefs.SetFloat(this.PlayerPrefsString, val);
     }
     VRCInputManager.SettingsChanged(this.setting);
 }
Exemplo n.º 15
0
        // Token: 0x06005731 RID: 22321 RVA: 0x001E0768 File Offset: 0x001DEB68
        public static void SetNetworkProperties()
        {
            PhotonNetwork.player.NickName = User.CurrentUser.displayName;
            Hashtable hashtable = new Hashtable();

            hashtable.Add("modTag", VRCPlayer.LocalModTag);
            hashtable.Add("isInvisible", VRCPlayer.LocalIsInvisible);
            hashtable.Add("avatarBlueprint", User.CurrentUser.mApiAvatar);
            hashtable.Add("userId", User.CurrentUser.id);
            hashtable.Add("defaultMute", VRCInputManager.GetSetting(VRCInputManager.InputSetting.DefaultMute));
            hashtable.Add("inVRMode", VRCTrackingManager.IsInVRMode());
            PhotonNetwork.player.SetCustomProperties(hashtable, null, false);
        }
Exemplo n.º 16
0
 // Token: 0x060053F0 RID: 21488 RVA: 0x001CFA50 File Offset: 0x001CDE50
 private void Start()
 {
     this.controller = base.GetComponent <LocomotionInputController>();
     if (this.controller == null || !this.controller.enabled)
     {
         base.enabled = false;
     }
     this.motion = base.GetComponent <VRCMotionState>();
     if (this.motion == null)
     {
         base.enabled = false;
     }
     this.inJump = VRCInputManager.FindInput("Jump");
 }
Exemplo n.º 17
0
 // Token: 0x06004CD3 RID: 19667 RVA: 0x0019BE68 File Offset: 0x0019A268
 private void Start()
 {
     if (DefaultTalkController.Instance == null)
     {
         DefaultTalkController.Instance = this;
     }
     else
     {
         Debug.LogError("More than one DefaultTalkControllers exist! Destroying this one.");
         UnityEngine.Object.Destroy(this);
     }
     this.ToggleMode = ((!VRCInputManager.talkToggle) ? 0 : 1);
     this.inVoice    = VRCInputManager.FindInput("Voice");
 }
Exemplo n.º 18
0
 // Token: 0x060051B3 RID: 20915 RVA: 0x001BF110 File Offset: 0x001BD510
 protected virtual void Awake()
 {
     this.motionState          = base.GetComponent <VRCMotionState>();
     this.headCamMouseRotator  = VRCVrCamera.GetInstance().GetComponentInChildren <NeckMouseRotator>();
     this.inAxisHorizontal     = VRCInputManager.FindInput("Horizontal");
     this.inAxisVertical       = VRCInputManager.FindInput("Vertical");
     this.inComfortLeft        = VRCInputManager.FindInput("ComfortLeft");
     this.inComfortRight       = VRCInputManager.FindInput("ComfortRight");
     this.inAxisLookHorizontal = VRCInputManager.FindInput("LookHorizontal");
     this.inAxisLookVertical   = VRCInputManager.FindInput("LookVertical");
     this.inDrop = VRCInputManager.FindInput("DropRight");
     this.inRun  = VRCInputManager.FindInput("Run");
     InputStateController.lastPosition = VRCTrackingManager.GetWorldTrackingPosition();
     InputStateController.lastRotation = VRCTrackingManager.GetWorldTrackingOrientation();
 }
Exemplo n.º 19
0
 // Token: 0x0600554B RID: 21835 RVA: 0x001D6974 File Offset: 0x001D4D74
 public void PickupSelected(VRC_Pickup pickup, bool leftHand)
 {
     if (pickup.currentlyHeldBy != null)
     {
         return;
     }
     if (VRCInputManager.IsUsingHandController())
     {
         ControllerInputUI controllerPart = (VRCInputManager.LastInputMethod != VRCInputManager.InputMethod.Oculus) ? ControllerInputUI.Trigger : ControllerInputUI.Grip;
         this.ActivateControllerLabel((!leftHand) ? ControllerHand.Right : ControllerHand.Left, controllerPart, (!VRCHandGrasper.IsAutoEquipPickup(pickup)) ? "Hold to Grab" : "Equip", 0.1f, 0);
     }
     else if (!this.IsShowingOtherLabelOfType(TutorialLabelType.Pickup, pickup.transform))
     {
         this.ActivateObjectLabel(pickup.transform, TutorialLabelType.Pickup, (!leftHand) ? ControllerHand.Right : ControllerHand.Left, (!VRCInputManager.IsUsingAutoEquipControllerType() || !VRCHandGrasper.IsAutoEquipPickup(pickup)) ? "Hold to Grab" : "Equip", ControllerActionUI.Use, 0.1f, 0, AttachMode.PositionOnly, false);
     }
 }
Exemplo n.º 20
0
    // Token: 0x06005AC4 RID: 23236 RVA: 0x001FA784 File Offset: 0x001F8B84
    private IEnumerator ShowGetUpInstructions()
    {
        yield return(new WaitForSeconds(0.1f));

        if (this.Occupant != null)
        {
            if (VRCInputManager.IsUsingHandController())
            {
                TutorialManager.Instance.ActivateControllerLabel(ControllerHand.Left, ControllerInputUI.TrackpadTop, "Get Up", 10f, 0);
            }
            else
            {
                TutorialManager.Instance.ActivateObjectLabel(null, TutorialLabelType.Popup, ControllerHand.None, "Get Up", ControllerActionUI.Move, string.Empty, ControllerActionUI.None, 10f, 0, AttachMode.PositionOnly, true);
            }
        }
        yield break;
    }
Exemplo n.º 21
0
 // Token: 0x0600517A RID: 20858 RVA: 0x001BE92C File Offset: 0x001BCD2C
 private void AttemptToSendHmdAnalytic()
 {
     if (VRCInputManager.GetLastUsedInputMethod() != VRCInputMethod.Count)
     {
         if (!this.hasSentLoggedInHmdAnalytics && APIUser.IsLoggedIn)
         {
             this.SendHmdAnalytic();
             this.hasSentLoggedInHmdAnalytics  = true;
             this.hasSentAnonymousHmdAnalytics = true;
         }
         if (!this.hasSentAnonymousHmdAnalytics && VRCFlowManager.Instance.HasAttemptedCachedLogin)
         {
             this.SendHmdAnalytic();
             this.hasSentAnonymousHmdAnalytics = true;
         }
     }
 }
Exemplo n.º 22
0
    // Token: 0x0600554A RID: 21834 RVA: 0x001D688C File Offset: 0x001D4C8C
    public void InteractableSelected(VRC_Interactable[] interactable, Component useComponent, bool leftHand)
    {
        string text = (interactable == null || interactable.Length <= 0 || string.IsNullOrEmpty(interactable[0].interactText)) ? "Use" : interactable[0].interactText;

        if (text.CompareTo("Use") == 0 && useComponent.GetComponent <VRC_Station>() != null)
        {
            text = "Sit";
        }
        if (!this.IsShowingOtherLabelOfType(TutorialLabelType.Interactable, useComponent.transform))
        {
            this.ActivateObjectLabel(useComponent.transform, TutorialLabelType.Interactable, (!leftHand) ? ControllerHand.Right : ControllerHand.Left, text, (!VRCInputManager.IsUsingHandController()) ? ControllerActionUI.Use : ControllerActionUI.None, 0.1f, 0, AttachMode.PositionOnly, false);
        }
        if (VRCInputManager.IsUsingHandController())
        {
            ControllerInputUI controllerPart = (VRCInputManager.LastInputMethod != VRCInputManager.InputMethod.Oculus) ? ControllerInputUI.Trigger : ControllerInputUI.Grip;
            this.ActivateControllerLabel((!leftHand) ? ControllerHand.Right : ControllerHand.Left, controllerPart, text, 0.1f, 0);
        }
    }
Exemplo n.º 23
0
 // Token: 0x06005560 RID: 21856 RVA: 0x001D7448 File Offset: 0x001D5848
 private void ShowOpenMenuTooltip(string id)
 {
     if (VRCInputManager.IsUsingHandController())
     {
         if (VRCInputManager.LastInputMethod == VRCInputManager.InputMethod.Vive)
         {
             this.ActivateControllerLabel(id, ControllerHand.Left, ControllerInputUI.MenuButton, "Open Menu", -1f, -1);
         }
         if (VRCInputManager.LastInputMethod == VRCInputManager.InputMethod.Oculus)
         {
             this.ActivateControllerLabel(id, ControllerHand.Left, ControllerInputUI.ButtonTwo, "Open Menu", -1f, -1);
         }
     }
     else
     {
         this.ActivateObjectLabel(null, id, TutorialLabelType.PopupAttached, ControllerHand.None, "Open Menu", ControllerActionUI.UIMenu, string.Empty, ControllerActionUI.None, -1f, -1, AttachMode.PositionOnly, true);
     }
 }
Exemplo n.º 24
0
    // Token: 0x06006180 RID: 24960 RVA: 0x00226944 File Offset: 0x00224D44
    private void OnEnable()
    {
        if (!this.toggle)
        {
            return;
        }
        this._locked = VRCInputManager.ShouldForceGamelikeLocomotion();
        if (this._locked)
        {
            this.toggle.isOn         = (this.method == VRCInputManager.LocomotionMethod.Gamelike);
            this.toggle.interactable = false;
            return;
        }
        bool locked = this._locked;

        this._locked     = true;
        this.toggle.isOn = (VRCInputManager.locomotionMethod == this.method);
        this._locked     = locked;
    }
Exemplo n.º 25
0
    // Token: 0x06005626 RID: 22054 RVA: 0x001DAAB4 File Offset: 0x001D8EB4
    public static void SetInputSetting(VRCInputSetting setting, bool enable)
    {
        if (setting == VRCInputSetting.Locomotion3P)
        {
            VRCInputManager.locomotionMethod = ((!enable) ? VRCInputManager.LocomotionMethod.Gamelike : VRCInputManager.LocomotionMethod.ThirdPerson);
            VRCInputManager.SettingsChanged(VRCInputManager.InputSetting.Unknown);
            return;
        }
        VRCInputManager.InputSetting inputSetting = VRCInputManager.InputSetting.ComfortTurning;
        bool        flag       = false;
        IEnumerator enumerator = Enum.GetValues(typeof(VRCInputManager.InputSetting)).GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object obj = enumerator.Current;
                VRCInputManager.InputSetting inputSetting2 = (VRCInputManager.InputSetting)obj;
                if (inputSetting2.ToString().CompareTo(setting.ToString()) == 0)
                {
                    flag         = true;
                    inputSetting = inputSetting2;
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
        if (flag)
        {
            VRCInputManager.SetSetting(inputSetting, enable);
            VRCInputManager.SettingsChanged(inputSetting);
        }
        else
        {
            Debug.LogError("SetInputSetting: could not find setting: " + setting.ToString());
        }
    }
Exemplo n.º 26
0
 // Token: 0x06006190 RID: 24976 RVA: 0x00226D74 File Offset: 0x00225174
 public void SetEnable(bool on)
 {
     if (this._locked)
     {
         return;
     }
     if (this.invertSetting)
     {
         on = !on;
     }
     if (string.IsNullOrEmpty(this.PlayerPrefsString))
     {
         VRCInputManager.SetSetting(this.setting, on);
     }
     else
     {
         PlayerPrefs.SetInt(this.PlayerPrefsString, (!on) ? 0 : 1);
     }
     VRCInputManager.SettingsChanged(this.setting);
 }
Exemplo n.º 27
0
    // Token: 0x06006005 RID: 24581 RVA: 0x0021C9C4 File Offset: 0x0021ADC4
    private void SetupControlModeTip()
    {
        bool flag = false;

        if (!VRCInputManager.talkToggle && !VRCInputManager.talkDefaultOn)
        {
            flag = true;
        }
        if (VRCInputManager.showTooltips && flag)
        {
            if (VRCTrackingManager.IsInVRMode())
            {
                this.controllerMode = 0;
            }
            else if (VRCInputManager.IsPresent(VRCInputManager.InputMethod.Keyboard) && VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Keyboard))
            {
                this.controllerMode = 2;
            }
            switch (this.controllerMode)
            {
            case 0:
                break;

            case 1:
                this.xboxTip.SetActive(true);
                this.tipActive = true;
                break;

            case 2:
                this.keybdTip.SetActive(true);
                this.tipActive = true;
                break;

            default:
                Debug.LogError("HudVoiceIndicator: Unknown control method=" + this.controllerMode);
                break;
            }
        }
        this.controlModeChecked = true;
    }
Exemplo n.º 28
0
 // Token: 0x06004F17 RID: 20247 RVA: 0x001AA2CC File Offset: 0x001A86CC
 public void Initialize(IkController.IkType ikType, Animator modelAnimator, VRCPlayer player, bool local)
 {
     this._player                  = player;
     this.isLocalPlayer            = local;
     this.animationController      = base.GetComponentInParent <VRC_AnimationController>();
     this._completedUSpeakMove     = false;
     this._reportedUSpeakMoveError = false;
     this._elapsedUSpeakTimeToMove = 0f;
     this._useLimbIK               = false;
     this._useVrcTrackedIk         = false;
     if (modelAnimator != null && modelAnimator.isHuman && modelAnimator.runtimeAnimatorController != null)
     {
         this._modelAnimator = modelAnimator;
         this.SetIkType(ikType, false);
         this._locoLayer = this.GetMatchingLayerIndex(this._modelAnimator, "locomotion");
     }
     else
     {
         this._modelAnimator = null;
         this._locoLayer     = -1;
     }
     if (local)
     {
         this.leftHandGrasper            = this.LeftEffector.gameObject.AddMissingComponent <VRCHandGrasper>();
         this.leftHandGrasper.DropInput  = VRCInputManager.FindInput("DropLeft");
         this.leftHandGrasper.UseInput   = VRCInputManager.FindInput("UseLeft");
         this.leftHandGrasper.GrabInput  = VRCInputManager.FindInput("GrabLeft");
         this.leftHandGrasper.RightHand  = false;
         this.rightHandGrasper           = this.RightEffector.gameObject.AddMissingComponent <VRCHandGrasper>();
         this.rightHandGrasper.DropInput = VRCInputManager.FindInput("DropRight");
         this.rightHandGrasper.UseInput  = VRCInputManager.FindInput("UseRight");
         this.rightHandGrasper.GrabInput = VRCInputManager.FindInput("GrabRight");
         this.rightHandGrasper.RightHand = true;
     }
     this.motion = this.animationController.GetComponentInParent <VRCMotionState>();
     this.motion.StandingHeight = 1f;
     this._inited = true;
     this._completedUSpeakMove = false;
 }
Exemplo n.º 29
0
    // Token: 0x06006179 RID: 24953 RVA: 0x00226718 File Offset: 0x00224B18
    public void PressEdit()
    {
        VRCInputManager.UseKeyboardOnlyForText(true);
        string placeholderText = string.IsNullOrEmpty(this.placeholderInputText) ? ((!(this.placeholder == null)) ? this.placeholder.text : string.Empty) : this.placeholderInputText;

        if (this.isDate)
        {
            VRCUiPopupManager.Instance.ShowDatePopupWithCancel(this.title, this.text, this.inputType, "OK", new Action <string, List <KeyCode>, Text>(this.StringAccepted), new Action(this.StringRejected), placeholderText, true, delegate(VRCUiPopup obj)
            {
                VRCUiPopupDate vrcuiPopupDate = (VRCUiPopupDate)obj;
                vrcuiPopupDate.nextInputField = this.nextInputField;
            });
        }
        else
        {
            VRCUiPopupManager.Instance.ShowInputPopupWithCancel(this.title, this.text, this.inputType, "OK", new Action <string, List <KeyCode>, Text>(this.StringAccepted), new Action(this.StringRejected), placeholderText, true, delegate(VRCUiPopup obj)
            {
                VRCUiPopupJsKeyboard vrcuiPopupJsKeyboard = (VRCUiPopupJsKeyboard)obj;
                vrcuiPopupJsKeyboard.nextInputField       = this.nextInputField;
            });
        }
    }
Exemplo n.º 30
0
    // Token: 0x06005625 RID: 22053 RVA: 0x001DA9E4 File Offset: 0x001D8DE4
    public static bool GetInputSetting(VRCInputSetting setting)
    {
        if (setting == VRCInputSetting.Locomotion3P)
        {
            return(VRCInputManager.locomotionMethod == VRCInputManager.LocomotionMethod.ThirdPerson);
        }
        VRCInputManager.InputSetting setting2 = VRCInputManager.InputSetting.ComfortTurning;
        bool        flag       = false;
        IEnumerator enumerator = Enum.GetValues(typeof(VRCInputManager.InputSetting)).GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object obj = enumerator.Current;
                VRCInputManager.InputSetting inputSetting = (VRCInputManager.InputSetting)obj;
                if (inputSetting.ToString().CompareTo(setting.ToString()) == 0)
                {
                    flag     = true;
                    setting2 = inputSetting;
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
        if (flag)
        {
            return(VRCInputManager.GetSetting(setting2));
        }
        Debug.LogError("GetInputSetting: could not find setting: " + setting.ToString());
        return(false);
    }