mirror of
https://github.com/osukey/osukey.git
synced 2025-05-05 13:47:19 +09:00
Keep cursor hiding feature to gameplay screens for now
This commit is contained in:
parent
31f499a950
commit
4bf4938b72
@ -23,6 +23,21 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
private readonly IBindable<bool> screenshotCursorVisibility = new Bindable<bool>(true);
|
private readonly IBindable<bool> screenshotCursorVisibility = new Bindable<bool>(true);
|
||||||
public override bool IsPresent => screenshotCursorVisibility.Value && base.IsPresent;
|
public override bool IsPresent => screenshotCursorVisibility.Value && base.IsPresent;
|
||||||
|
|
||||||
|
private bool hideCursorOnNonMouseInput;
|
||||||
|
|
||||||
|
public bool HideCursorOnNonMouseInput
|
||||||
|
{
|
||||||
|
get => hideCursorOnNonMouseInput;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (hideCursorOnNonMouseInput == value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
hideCursorOnNonMouseInput = value;
|
||||||
|
updateState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override Drawable CreateCursor() => activeCursor = new Cursor();
|
protected override Drawable CreateCursor() => activeCursor = new Cursor();
|
||||||
|
|
||||||
private Cursor activeCursor = null!;
|
private Cursor activeCursor = null!;
|
||||||
@ -75,7 +90,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
|
|
||||||
private void updateState()
|
private void updateState()
|
||||||
{
|
{
|
||||||
bool combinedVisibility = State.Value == Visibility.Visible && lastInputWasMouse.Value && !isIdle.Value;
|
bool combinedVisibility = State.Value == Visibility.Visible && (lastInputWasMouse.Value || !hideCursorOnNonMouseInput) && !isIdle.Value;
|
||||||
|
|
||||||
if (visible == combinedVisibility)
|
if (visible == combinedVisibility)
|
||||||
return;
|
return;
|
||||||
|
@ -1333,6 +1333,8 @@ namespace osu.Game
|
|||||||
OverlayActivationMode.BindTo(newOsuScreen.OverlayActivationMode);
|
OverlayActivationMode.BindTo(newOsuScreen.OverlayActivationMode);
|
||||||
API.Activity.BindTo(newOsuScreen.Activity);
|
API.Activity.BindTo(newOsuScreen.Activity);
|
||||||
|
|
||||||
|
GlobalCursorDisplay.MenuCursor.HideCursorOnNonMouseInput = newOsuScreen.HideMenuCursorOnNonMouseInput;
|
||||||
|
|
||||||
if (newOsuScreen.HideOverlaysOnEnter)
|
if (newOsuScreen.HideOverlaysOnEnter)
|
||||||
CloseAllOverlays();
|
CloseAllOverlays();
|
||||||
else
|
else
|
||||||
|
@ -41,6 +41,11 @@ namespace osu.Game.Screens
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
bool HideOverlaysOnEnter { get; }
|
bool HideOverlaysOnEnter { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the menu cursor should be hidden when non-mouse input is received.
|
||||||
|
/// </summary>
|
||||||
|
bool HideMenuCursorOnNonMouseInput { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether overlays should be able to be opened when this screen is current.
|
/// Whether overlays should be able to be opened when this screen is current.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -40,11 +40,10 @@ namespace osu.Game.Screens
|
|||||||
|
|
||||||
public virtual bool AllowExternalScreenChange => false;
|
public virtual bool AllowExternalScreenChange => false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether all overlays should be hidden when this screen is entered or resumed.
|
|
||||||
/// </summary>
|
|
||||||
public virtual bool HideOverlaysOnEnter => false;
|
public virtual bool HideOverlaysOnEnter => false;
|
||||||
|
|
||||||
|
public virtual bool HideMenuCursorOnNonMouseInput => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The initial overlay activation mode to use when this screen is entered for the first time.
|
/// The initial overlay activation mode to use when this screen is entered for the first time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -66,6 +66,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public override bool HideOverlaysOnEnter => true;
|
public override bool HideOverlaysOnEnter => true;
|
||||||
|
|
||||||
|
public override bool HideMenuCursorOnNonMouseInput => true;
|
||||||
|
|
||||||
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered;
|
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered;
|
||||||
|
|
||||||
// We are managing our own adjustments (see OnEntering/OnExiting).
|
// We are managing our own adjustments (see OnEntering/OnExiting).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user