2020-02-11 15:46:49 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
using osu.Game.Overlays.Comments;
|
2020-02-11 17:47:51 +00:00
|
|
|
|
using osuTK;
|
2020-02-11 15:46:49 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
|
|
|
{
|
|
|
|
|
public class TestSceneCommentEditor : OsuTestScene
|
|
|
|
|
{
|
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(CommentEditor),
|
2020-02-11 17:47:51 +00:00
|
|
|
|
typeof(CancellableCommentEditor),
|
2020-02-11 15:46:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[Cached]
|
|
|
|
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
|
|
|
|
|
|
|
|
|
public TestSceneCommentEditor()
|
|
|
|
|
{
|
2020-02-11 17:47:51 +00:00
|
|
|
|
Add(new FillFlowContainer
|
2020-02-11 15:46:49 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Width = 800,
|
2020-02-11 17:47:51 +00:00
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0, 20),
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TestCommentEditor(),
|
|
|
|
|
new TestCancellableCommentEditor()
|
|
|
|
|
}
|
2020-02-11 15:46:49 +00:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class TestCommentEditor : CommentEditor
|
|
|
|
|
{
|
2020-02-11 17:08:24 +00:00
|
|
|
|
protected override string FooterText => @"Footer text. And it is pretty long. Cool.";
|
2020-02-11 15:46:49 +00:00
|
|
|
|
|
2020-02-11 17:08:24 +00:00
|
|
|
|
protected override string CommitButtonText => @"Commit";
|
|
|
|
|
|
|
|
|
|
protected override string TextboxPlaceholderText => @"This textbox is empty";
|
2020-02-11 15:46:49 +00:00
|
|
|
|
}
|
2020-02-11 17:47:51 +00:00
|
|
|
|
|
|
|
|
|
private class TestCancellableCommentEditor : CancellableCommentEditor
|
|
|
|
|
{
|
|
|
|
|
protected override string FooterText => @"Wow, another one. Sicc";
|
|
|
|
|
|
|
|
|
|
protected override string CommitButtonText => @"Save";
|
|
|
|
|
|
|
|
|
|
protected override string TextboxPlaceholderText => @"Miltiline textboxes soon";
|
|
|
|
|
}
|
2020-02-11 15:46:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|