mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix regressions in combo counters and tidy up naming of SpriteTexts.
This commit is contained in:
@ -53,7 +53,6 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Origin = Anchor.BottomLeft,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Margin = new MarginPadding(10),
|
||||
InnerCountMargin = new MarginPadding(10),
|
||||
Count = 0,
|
||||
TextSize = 40,
|
||||
};
|
||||
|
@ -43,8 +43,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
line1.TransformSpacingTo(14, 1800, EasingTypes.OutQuint);
|
||||
line2.TransformSpacingTo(14, 1800, EasingTypes.OutQuint);
|
||||
line1.TransformSpacingTo(0.7f, 1800, EasingTypes.OutQuint);
|
||||
line2.TransformSpacingTo(0.7f, 1800, EasingTypes.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,25 +16,15 @@ namespace osu.Game.Modes.Osu.UI
|
||||
|
||||
protected virtual float PopOutSmallScale => 1.1f;
|
||||
protected virtual bool CanPopOutWhileRolling => false;
|
||||
|
||||
public MarginPadding InnerCountMargin
|
||||
{
|
||||
get
|
||||
{
|
||||
return DisplayedCountSpriteText.Margin;
|
||||
}
|
||||
set
|
||||
{
|
||||
DisplayedCountSpriteText.Margin = value;
|
||||
}
|
||||
}
|
||||
|
||||
public OsuComboCounter()
|
||||
{
|
||||
PopOutSpriteText.Origin = Origin;
|
||||
PopOutSpriteText.Anchor = Anchor;
|
||||
|
||||
Add(PopOutSpriteText);
|
||||
public Vector2 PopOutScale = new Vector2(2.5f);
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
PopOutCount.Origin = Origin;
|
||||
PopOutCount.Anchor = Anchor;
|
||||
}
|
||||
|
||||
protected override string FormatCount(ulong count)
|
||||
@ -44,15 +34,15 @@ namespace osu.Game.Modes.Osu.UI
|
||||
|
||||
protected virtual void TransformPopOut(ulong newValue)
|
||||
{
|
||||
PopOutSpriteText.Text = FormatCount(newValue);
|
||||
PopOutCount.Text = FormatCount(newValue);
|
||||
|
||||
PopOutSpriteText.ScaleTo(PopOutScale);
|
||||
PopOutSpriteText.FadeTo(PopOutInitialAlpha);
|
||||
PopOutSpriteText.MoveTo(Vector2.Zero);
|
||||
PopOutCount.ScaleTo(PopOutScale);
|
||||
PopOutCount.FadeTo(PopOutInitialAlpha);
|
||||
PopOutCount.MoveTo(Vector2.Zero);
|
||||
|
||||
PopOutSpriteText.ScaleTo(1, PopOutDuration, PopOutEasing);
|
||||
PopOutSpriteText.FadeOut(PopOutDuration, PopOutEasing);
|
||||
PopOutSpriteText.MoveTo(DisplayedCountSpriteText.Position, PopOutDuration, PopOutEasing);
|
||||
PopOutCount.ScaleTo(1, PopOutDuration, PopOutEasing);
|
||||
PopOutCount.FadeOut(PopOutDuration, PopOutEasing);
|
||||
PopOutCount.MoveTo(DisplayedCountSpriteText.Position, PopOutDuration, PopOutEasing);
|
||||
}
|
||||
|
||||
protected virtual void TransformPopOutRolling(ulong newValue)
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Modes.Catch.UI
|
||||
{
|
||||
if (!IsRolling)
|
||||
{
|
||||
PopOutSpriteText.Colour = DisplayedCountSpriteText.Colour;
|
||||
PopOutCount.Colour = DisplayedCountSpriteText.Colour;
|
||||
FadeOut(FadeOutDuration);
|
||||
}
|
||||
base.OnCountRolling(currentValue, newValue);
|
||||
@ -58,7 +58,7 @@ namespace osu.Game.Modes.Catch.UI
|
||||
/// <param name="colour">Last grabbed fruit colour.</param>
|
||||
public void CatchFruit(Color4 colour)
|
||||
{
|
||||
PopOutSpriteText.Colour = colour;
|
||||
PopOutCount.Colour = colour;
|
||||
Count++;
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ namespace osu.Game.Modes.Mania.UI
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
PopOutSpriteText.Anchor = Anchor.BottomCentre;
|
||||
PopOutSpriteText.Origin = Anchor.Centre;
|
||||
PopOutSpriteText.FadeColour(PopOutColor, 0);
|
||||
PopOutCount.Anchor = Anchor.BottomCentre;
|
||||
PopOutCount.Origin = Anchor.Centre;
|
||||
PopOutCount.FadeColour(PopOutColor, 0);
|
||||
OriginalColour = DisplayedCountSpriteText.Colour;
|
||||
}
|
||||
|
||||
@ -39,13 +39,13 @@ namespace osu.Game.Modes.Mania.UI
|
||||
{
|
||||
if (!IsRolling && newValue < currentValue)
|
||||
{
|
||||
PopOutSpriteText.Text = FormatCount(currentValue);
|
||||
PopOutCount.Text = FormatCount(currentValue);
|
||||
|
||||
PopOutSpriteText.FadeTo(PopOutInitialAlpha);
|
||||
PopOutSpriteText.ScaleTo(1.0f);
|
||||
PopOutCount.FadeTo(PopOutInitialAlpha);
|
||||
PopOutCount.ScaleTo(1.0f);
|
||||
|
||||
PopOutSpriteText.FadeOut(PopOutDuration, PopOutEasing);
|
||||
PopOutSpriteText.ScaleTo(PopOutScale, PopOutDuration, PopOutEasing);
|
||||
PopOutCount.FadeOut(PopOutDuration, PopOutEasing);
|
||||
PopOutCount.ScaleTo(PopOutScale, PopOutDuration, PopOutEasing);
|
||||
}
|
||||
|
||||
base.OnCountRolling(currentValue, newValue);
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.MathUtils;
|
||||
@ -16,7 +17,7 @@ namespace osu.Game.Modes.UI
|
||||
get; protected set;
|
||||
}
|
||||
|
||||
protected SpriteText PopOutSpriteText;
|
||||
protected SpriteText PopOutCount;
|
||||
|
||||
protected virtual double PopOutDuration => 150;
|
||||
protected virtual float PopOutScale => 2.0f;
|
||||
@ -86,7 +87,7 @@ namespace osu.Game.Modes.UI
|
||||
{
|
||||
textSize = value;
|
||||
DisplayedCountSpriteText.TextSize = TextSize;
|
||||
PopOutSpriteText.TextSize = TextSize;
|
||||
PopOutCount.TextSize = TextSize;
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,13 +104,19 @@ namespace osu.Game.Modes.UI
|
||||
{
|
||||
Alpha = 0,
|
||||
},
|
||||
PopOutSpriteText = new SpriteText
|
||||
PopOutCount = new SpriteText
|
||||
{
|
||||
Alpha = 0,
|
||||
Margin = new MarginPadding(0.05f),
|
||||
}
|
||||
};
|
||||
|
||||
TextSize = 80;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
DisplayedCountSpriteText.Text = FormatCount(Count);
|
||||
DisplayedCountSpriteText.Anchor = Anchor;
|
||||
@ -192,13 +199,12 @@ namespace osu.Game.Modes.UI
|
||||
|
||||
private void updateCount(ulong value, bool rolling = false)
|
||||
{
|
||||
ulong prevCount = count;
|
||||
count = value;
|
||||
|
||||
if (!IsLoaded)
|
||||
return;
|
||||
|
||||
ulong prevCount = count;
|
||||
|
||||
if (!rolling)
|
||||
{
|
||||
Flush(false, typeof(TransformComboRoll));
|
||||
|
Reference in New Issue
Block a user