1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Fix touch device not always activating when it should

See https://github.com/ppy/osu/discussions/26574
This commit is contained in:
Bartłomiej Dach 2024-01-16 17:12:40 +01:00
parent 7a7548e89d
commit a9d086c119
No known key found for this signature in database

View File

@ -20,12 +20,16 @@ namespace osu.Game.Screens.Play
private GameplayState gameplayState { get; set; } = null!;
private IBindable<bool> touchActive = new BindableBool();
private IBindable<bool> isBreakTime = null!;
[BackgroundDependencyLoader]
private void load(SessionStatics statics)
{
touchActive = statics.GetBindable<bool>(Static.TouchInputActive);
touchActive.BindValueChanged(_ => updateState());
isBreakTime = player.IsBreakTime.GetBoundCopy();
isBreakTime.BindValueChanged(_ => updateState(), true);
}
private void updateState()
@ -39,7 +43,7 @@ namespace osu.Game.Screens.Play
if (gameplayState.Score.ScoreInfo.Mods.OfType<ModTouchDevice>().Any())
return;
if (player.IsBreakTime.Value)
if (isBreakTime.Value)
return;
var touchDeviceMod = gameplayState.Ruleset.GetTouchDeviceMod();