Add the ability to toggle off hit marker displays in the editor

This commit is contained in:
Dean Herbert
2022-11-08 18:07:06 +09:00
parent 30700ee68b
commit ada039151b
5 changed files with 59 additions and 15 deletions

View File

@ -3,7 +3,10 @@
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Primitives;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
@ -23,6 +26,11 @@ namespace osu.Game.Rulesets.Edit
/// </summary>
protected virtual bool AlwaysShowWhenSelected => false;
/// <summary>
/// Whether extra animations should be shown to convey hit position / state in addition to gameplay animations.
/// </summary>
protected Bindable<bool> ShowHitMarkers { get; private set; }
protected override bool ShouldBeAlive => (DrawableObject?.IsAlive == true && DrawableObject.IsPresent) || (AlwaysShowWhenSelected && State == SelectionState.Selected);
protected HitObjectSelectionBlueprint(HitObject hitObject)
@ -30,6 +38,12 @@ namespace osu.Game.Rulesets.Edit
{
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
ShowHitMarkers = config.GetBindable<bool>(OsuSetting.EditorShowHitMarkers);
}
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => DrawableObject.ReceivePositionalInputAt(screenSpacePos);
public override Vector2 ScreenSpaceSelectionPoint => DrawableObject.ScreenSpaceDrawQuad.Centre;