コード例 #1
0
        void LateUpdate()
        {
            if (HighLogic.CurrentGame == null ||
                ClearInputLocks.focusFollowsclick) // ||
            //(!HighLogic.CurrentGame.Parameters.CustomParams<CTB>().focusFollowsclick && !HighLogic.LoadedSceneIsEditor))
            {
                return;
            }

            d = -1;
            ClickThruBlocker.CTBWin win = null;
            {
                foreach (var w in ClickThruBlocker.winList)
                {
                    //Log.Info("LateUpdate, w.Value.lastUpdated: " + w.Value.lastUpdated);
                    if (w.Value.lastUpdated + 4 < CBTGlobalMonitor.globalTimeTics) //+ 0.05 < Planetarium.GetUniversalTime())
                    {
                        d   = w.Key;
                        win = w.Value;
                        break;
                    }
                }
                if (d != -1)
                {
                    win.OnDestroy();
                }
            }
        }
コード例 #2
0
        void LateUpdate()
        {
            if (HighLogic.CurrentGame.Parameters.CustomParams <CTB>().focusFollowsclick)
            {
                return;
            }

            d = 0;
            ClickThruBlocker.CTBWin win = null;
            //timeTics++;
            {
                foreach (var w in ClickThruBlocker.winList)
                {
                    if (w.Value.lastUpdated + 4 < CBTGlobalMonitor.globalTimeTics) //+ 0.05 < Planetarium.GetUniversalTime())
                    {
                        d   = w.Key;
                        win = w.Value;
                        break;
                    }
                }
                if (d != 0)
                {
                    win.OnDestroy();
                }
            }
        }
コード例 #3
0
        void LateUpdate()
        {
            d = 0;
            ClickThruBlocker.CTBWin win = null;

            timeTics++;

            foreach (var w in  ClickThruBlocker.winList)
            {
                if (w.Value.lastUpdated + 4 < timeTics) //+ 0.05 < Planetarium.GetUniversalTime())
                {
                    d   = w.Key;
                    win = w.Value;
                    break;
                }
            }
            if (d != 0)
            {
                win.OnDestroy();
            }
        }
コード例 #4
0
        internal static void SetLock(string lockName, ClickThruBlocker.CTBWin win, int i)
        {
            FocusLock focusLock;

            if (HighLogic.LoadedSceneIsEditor)
            {
                EditorLogic.fetch.Lock(true, true, true, lockName);
            }
            else
            {
                InputLockManager.SetControlLock(ControlTypes.ALLBUTCAMERAS, lockName);
            }

            if (focusLockDict.TryGetValue(lockName, out focusLock))
            {
                focusLock.cnt = CBTGlobalMonitor.globalTimeTics;
            }
            else
            {
                focusLockDict.Add(lockName, new FocusLock(lockName, win));
            }
        }
コード例 #5
0
 internal FocusLock(string lockName, ClickThruBlocker.CTBWin win)
 {
     this.lockName = lockName;
     cnt           = CBTGlobalMonitor.globalTimeTics;
     this.win      = win;
 }