1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 23:42:54 +08:00

Adjust animations further to match stable

This commit is contained in:
Bartłomiej Dach 2024-07-24 15:07:15 +02:00
parent 3c28c116ca
commit 26395bd443
No known key found for this signature in database
2 changed files with 22 additions and 16 deletions

View File

@ -15,26 +15,24 @@ namespace osu.Game.Skinning
{
public partial class LegacyKeyCounter : KeyCounter
{
public bool UsesFixedAnchor { get; set; }
private const float transition_duration = 160;
public float TransitionDuration { get; set; } = 50f;
public Colour4 ActiveColour { get; set; }
public Colour4 KeyTextColour
private Colour4 textColour;
public Colour4 TextColour
{
get => keyTextColour;
get => textColour;
set
{
keyTextColour = value;
textColour = value;
overlayKeyText.Colour = value;
}
}
private Colour4 keyTextColour = Colour4.White;
private readonly Container keyContainer;
private readonly OsuSpriteText overlayKeyText;
private readonly Sprite keySprite;
public LegacyKeyCounter(InputTrigger trigger)
@ -64,7 +62,7 @@ namespace osu.Game.Skinning
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = trigger.Name,
Colour = keyTextColour,
Colour = textColour,
Font = OsuFont.GetFont(size: 20),
},
},
@ -87,14 +85,17 @@ namespace osu.Game.Skinning
protected override void Activate(bool forwardPlayback = true)
{
base.Activate(forwardPlayback);
keyContainer.ScaleTo(0.75f, TransitionDuration, Easing.OutQuad);
keyContainer.ScaleTo(0.75f, transition_duration, Easing.Out);
keySprite.Colour = ActiveColour;
overlayKeyText.Text = CountPresses.Value.ToString();
overlayKeyText.Font = overlayKeyText.Font.With(weight: FontWeight.Bold);
}
protected override void Deactivate(bool forwardPlayback = true)
{
base.Deactivate(forwardPlayback);
keyContainer.ScaleTo(1f, TransitionDuration);
keyContainer.ScaleTo(1f, transition_duration, Easing.Out);
keySprite.Colour = Colour4.White;
}
}
}

View File

@ -14,7 +14,8 @@ namespace osu.Game.Skinning
{
public partial class LegacyKeyCounterDisplay : KeyCounterDisplay
{
private const float key_transition_time = 100;
private static readonly Colour4 active_colour_top = Colour4.FromHex(@"#ffde00");
private static readonly Colour4 active_colour_bottom = Colour4.FromHex(@"#f8009e");
protected override FillFlowContainer<KeyCounter> KeyFlow { get; }
@ -61,12 +62,16 @@ namespace osu.Game.Skinning
if (backgroundTexture != null)
backgroundSprite.Texture = backgroundTexture;
for (int i = 0; i < KeyFlow.Count; ++i)
{
((LegacyKeyCounter)KeyFlow[i]).ActiveColour = i < 2 ? active_colour_top : active_colour_bottom;
}
}
protected override KeyCounter CreateCounter(InputTrigger trigger) => new LegacyKeyCounter(trigger)
{
TransitionDuration = key_transition_time,
KeyTextColour = keyTextColor,
TextColour = keyTextColor,
};
private Colour4 keyTextColor = Colour4.White;
@ -80,7 +85,7 @@ namespace osu.Game.Skinning
{
keyTextColor = value;
foreach (var child in KeyFlow.Cast<LegacyKeyCounter>())
child.KeyTextColour = value;
child.TextColour = value;
}
}
}