mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
Begun refractorization process of wrapping Button text in a FillFlowContainer
This commit is contained in:
parent
b0bcbf8b93
commit
f40ebc83ca
@ -16,7 +16,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(FooterButtonMods)
|
||||
typeof(FooterButtonMods),
|
||||
typeof(FooterButton)
|
||||
};
|
||||
|
||||
private readonly TestFooterButtonMods footerButtonMods;
|
||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
protected readonly Container TextContainer;
|
||||
protected FillFlowContainer TextContainer;
|
||||
protected readonly SpriteText SpriteText;
|
||||
private readonly Box box;
|
||||
private readonly Box light;
|
||||
@ -80,15 +80,24 @@ namespace osu.Game.Screens.Select
|
||||
EdgeSmoothness = new Vector2(2, 0),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
TextContainer = new Container
|
||||
TextContainer = new FillFlowContainer
|
||||
{
|
||||
Size = new Vector2(100 - SHEAR_WIDTH, 50),
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Shear = -SHEAR,
|
||||
Child = SpriteText = new OsuSpriteText
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}
|
||||
SpriteText = new OsuSpriteText
|
||||
{
|
||||
Size = new Vector2(100 - SHEAR_WIDTH, 50),
|
||||
Shear = -SHEAR,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}
|
||||
},
|
||||
AutoSizeAxes = Axes.Both,
|
||||
// Margin = new MarginPadding { Left = 70, Right = 14 }
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
// using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using System.Collections.Generic;
|
||||
@ -34,31 +34,19 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public FooterButtonMods()
|
||||
{
|
||||
Add(new FillFlowContainer
|
||||
TextContainer.Add(modDisplay = new FooterModDisplay
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Shear = -SHEAR,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
modDisplay = new FooterModDisplay
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
DisplayUnrankedText = false,
|
||||
Scale = new Vector2(0.8f)
|
||||
},
|
||||
MultiplierText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
||||
Margin = new MarginPadding { Right = 6 }
|
||||
}
|
||||
},
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Margin = new MarginPadding { Left = 70, Right = 14 }
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
DisplayUnrankedText = false,
|
||||
Scale = new Vector2(0.8f)
|
||||
});
|
||||
TextContainer.Add(MultiplierText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
||||
Margin = new MarginPadding { Right = 6 }
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user