2024-02-01 15:19:09 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2024-02-23 03:34:38 +00:00
|
|
|
using osu.Framework.Allocation;
|
2024-02-01 15:19:09 +00:00
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Localisation;
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
using osu.Game.Screens.Play.PlayerSettings;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.UI
|
|
|
|
{
|
|
|
|
public partial class OsuAnalysisSettings : AnalysisSettings
|
|
|
|
{
|
2024-02-23 00:01:52 +00:00
|
|
|
protected new DrawableOsuRuleset DrawableRuleset => (DrawableOsuRuleset)base.DrawableRuleset;
|
2024-02-01 15:19:09 +00:00
|
|
|
|
|
|
|
private readonly PlayerCheckbox hitMarkerToggle;
|
|
|
|
private readonly PlayerCheckbox aimMarkerToggle;
|
|
|
|
private readonly PlayerCheckbox hideCursorToggle;
|
2024-02-10 07:02:26 +00:00
|
|
|
private readonly PlayerCheckbox aimLinesToggle;
|
2024-02-01 15:19:09 +00:00
|
|
|
|
|
|
|
public OsuAnalysisSettings(DrawableRuleset drawableRuleset)
|
|
|
|
: base(drawableRuleset)
|
|
|
|
{
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
hitMarkerToggle = new PlayerCheckbox { LabelText = PlayerSettingsOverlayStrings.HitMarkers },
|
|
|
|
aimMarkerToggle = new PlayerCheckbox { LabelText = PlayerSettingsOverlayStrings.AimMarkers },
|
2024-02-10 07:02:26 +00:00
|
|
|
aimLinesToggle = new PlayerCheckbox { LabelText = PlayerSettingsOverlayStrings.AimLines },
|
2024-02-22 04:23:40 +00:00
|
|
|
hideCursorToggle = new PlayerCheckbox { LabelText = PlayerSettingsOverlayStrings.HideCursor }
|
2024-02-01 15:19:09 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2024-02-23 03:34:38 +00:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
2024-02-01 15:19:09 +00:00
|
|
|
{
|
2024-02-23 00:01:52 +00:00
|
|
|
DrawableRuleset.Playfield.MarkersContainer.HitMarkerEnabled.BindTo(hitMarkerToggle.Current);
|
|
|
|
DrawableRuleset.Playfield.MarkersContainer.AimMarkersEnabled.BindTo(aimMarkerToggle.Current);
|
|
|
|
DrawableRuleset.Playfield.MarkersContainer.AimLinesEnabled.BindTo(aimLinesToggle.Current);
|
2024-02-01 15:19:09 +00:00
|
|
|
hideCursorToggle.Current.BindValueChanged(onCursorToggle);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void onCursorToggle(ValueChangedEvent<bool> hide)
|
|
|
|
{
|
|
|
|
// this only hides half the cursor
|
|
|
|
if (hide.NewValue)
|
|
|
|
{
|
2024-02-23 00:01:52 +00:00
|
|
|
DrawableRuleset.Playfield.Cursor.FadeOut();
|
|
|
|
}
|
|
|
|
else
|
2024-02-01 15:19:09 +00:00
|
|
|
{
|
2024-02-23 00:01:52 +00:00
|
|
|
DrawableRuleset.Playfield.Cursor.FadeIn();
|
2024-02-01 15:19:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-23 00:01:52 +00:00
|
|
|
}
|