Naming adjustments

This commit is contained in:
Andrei Zavatski
2020-02-12 02:05:45 +03:00
parent 53a2b65dbd
commit 9ac6c271ac
2 changed files with 50 additions and 12 deletions

View File

@ -6,6 +6,8 @@ using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osu.Game.Overlays.Comments;
using osuTK;
@ -23,8 +25,21 @@ namespace osu.Game.Tests.Visual.UserInterface
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
private readonly OsuSpriteText text;
private readonly TestCommentEditor commentEditor;
private readonly TestCancellableCommentEditor cancellableCommentEditor;
public TestSceneCommentEditor()
{
Add(new Container
{
AutoSizeAxes = Axes.Both,
Child = text = new OsuSpriteText
{
Font = OsuFont.GetFont()
}
});
Add(new FillFlowContainer
{
Anchor = Anchor.Centre,
@ -35,12 +50,29 @@ namespace osu.Game.Tests.Visual.UserInterface
Spacing = new Vector2(0, 20),
Children = new Drawable[]
{
new TestCommentEditor(),
new TestCancellableCommentEditor()
commentEditor = new TestCommentEditor
{
OnCommit = onCommit
},
cancellableCommentEditor = new TestCancellableCommentEditor
{
OnCommit = onCommit
}
}
});
}
private void onCommit(string value)
{
text.Text = $@"Invoked text: {value}";
Scheduler.AddDelayed(() =>
{
commentEditor.IsLoading = false;
cancellableCommentEditor.IsLoading = false;
}, 500);
}
private class TestCommentEditor : CommentEditor
{
protected override string FooterText => @"Footer text. And it is pretty long. Cool.";