Ejemplo n.º 1
0
        public void UpdateKeyboard(object o, EventArgs args)
        {
            var teraWindowActive  = TeraWindow.IsTeraActive();
            var meterWindowActive = TeraWindow.IsMeterActive();

            if (KeyboardHook.Instance.SetHotkeys(teraWindowActive))
            {
                StayTopMost();
            }

            if (!BasicTeraData.Instance.WindowData.AlwaysVisible)
            {
                if (!teraWindowActive && !meterWindowActive)
                {
                    HideWindow(); //Visibility = Visibility.Hidden;
                    ForceWindowVisibilityHidden = true;
                }

                if ((meterWindowActive || teraWindowActive) && (BasicTeraData.Instance.WindowData.InvisibleUi && Controls.Count > 0 ||
                                                                !BasicTeraData.Instance.WindowData.InvisibleUi))
                {
                    ForceWindowVisibilityHidden = false;
                    ShowWindow(); //Visibility = Visibility.Visible;
                }
            }
            else
            {
                ForceWindowVisibilityHidden = false;
            }
        }
Ejemplo n.º 2
0
        public void UpdateKeyboard(object o, EventArgs args)
        {
            var teraWindowActive  = TeraWindow.IsTeraActive();
            var meterWindowActive = TeraWindow.IsMeterActive();

            if (!_keyboardInitialized)
            {
                KeyboardHook.Instance.RegisterKeyboardHook();
                _keyboardInitialized = true;
            }
            else
            {
                if (KeyboardHook.Instance.SetHotkeys(teraWindowActive))
                {
                    StayTopMost();
                }
            }

            if (!BasicTeraData.Instance.WindowData.AlwaysVisible)
            {
                if (!teraWindowActive && !meterWindowActive)
                {
                    Visibility = Visibility.Hidden;
                    _forceWindowVisibilityHidden = true;
                }

                if ((meterWindowActive || teraWindowActive) && ((BasicTeraData.Instance.WindowData.InvisibleUI && Controls.Count > 0) || !BasicTeraData.Instance.WindowData.InvisibleUI))
                {
                    _forceWindowVisibilityHidden = false;
                    Visibility = Visibility.Visible;
                }
            }
            else
            {
                _forceWindowVisibilityHidden = false;
            }
        }