mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add ability to make cursor show even during touch input
I completely disagree with this from a UX perspective, but it's come up so often that I figure we should just let users bone themselves.
This commit is contained in:
@ -91,6 +91,7 @@ namespace osu.Game.Configuration
|
|||||||
// Input
|
// Input
|
||||||
SetDefault(OsuSetting.MenuCursorSize, 1.0f, 0.5f, 2f, 0.01f);
|
SetDefault(OsuSetting.MenuCursorSize, 1.0f, 0.5f, 2f, 0.01f);
|
||||||
SetDefault(OsuSetting.GameplayCursorSize, 1.0f, 0.1f, 2f, 0.01f);
|
SetDefault(OsuSetting.GameplayCursorSize, 1.0f, 0.1f, 2f, 0.01f);
|
||||||
|
SetDefault(OsuSetting.GameplayCursorDuringTouch, false);
|
||||||
SetDefault(OsuSetting.AutoCursorSize, false);
|
SetDefault(OsuSetting.AutoCursorSize, false);
|
||||||
|
|
||||||
SetDefault(OsuSetting.MouseDisableButtons, false);
|
SetDefault(OsuSetting.MouseDisableButtons, false);
|
||||||
@ -292,6 +293,7 @@ namespace osu.Game.Configuration
|
|||||||
MenuCursorSize,
|
MenuCursorSize,
|
||||||
GameplayCursorSize,
|
GameplayCursorSize,
|
||||||
AutoCursorSize,
|
AutoCursorSize,
|
||||||
|
GameplayCursorDuringTouch,
|
||||||
DimLevel,
|
DimLevel,
|
||||||
BlurLevel,
|
BlurLevel,
|
||||||
LightenDuringBreaks,
|
LightenDuringBreaks,
|
||||||
|
@ -3,16 +3,20 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.StateChanges;
|
using osu.Framework.Input.StateChanges;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Cursor
|
namespace osu.Game.Graphics.Cursor
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A container which provides a <see cref="MenuCursor"/> which can be overridden by hovered <see cref="Drawable"/>s.
|
/// A container which provides a <see cref="MenuCursor"/>.
|
||||||
|
/// It also handles cases where a more localised cursor is provided by another component (via <see cref="IProvideCursor"/>).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MenuCursorContainer : Container, IProvideCursor
|
public class MenuCursorContainer : Container, IProvideCursor
|
||||||
{
|
{
|
||||||
@ -36,12 +40,19 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Bindable<bool> showDuringTouch;
|
||||||
|
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
inputManager = GetContainingInputManager();
|
inputManager = GetContainingInputManager();
|
||||||
|
|
||||||
|
showDuringTouch = config.GetBindable<bool>(OsuSetting.GameplayCursorDuringTouch);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IProvideCursor currentTarget;
|
private IProvideCursor currentTarget;
|
||||||
@ -51,7 +62,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
var lastMouseSource = inputManager.CurrentState.Mouse.LastSource;
|
var lastMouseSource = inputManager.CurrentState.Mouse.LastSource;
|
||||||
bool hasValidInput = lastMouseSource != null && !(lastMouseSource is ISourcedFromTouch);
|
bool hasValidInput = lastMouseSource != null && (showDuringTouch.Value || lastMouseSource is not ISourcedFromTouch);
|
||||||
|
|
||||||
if (!hasValidInput || !CanShowCursor)
|
if (!hasValidInput || !CanShowCursor)
|
||||||
{
|
{
|
||||||
|
@ -34,6 +34,11 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString AutoCursorSize => new TranslatableString(getKey(@"auto_cursor_size"), @"Adjust gameplay cursor size based on current beatmap");
|
public static LocalisableString AutoCursorSize => new TranslatableString(getKey(@"auto_cursor_size"), @"Adjust gameplay cursor size based on current beatmap");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Show gameplay cursor during touch input"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString GameplayCursorDuringTouch => new TranslatableString(getKey(@"gameplay_cursor_during_touch"), @"Show gameplay cursor during touch input");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Beatmap skins"
|
/// "Beatmap skins"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -32,6 +32,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
LabelText = SkinSettingsStrings.AutoCursorSize,
|
LabelText = SkinSettingsStrings.AutoCursorSize,
|
||||||
Current = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
|
Current = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
|
||||||
},
|
},
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = SkinSettingsStrings.GameplayCursorDuringTouch,
|
||||||
|
Current = config.GetBindable<bool>(OsuSetting.GameplayCursorDuringTouch)
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows)
|
if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows)
|
||||||
|
Reference in New Issue
Block a user