1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Merge pull request #10676 from peppy/fix-hitcircle-glow-on-skin-change

Fix skin changes resulting in incorrectly applied transforms in MainCirclePiece
This commit is contained in:
Dan Balasescu 2020-11-06 21:09:22 +09:00 committed by GitHub
commit cf9acca78a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 40 deletions

View File

@ -42,8 +42,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
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>();
[Resolved]
private DrawableHitObject drawableObject { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(DrawableHitObject drawableObject) private void load()
{ {
var drawableOsuObject = (DrawableOsuHitObject)drawableObject; var drawableOsuObject = (DrawableOsuHitObject)drawableObject;
@ -64,32 +67,35 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private void updateState(ValueChangedEvent<ArmedState> state) private void updateState(ValueChangedEvent<ArmedState> state)
{ {
glow.FadeOut(400); using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime, true))
switch (state.NewValue)
{ {
case ArmedState.Hit: glow.FadeOut(400);
const double flash_in = 40;
const double flash_out = 100;
flash.FadeTo(0.8f, flash_in) switch (state.NewValue)
.Then() {
.FadeOut(flash_out); case ArmedState.Hit:
const double flash_in = 40;
const double flash_out = 100;
explode.FadeIn(flash_in); flash.FadeTo(0.8f, flash_in)
this.ScaleTo(1.5f, 400, Easing.OutQuad); .Then()
.FadeOut(flash_out);
using (BeginDelayedSequence(flash_in, true)) explode.FadeIn(flash_in);
{ this.ScaleTo(1.5f, 400, Easing.OutQuad);
// after the flash, we can hide some elements that were behind it
ring.FadeOut();
circle.FadeOut();
number.FadeOut();
this.FadeOut(800); using (BeginDelayedSequence(flash_in, true))
} {
// after the flash, we can hide some elements that were behind it
ring.FadeOut();
circle.FadeOut();
number.FadeOut();
break; this.FadeOut(800);
}
break;
}
} }
} }
} }

View File

@ -42,11 +42,14 @@ namespace osu.Game.Rulesets.Osu.Skinning
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>();
[Resolved]
private DrawableHitObject drawableObject { get; set; }
[Resolved] [Resolved]
private ISkinSource skin { get; set; } private ISkinSource skin { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(DrawableHitObject drawableObject) private void load()
{ {
var drawableOsuObject = (DrawableOsuHitObject)drawableObject; var drawableOsuObject = (DrawableOsuHitObject)drawableObject;
@ -144,28 +147,31 @@ namespace osu.Game.Rulesets.Osu.Skinning
{ {
const double legacy_fade_duration = 240; const double legacy_fade_duration = 240;
switch (state.NewValue) using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime, true))
{ {
case ArmedState.Hit: switch (state.NewValue)
circleSprites.FadeOut(legacy_fade_duration, Easing.Out); {
circleSprites.ScaleTo(1.4f, legacy_fade_duration, Easing.Out); case ArmedState.Hit:
circleSprites.FadeOut(legacy_fade_duration, Easing.Out);
circleSprites.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
if (hasNumber) if (hasNumber)
{
var legacyVersion = skin.GetConfig<LegacySetting, decimal>(LegacySetting.Version)?.Value;
if (legacyVersion >= 2.0m)
// legacy skins of version 2.0 and newer only apply very short fade out to the number piece.
hitCircleText.FadeOut(legacy_fade_duration / 4, Easing.Out);
else
{ {
// old skins scale and fade it normally along other pieces. var legacyVersion = skin.GetConfig<LegacySetting, decimal>(LegacySetting.Version)?.Value;
hitCircleText.FadeOut(legacy_fade_duration, Easing.Out);
hitCircleText.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
}
}
break; if (legacyVersion >= 2.0m)
// legacy skins of version 2.0 and newer only apply very short fade out to the number piece.
hitCircleText.FadeOut(legacy_fade_duration / 4, Easing.Out);
else
{
// old skins scale and fade it normally along other pieces.
hitCircleText.FadeOut(legacy_fade_duration, Easing.Out);
hitCircleText.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
}
}
break;
}
} }
} }
} }