예제 #1
0
 private static void DiffTimeScale(FVRWristMenu __instance, int dir)
 {
     Time.timeScale      += _timeScaleIncrement.Value * dir;
     Time.fixedDeltaTime  = Time.timeScale / SteamVR.instance.hmd_DisplayFrequency;
     Time.timeScale       = Mathf.Clamp(Time.timeScale, 0f, 1f);
     __instance.Aud.pitch = 1f;
     __instance.Aud.PlayOneShot(__instance.AudClip_Engage, 1f);
 }
예제 #2
0
 public static void UpdateTimeScaleText(FVRWristMenu __instance, bool ___m_isActive)
 {
     if (___m_isActive)
     {
         __instance.Clock.text = $"Time Scale: {Time.timeScale.ToString(CultureInfo.InvariantCulture)}";
         if (!String.IsNullOrEmpty(_wristMenuDateTimeFormat.Value))
         {
             try { __instance.Clock.text += $"\n{DateTime.Now.ToString(_wristMenuDateTimeFormat.Value)}"; }
             catch { } //yes I know this is bad but if users want custom things in their wrist menu, let them
         }
     }
 }
예제 #3
0
        private void CreateWristMenuButtons()
        {
            _log.LogDebug("Adding wristmenu buttons...");

            // Get wristmenu and set to active or else Find won't work
            WristMenu = Resources.FindObjectsOfTypeAll <FVRWristMenu>().First();
            WristMenu.gameObject.SetActive(true);

            // Get the canvas and button sets
            var canvasTF = WristMenu.transform.Find("MenuGo/Canvas");
            var canvasRT = canvasTF.GetComponent <RectTransform>();
            var canvasBS = canvasTF.GetComponent <OptionsPanel_ButtonSet>();

            ref var images = ref canvasBS.ButtonImagesInSet;
예제 #4
0
        public static void UpdateTimeScaleText(FVRWristMenu __instance, bool ___m_isActive, bool ___m_hasHands, FVRViveHand ___m_currentHand)
        {
            if (___m_isActive)
            {
                if (__instance.Clock.alignment != TextAnchor.LowerCenter)
                {
                    __instance.Clock.rectTransform.anchoredPosition = new Vector2(0f, 7.8f);
                    __instance.Clock.alignment = TextAnchor.LowerCenter;
                }

                Helpers.H3Info info = Helpers.H3Info.FPS | Helpers.H3Info.DateTime | Helpers.H3Info.Position | Helpers.H3Info.Health | Helpers.H3Info.Scene;
                if (___m_hasHands)
                {
                    info |= ___m_currentHand.IsThisTheRightHand ? Helpers.H3Info.ControllerR : Helpers.H3Info.ControllerL;
                }
                __instance.Clock.text = Helpers.H3InfoPrint(info) + "\nH3 Enhanced Wrist Menu";
            }
        }
예제 #5
0
 public static void OverflowClockText(FVRWristMenu __instance)
 {
     __instance.SetSelectedButton(0);
     __instance.Clock.verticalOverflow   = VerticalWrapMode.Overflow;
     __instance.Clock.horizontalOverflow = HorizontalWrapMode.Overflow;
 }
예제 #6
0
 public static bool DecreaseTimeScale(FVRWristMenu __instance)
 {
     DiffTimeScale(__instance, -1);
     return(false);
 }