mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 15:33:05 +08:00
Merge pull request #16000 from peppy/fix-legacy-combo-counter-anchor
Fix `LegacyComboCounter` not handling non-default anchor/origin specifications correctly
This commit is contained in:
commit
9e3a1c75d2
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user