mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 07:42:58 +08:00
Merge pull request #13296 from ekrctb/fix-hitcircle-animation-skin-changed
Fix hit circles reappearing when changing skins
This commit is contained in:
commit
13f86ef370
@ -182,8 +182,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
// todo: temporary / arbitrary, used for lifetime optimisation.
|
// todo: temporary / arbitrary, used for lifetime optimisation.
|
||||||
this.Delay(800).FadeOut();
|
this.Delay(800).FadeOut();
|
||||||
|
|
||||||
(CirclePiece.Drawable as IMainCirclePiece)?.Animate(state);
|
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
|
@ -97,8 +97,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.UpdateHitStateTransforms(state);
|
base.UpdateHitStateTransforms(state);
|
||||||
|
|
||||||
(CirclePiece.Drawable as IMainCirclePiece)?.Animate(state);
|
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
|
@ -87,8 +87,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
Debug.Assert(HitObject.HitWindows != null);
|
Debug.Assert(HitObject.HitWindows != null);
|
||||||
|
|
||||||
(CirclePiece.Drawable as IMainCirclePiece)?.Animate(state);
|
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
// 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 osu.Game.Rulesets.Objects.Drawables;
|
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|
||||||
{
|
|
||||||
public interface IMainCirclePiece
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Begins animating this <see cref="IMainCirclePiece"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="state">The <see cref="ArmedState"/> of the related <see cref="DrawableHitCircle"/>.</param>
|
|
||||||
void Animate(ArmedState state);
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,7 +13,7 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
||||||
{
|
{
|
||||||
public class MainCirclePiece : CompositeDrawable, IMainCirclePiece
|
public class MainCirclePiece : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly CirclePiece circle;
|
private readonly CirclePiece circle;
|
||||||
private readonly RingPiece ring;
|
private readonly RingPiece ring;
|
||||||
@ -42,6 +42,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
|
|
||||||
private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
|
private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
|
||||||
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
||||||
|
private readonly IBindable<ArmedState> armedState = new Bindable<ArmedState>();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private DrawableHitObject drawableObject { get; set; }
|
private DrawableHitObject drawableObject { get; set; }
|
||||||
@ -53,6 +54,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
|
|
||||||
accentColour.BindTo(drawableObject.AccentColour);
|
accentColour.BindTo(drawableObject.AccentColour);
|
||||||
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
||||||
|
armedState.BindTo(drawableObject.State);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -67,16 +69,20 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
indexInCurrentCombo.BindValueChanged(index => number.Text = (index.NewValue + 1).ToString(), true);
|
indexInCurrentCombo.BindValueChanged(index => number.Text = (index.NewValue + 1).ToString(), true);
|
||||||
|
|
||||||
|
armedState.BindValueChanged(animate, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Animate(ArmedState state)
|
private void animate(ValueChangedEvent<ArmedState> state)
|
||||||
{
|
{
|
||||||
|
ClearTransforms(true);
|
||||||
|
|
||||||
using (BeginAbsoluteSequence(drawableObject.StateUpdateTime))
|
using (BeginAbsoluteSequence(drawableObject.StateUpdateTime))
|
||||||
glow.FadeOut(400);
|
glow.FadeOut(400);
|
||||||
|
|
||||||
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
|
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state.NewValue)
|
||||||
{
|
{
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
const double flash_in = 40;
|
const double flash_in = 40;
|
||||||
@ -89,7 +95,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
explode.FadeIn(flash_in);
|
explode.FadeIn(flash_in);
|
||||||
this.ScaleTo(1.5f, 400, Easing.OutQuad);
|
this.ScaleTo(1.5f, 400, Easing.OutQuad);
|
||||||
|
|
||||||
using (BeginDelayedSequence(flash_in, true))
|
using (BeginDelayedSequence(flash_in))
|
||||||
{
|
{
|
||||||
// after the flash, we can hide some elements that were behind it
|
// after the flash, we can hide some elements that were behind it
|
||||||
ring.FadeOut();
|
ring.FadeOut();
|
||||||
|
@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Skinning.Default;
|
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -20,7 +19,7 @@ using static osu.Game.Skinning.LegacySkinConfiguration;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||||
{
|
{
|
||||||
public class LegacyMainCirclePiece : CompositeDrawable, IMainCirclePiece
|
public class LegacyMainCirclePiece : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly string priorityLookup;
|
private readonly string priorityLookup;
|
||||||
private readonly bool hasNumber;
|
private readonly bool hasNumber;
|
||||||
@ -41,6 +40,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
|
|
||||||
private readonly Bindable<Color4> accentColour = new Bindable<Color4>();
|
private readonly Bindable<Color4> accentColour = new Bindable<Color4>();
|
||||||
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
||||||
|
private readonly IBindable<ArmedState> armedState = new Bindable<ArmedState>();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private DrawableHitObject drawableObject { get; set; }
|
private DrawableHitObject drawableObject { get; set; }
|
||||||
@ -115,6 +115,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
|
|
||||||
accentColour.BindTo(drawableObject.AccentColour);
|
accentColour.BindTo(drawableObject.AccentColour);
|
||||||
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
||||||
|
armedState.BindTo(drawableObject.State);
|
||||||
|
|
||||||
Texture getTextureWithFallback(string name)
|
Texture getTextureWithFallback(string name)
|
||||||
{
|
{
|
||||||
@ -139,15 +140,19 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
accentColour.BindValueChanged(colour => hitCircleSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true);
|
accentColour.BindValueChanged(colour => hitCircleSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true);
|
||||||
if (hasNumber)
|
if (hasNumber)
|
||||||
indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
|
indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
|
||||||
|
|
||||||
|
armedState.BindValueChanged(animate, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Animate(ArmedState state)
|
private void animate(ValueChangedEvent<ArmedState> state)
|
||||||
{
|
{
|
||||||
const double legacy_fade_duration = 240;
|
const double legacy_fade_duration = 240;
|
||||||
|
|
||||||
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime, true))
|
ClearTransforms(true);
|
||||||
|
|
||||||
|
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state.NewValue)
|
||||||
{
|
{
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
circleSprites.FadeOut(legacy_fade_duration, Easing.Out);
|
circleSprites.FadeOut(legacy_fade_duration, Easing.Out);
|
||||||
|
Loading…
Reference in New Issue
Block a user