1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 02:46:43 +08:00

move auto fade in to mod

This commit is contained in:
mcendu 2020-02-10 14:14:04 +08:00
parent 10a1948720
commit 9aa5db88d4
No known key found for this signature in database
GPG Key ID: FBCD5D45163D6364
2 changed files with 10 additions and 5 deletions

View File

@ -3,12 +3,12 @@
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
namespace osu.Game.Rulesets.Osu.Mods
{
@ -30,10 +30,15 @@ namespace osu.Game.Rulesets.Osu.Mods
if (hitObject is DrawableSpinner spinner)
{
spinner.Disc.Enabled = false;
spinner.Disc.OnUpdate += d =>
spinner.OnUpdate += d =>
{
if (d is SpinnerDisc s && s.Valid)
s.Rotate(180 / MathF.PI * (float)s.Clock.ElapsedFrameTime / 40);
if (d is DrawableSpinner s)
{
if (s.Disc.Valid)
s.Disc.Rotate(180 / MathF.PI * (float)s.Clock.ElapsedFrameTime / 40);
if (!s.SpmCounter.IsPresent)
s.SpmCounter.FadeIn(s.HitObject.TimeFadeIn);
}
};
}
}

View File

@ -177,7 +177,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void Update()
{
Disc.Tracking = OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false;
if (!SpmCounter.IsPresent && (Disc.Tracking || !Disc.Enabled))
if (!SpmCounter.IsPresent && Disc.Tracking)
SpmCounter.FadeIn(HitObject.TimeFadeIn);
base.Update();