mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Only drain health in non-break times
This commit is contained in:
@ -29,6 +29,11 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableDouble Health = new BindableDouble(1) { MinValue = 0, MaxValue = 1 };
|
public readonly BindableDouble Health = new BindableDouble(1) { MinValue = 0, MaxValue = 1 };
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether gameplay is currently in a break.
|
||||||
|
/// </summary>
|
||||||
|
public readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether this ScoreProcessor has already triggered the failed state.
|
/// Whether this ScoreProcessor has already triggered the failed state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -53,6 +58,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
if (!IsBreakTime.Value)
|
||||||
Health.Value -= drainRate * Time.Elapsed;
|
Health.Value -= drainRate * Time.Elapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,6 +272,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
DrawableRuleset.Overlays.Add(ScoreProcessor);
|
DrawableRuleset.Overlays.Add(ScoreProcessor);
|
||||||
DrawableRuleset.Overlays.Add(HealthProcessor);
|
DrawableRuleset.Overlays.Add(HealthProcessor);
|
||||||
|
|
||||||
|
HealthProcessor.IsBreakTime.BindTo(BreakOverlay.IsBreakTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePauseOnFocusLostState() =>
|
private void updatePauseOnFocusLostState() =>
|
||||||
|
Reference in New Issue
Block a user