コード例 #1
0
        private void UiManagerInit()
        {
            MelonLogger.Msg("BTK Standalone: Immersive Hud - Starting Up");

            Instance = this;

            if (MelonHandler.Mods.Any(x => x.Info.Name.Equals("BTKCompanionLoader", StringComparison.OrdinalIgnoreCase)))
            {
                MelonLogger.Msg("Hold on a sec! Looks like you've got BTKCompanion installed, this mod is built in and not needed!");
                MelonLogger.Error("BTKSAImmersiveHud has not started up! (BTKCompanion Running)");
                return;
            }

            MelonPreferences.CreateCategory(SettingsCategory, "Immersive Hud");
            MelonPreferences.CreateEntry(SettingsCategory, HUDEnable, true, "Immersive Hud Enable");
            MelonPreferences.CreateEntry(SettingsCategory, HUDStayOnUntilClear, false, "Keep Hud Visible Until Notification Cleared");
            MelonPreferences.CreateEntry(SettingsCategory, HUDTimeout, 10f, "Hud Appear Duration");

            //Apply patches
            applyPatches(typeof(RoomManagerPatches));

            //Register our MonoBehavior to let us use OnEnable
            ClassInjector.RegisterTypeInIl2Cpp <HudEvent>();

            DefaultTalkController.Method_Public_Static_add_Void_Action_0(new Action(OnHudUpdateEvent));

            hudContent         = GameObject.Find("/UserInterface/UnscaledUI/HudContent/Hud");
            gestureParent      = GameObject.Find("/UserInterface/UnscaledUI/HudContent/Hud/GestureToggleParent");
            notificationParent = GameObject.Find("/UserInterface/UnscaledUI/HudContent/Hud/NotificationDotParent");
            afkParent          = GameObject.Find("/UserInterface/UnscaledUI/HudContent/Hud/AFK");
        }
コード例 #2
0
 // Token: 0x06006008 RID: 24584 RVA: 0x0021CB68 File Offset: 0x0021AF68
 private void Update()
 {
     if (VRCPlayer.Instance != null)
     {
         if (!this.controlModeChecked)
         {
             this.SetupControlModeTip();
         }
         if (DefaultTalkController.IsLive())
         {
             this.dotImage.enabled         = true;
             this.dotDisabledImage.enabled = false;
             if (VRCPlayer.Instance.isSpeaking)
             {
                 this.dotImage.color = this.dotColor;
             }
             else
             {
                 this.dotImage.color = new Color(this.dotColor.r, this.dotColor.g, this.dotColor.b, this.dotColor.a / 2f);
             }
         }
         else
         {
             this.dotImage.enabled = false;
             if (this.tipActive)
             {
                 if (!VRCInputManager.talkToggle && !VRCInputManager.talkDefaultOn)
                 {
                     if (this.inVoice.down)
                     {
                         this.DisableTips();
                     }
                     this.FlashMute();
                 }
                 else
                 {
                     this.DisableTips();
                 }
             }
             else
             {
                 this.dotDisabledImage.enabled = true;
             }
         }
     }
     else
     {
         this.dotImage.enabled         = false;
         this.dotDisabledImage.enabled = false;
     }
 }
コード例 #3
0
        public override void OnUpdate()
        {
            if (m_enabled)
            {
                if (!m_controllerManager)
                {
                    FindControllerManager();
                }

                if (m_controllerManager)
                {
                    if (!m_trackedController)
                    {
                        FindTrackedController();
                    }

                    if (m_trackedController)
                    {
                        m_trackedController.Update();

                        if (m_buttonOldState != m_trackedController.field_Public_Boolean_2)
                        {
                            m_buttonOldState = m_trackedController.field_Public_Boolean_2;
                            if (m_buttonOldState)
                            {
                                long l_tick = System.DateTime.Now.Ticks;
                                if ((l_tick - m_lastToggleTick) < m_toggleDelay)
                                {
                                    DefaultTalkController.Method_Public_Static_Void_0();
                                    m_lastToggleTick = l_tick - (m_toggleDelay * 2L);
                                }
                                else
                                {
                                    m_lastToggleTick = l_tick;
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #4
0
 // Token: 0x06004CD5 RID: 19669 RVA: 0x0019BF2C File Offset: 0x0019A32C
 public bool ShouldSend()
 {
     return(DefaultTalkController.IsLive());
 }