1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 00:52:56 +08:00

Add opacity setting

This commit is contained in:
Dan Balasescu 2024-04-04 18:20:30 +09:00 committed by Dean Herbert
parent 39337f5189
commit e3f2e1ba08
No known key found for this signature in database

View File

@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Mania.UI
{
public partial class ManiaTouchInputOverlay : CompositeDrawable, ISerialisableDrawable
{
[SettingSource("Spacing", "The spacing between input receptors.")]
[SettingSource("Spacing", "The spacing between receptors.")]
public BindableFloat Spacing { get; } = new BindableFloat(10)
{
Precision = 1,
@ -24,6 +24,14 @@ namespace osu.Game.Rulesets.Mania.UI
MaxValue = 100,
};
[SettingSource("Opacity", "The receptor opacity.")]
public BindableFloat Opacity { get; } = new BindableFloat(1)
{
Precision = 0.1f,
MinValue = 0,
MaxValue = 1
};
[Resolved]
private ManiaPlayfield playfield { get; set; } = null!;
@ -68,6 +76,12 @@ namespace osu.Game.Rulesets.Mania.UI
};
}
protected override void LoadComplete()
{
base.LoadComplete();
Opacity.BindValueChanged(o => Alpha = o.NewValue, true);
}
public bool UsesFixedAnchor { get; set; }
public partial class InputReceptor : CompositeDrawable