Adjust game-side text flow containers to part-based model

This commit is contained in:
Bartłomiej Dach
2021-08-01 17:12:04 +02:00
parent fe86ae51b0
commit 6f863ca204
8 changed files with 73 additions and 37 deletions

View File

@ -37,7 +37,7 @@ namespace osu.Game.Screens.Menu
private readonly Bindable<User> currentUser = new Bindable<User>();
private FillFlowContainer fill;
private readonly List<Drawable> expendableText = new List<Drawable>();
private readonly List<ITextPart> expendableText = new List<ITextPart>();
public Disclaimer(OsuScreen nextScreen = null)
{
@ -97,7 +97,7 @@ namespace osu.Game.Screens.Menu
textFlow.AddText("this is osu!", t => t.Font = t.Font.With(Typeface.Torus, 30, FontWeight.Regular));
expendableText.AddRange(textFlow.AddText("lazer", t =>
expendableText.Add(textFlow.AddText("lazer", t =>
{
t.Font = t.Font.With(Typeface.Torus, 30, FontWeight.Regular);
t.Colour = colours.PinkLight;
@ -114,7 +114,7 @@ namespace osu.Game.Screens.Menu
t.Font = t.Font.With(Typeface.Torus, 20, FontWeight.SemiBold);
t.Colour = colours.Pink;
});
expendableText.AddRange(textFlow.AddText(" coming to osu!", formatRegular));
expendableText.Add(textFlow.AddText(" coming to osu!", formatRegular));
textFlow.AddText(".", formatRegular);
textFlow.NewParagraph();
@ -152,7 +152,7 @@ namespace osu.Game.Screens.Menu
t.Font = t.Font.With(size: 20);
t.Origin = Anchor.Centre;
t.Colour = colours.Pink;
}).First();
}).Drawables.First();
if (IsLoaded)
animateHeart();
@ -193,7 +193,7 @@ namespace osu.Game.Screens.Menu
using (BeginDelayedSequence(520 + 160))
{
fill.MoveToOffset(new Vector2(0, 15), 160, Easing.OutQuart);
Schedule(() => expendableText.ForEach(t =>
Schedule(() => expendableText.SelectMany(t => t.Drawables).ForEach(t =>
{
t.FadeOut(100);
t.ScaleTo(new Vector2(0, 1), 100, Easing.OutQuart);