Skip to content

Commit

Permalink
Merge pull request #613 from dlamkins/feat/action-cam-support
Browse files Browse the repository at this point in the history
Cleaned up some control edge cases.
  • Loading branch information
dlamkins authored Feb 24, 2022
2 parents 5a5d93a + 039a31d commit a79ec07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Blish HUD/Controls/Tooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal static void EnableTooltips() {
}

private static void HandleMouseMoved(object sender, MouseEventArgs e) {
if (ActiveControl?.Tooltip != null) {
if (ActiveControl?.Tooltip != null && GameService.Input.Mouse.CursorIsVisible) {
ActiveControl.Tooltip.CurrentControl = ActiveControl;
UpdateTooltipPosition(ActiveControl.Tooltip);

Expand Down
15 changes: 14 additions & 1 deletion Blish HUD/GameServices/Input/Mouse/MouseHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,25 @@ private set {
}
}

private bool _cursorIsVisible = true;

/// <summary>
/// Indicates if the hardware mouse is currently visible. When <c>false</c>,
/// this typically indicates that the user is rotating their camera or in action
/// camera mode.
/// </summary>
public bool CursorIsVisible { get; private set; }
public bool CursorIsVisible {
get => _cursorIsVisible;
set {
if (_cursorIsVisible == value) return;

if (!value) {
this.ActiveControl = null;
}

_cursorIsVisible = value;
}
}

private bool _hudFocused;
private MouseEventArgs _mouseEvent;
Expand Down

0 comments on commit a79ec07

Please sign in to comment.