1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:02:55 +08:00

Add property to SkipOverlay

This commit is contained in:
BlauFx 2022-08-05 23:00:37 +02:00
parent 0d73bfa451
commit 6717f0606c
No known key found for this signature in database
GPG Key ID: BB73374479D2AA97

View File

@ -8,6 +8,7 @@ using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -40,6 +41,8 @@ namespace osu.Game.Screens.Play
private bool isClickable;
public BindableBool IsSkippable = new()!;
[Resolved]
private GameplayClock gameplayClock { get; set; }
@ -134,6 +137,7 @@ namespace osu.Game.Screens.Play
remainingTimeBox.Width = (float)Interpolation.Lerp(remainingTimeBox.Width, progress, Math.Clamp(Time.Elapsed / 40, 0, 1));
isClickable = progress > 0;
IsSkippable.Value = isClickable;
button.Enabled.Value = isClickable;
buttonContainer.State.Value = isClickable ? Visibility.Visible : Visibility.Hidden;
}