1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 01:53:01 +08:00

Fix LegacyComboCounter not handling non-default anchor/origin specifications correctly

This commit is contained in:
Dean Herbert 2021-12-08 14:56:38 +09:00
parent 724d72b975
commit 6ec3f41839

View File

@ -67,22 +67,32 @@ namespace osu.Game.Screens.Play.HUD
Scale = new Vector2(1.2f);
InternalChild = counterContainer = new Container
InternalChildren = new[]
{
AutoSizeAxes = Axes.Both,
AlwaysPresent = true,
Children = new[]
popOutCount = new LegacySpriteText(LegacyFont.Combo)
{
popOutCount = new LegacySpriteText(LegacyFont.Combo)
Alpha = 0,
Margin = new MarginPadding(0.05f),
Blending = BlendingParameters.Additive,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
BypassAutoSizeAxes = Axes.Both,
},
counterContainer = new Container
{
AutoSizeAxes = Axes.Both,
AlwaysPresent = true,
Children = new[]
{
Alpha = 0,
Margin = new MarginPadding(0.05f),
Blending = BlendingParameters.Additive,
},
displayedCountSpriteText = new LegacySpriteText(LegacyFont.Combo)
{
Alpha = 0,
},
displayedCountSpriteText = new LegacySpriteText(LegacyFont.Combo)
{
// Initial text and AlwaysPresent allow the counter to have a size before it first displays a combo.
// This is useful for display in the skin editor.
Text = formatCount(0),
AlwaysPresent = true,
Alpha = 0,
},
}
}
};
}
@ -121,13 +131,6 @@ namespace osu.Game.Screens.Play.HUD
((IHasText)displayedCountSpriteText).Text = formatCount(Current.Value);
counterContainer.Anchor = Anchor;
counterContainer.Origin = Origin;
displayedCountSpriteText.Anchor = Anchor;
displayedCountSpriteText.Origin = Origin;
popOutCount.Anchor = Anchor;
popOutCount.Origin = Origin;
Current.BindValueChanged(combo => updateCount(combo.NewValue == 0), true);
}