Exemple #1
0
        public void Update()
        {
            var state = Helper.GameWindowState;

            if (state == WindowState.Maximized)
            {
                state = WindowState.Normal;
            }
            if (_activated && state != WindowState.Minimized)
            {
                _activated = false;
                User32.BringHsToForeground();
            }
            if (ForcedWindowState == state)
            {
                return;
            }
            ForcedWindowState = state;
            if (!_initialized)
            {
                _initialized = true;
                UpdateSize();
                UpdatePosition();
            }
            if (WindowState != state)
            {
                WindowState = state;
            }
        }
 public void ShowOverlay(bool enable)
 {
     if (enable)
     {
         Show();
         if (User32.GetForegroundWindow() == new WindowInteropHelper(this).Handle)
         {
             User32.BringHsToForeground();
         }
     }
     else
     {
         Hide();
     }
 }
        internal static void OnFriendlyChallenge(object sender, HearthWatcher.EventArgs.FriendlyChallengeEventArgs args)
        {
            if (args.DialogVisible)
            {
                switch (Config.Instance.ChallengeAction)
                {
                case HsActionType.Flash:
                    User32.FlashHs();
                    break;

                case HsActionType.Popup:
                    User32.BringHsToForeground();
                    break;
                }
            }
        }
 public void ShowOverlay(bool enable)
 {
     if (enable)
     {
         try
         {
             Show();
         }
         catch (InvalidOperationException e)
         {
             Log.Error(e);
         }
         if (User32.GetForegroundWindow() == new WindowInteropHelper(this).Handle)
         {
             User32.BringHsToForeground();
         }
     }
     else
     {
         Hide();
     }
 }