2021-11-09 14:11:19 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System;
|
2021-11-10 00:57:22 +00:00
|
|
|
using osu.Framework.Bindables;
|
2022-08-10 20:09:11 +00:00
|
|
|
using osu.Framework.Localisation;
|
2021-11-09 14:11:19 +00:00
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osu.Framework.Utils;
|
|
|
|
using osu.Game.Rulesets.Catch.UI;
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Mods
|
|
|
|
{
|
2021-11-10 01:10:05 +00:00
|
|
|
public class CatchModNoScope : ModNoScope, IUpdatableByPlayfield
|
2021-11-09 14:11:19 +00:00
|
|
|
{
|
2022-08-10 20:09:11 +00:00
|
|
|
public override LocalisableString Description => "Where's the catcher?";
|
2021-11-09 14:11:19 +00:00
|
|
|
|
2022-09-25 19:49:22 +00:00
|
|
|
public override BindableInt HiddenComboCount { get; } = new BindableInt(10)
|
2021-11-10 00:57:22 +00:00
|
|
|
{
|
|
|
|
MinValue = 0,
|
|
|
|
MaxValue = 50,
|
|
|
|
};
|
|
|
|
|
2021-11-10 11:00:36 +00:00
|
|
|
public void Update(Playfield playfield)
|
2021-11-09 14:11:19 +00:00
|
|
|
{
|
2021-11-10 00:53:30 +00:00
|
|
|
var catchPlayfield = (CatchPlayfield)playfield;
|
2021-11-10 01:10:05 +00:00
|
|
|
bool shouldAlwaysShowCatcher = IsBreakTime.Value;
|
2021-11-10 00:53:30 +00:00
|
|
|
float targetAlpha = shouldAlwaysShowCatcher ? 1 : ComboBasedAlpha;
|
2023-01-03 12:28:05 +00:00
|
|
|
|
|
|
|
// AlwaysPresent required for catcher to still act on input when fully hidden.
|
|
|
|
catchPlayfield.CatcherArea.AlwaysPresent = true;
|
2021-11-10 00:53:30 +00:00
|
|
|
catchPlayfield.CatcherArea.Alpha = (float)Interpolation.Lerp(catchPlayfield.CatcherArea.Alpha, targetAlpha, Math.Clamp(catchPlayfield.Time.Elapsed / TRANSITION_DURATION, 0, 1));
|
2021-11-09 14:11:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|