From e3f2e1ba08c79e01b9dc9a0d76ff9bf21f41c32e Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 4 Apr 2024 18:20:30 +0900 Subject: [PATCH] Add opacity setting --- .../UI/ManiaTouchInputOverlay.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaTouchInputOverlay.cs b/osu.Game.Rulesets.Mania/UI/ManiaTouchInputOverlay.cs index 10de89e950..ddff064133 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaTouchInputOverlay.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaTouchInputOverlay.cs @@ -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