mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 11:37:32 +09:00
Merge pull request #22019 from frenzibyte/fix-catch-mod-no-scope
Fix catcher not moving when fully hidden with "No Scope" mod
This commit is contained in:
commit
4300555efe
@ -18,6 +18,36 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
|
|||||||
{
|
{
|
||||||
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();
|
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestAlwaysHidden()
|
||||||
|
{
|
||||||
|
CreateModTest(new ModTestData
|
||||||
|
{
|
||||||
|
Mod = new CatchModNoScope
|
||||||
|
{
|
||||||
|
HiddenComboCount = { Value = 0 },
|
||||||
|
},
|
||||||
|
Autoplay = true,
|
||||||
|
PassCondition = () => Player.ScoreProcessor.Combo.Value == 2,
|
||||||
|
Beatmap = new Beatmap
|
||||||
|
{
|
||||||
|
HitObjects = new List<HitObject>
|
||||||
|
{
|
||||||
|
new Fruit
|
||||||
|
{
|
||||||
|
X = CatchPlayfield.CENTER_X * 0.5f,
|
||||||
|
StartTime = 1000,
|
||||||
|
},
|
||||||
|
new Fruit
|
||||||
|
{
|
||||||
|
X = CatchPlayfield.CENTER_X * 1.5f,
|
||||||
|
StartTime = 2000,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestVisibleDuringBreak()
|
public void TestVisibleDuringBreak()
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,9 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
var catchPlayfield = (CatchPlayfield)playfield;
|
var catchPlayfield = (CatchPlayfield)playfield;
|
||||||
bool shouldAlwaysShowCatcher = IsBreakTime.Value;
|
bool shouldAlwaysShowCatcher = IsBreakTime.Value;
|
||||||
float targetAlpha = shouldAlwaysShowCatcher ? 1 : ComboBasedAlpha;
|
float targetAlpha = shouldAlwaysShowCatcher ? 1 : ComboBasedAlpha;
|
||||||
|
|
||||||
|
// AlwaysPresent required for catcher to still act on input when fully hidden.
|
||||||
|
catchPlayfield.CatcherArea.AlwaysPresent = true;
|
||||||
catchPlayfield.CatcherArea.Alpha = (float)Interpolation.Lerp(catchPlayfield.CatcherArea.Alpha, targetAlpha, Math.Clamp(catchPlayfield.Time.Elapsed / TRANSITION_DURATION, 0, 1));
|
catchPlayfield.CatcherArea.Alpha = (float)Interpolation.Lerp(catchPlayfield.CatcherArea.Alpha, targetAlpha, Math.Clamp(catchPlayfield.Time.Elapsed / TRANSITION_DURATION, 0, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user