1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 16:06:06 +08:00
osu-lazer/osu.Game.Tests/Visual/Online/TestSceneDrawableComment.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
4.5 KiB
C#
Raw Normal View History

// 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.
2022-06-17 15:37:17 +08:00
#nullable disable
using System;
2024-02-14 08:49:29 +08:00
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2024-02-14 08:49:29 +08:00
using osu.Game.Graphics.Containers;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays.Comments;
2024-02-14 08:49:29 +08:00
using osu.Game.Tests.Visual.UserInterface;
namespace osu.Game.Tests.Visual.Online
{
2024-02-14 08:49:29 +08:00
public partial class TestSceneDrawableComment : ThemeComparisonTestScene
{
2024-02-14 08:49:29 +08:00
public TestSceneDrawableComment()
: base(false)
{
2024-02-14 08:49:29 +08:00
}
2024-02-14 08:49:29 +08:00
protected override Drawable CreateContent() => new OsuScrollContainer(Direction.Vertical)
{
2024-02-14 08:49:29 +08:00
RelativeSizeAxes = Axes.Both,
Child = new FillFlowContainer
{
2024-02-14 08:49:29 +08:00
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
ChildrenEnumerable = comments.Select(info =>
{
var comment = new Comment
{
Id = 1,
UserId = 1000,
User = new APIUser { Id = 1000, Username = "Someone" },
CreatedAt = DateTimeOffset.Now,
VotesCount = 0,
Pinned = info[0] == "Pinned",
Message = info[1],
CommentableId = 2001,
CommentableType = "test"
};
2024-02-14 08:49:29 +08:00
return new[]
{
new DrawableComment(comment, Array.Empty<CommentableMeta>()),
new DrawableComment(comment, new[]
{
new CommentableMeta
{
Id = 2001,
OwnerId = comment.UserId,
OwnerTitle = "MAPPER",
Type = "test",
},
new CommentableMeta { Title = "Other Meta" },
}),
};
}).SelectMany(c => c)
}
};
2024-02-14 08:49:29 +08:00
private static readonly string[][] comments =
{
new[] { "Plain", "This is plain comment" },
new[] { "Pinned", "This is pinned comment" },
2021-07-26 22:08:57 +08:00
new[] { "Link", "Please visit https://osu.ppy.sh" },
new[] { "Big Image", "![](Backgrounds/bg1 \"Big Image\")" },
2023-09-23 11:31:26 +08:00
new[] { "Small Image", "![](Cursor/cursortrail)" },
2021-07-26 22:02:57 +08:00
new[]
{
"Heading", @"# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6"
},
// Taken from https://github.com/ppy/osu/issues/13993#issuecomment-885994077
2024-02-18 06:38:50 +08:00
new[] { "Problematic", @"My tablet doesn't work :( It's a Huion 420 and it's apparently incompatible with OpenTablet Driver. The warning I get is: ""DeviceInUseException: Device is currently in use by another kernel module. To fix this issue, please follow the instructions from https://github.com/OpenTabletDriver/OpenTabletDriver/wiki/Linux-FAQ#arg umentoutofrangeexception-value-0-15"" and it repeats 4 times on the notification before logging subsequent warnings. Checking the logs, it looks for other Huion tablets before sending the notification (e.g. ""2021-07-23 03:52:33 [verbose]: Detect: Searching for tablet 'Huion WH1409 V2' 20 2021-07-23 03:52:33 [error]: DeviceInUseException: Device is currently in use by another kernel module. To fix this issue, please follow the instructions from https://github.com/OpenTabletDriver/OpenTabletDriver/wiki/Linux-FAQ#arg umentoutofrangeexception-value-0-15"") I use an Arch based installation of Linux and the tablet runs perfectly with Digimend kernel driver, with area configuration, pen pressure, etc. On osu!lazer the cursor disappears until I set it to ""Borderless"" instead of ""Fullscreen"" and even after it shows up, it goes to the bottom left corner as soon as a map starts. I have honestly 0 idea of whats going on at this point.", },
new[]
{
2024-02-18 06:38:50 +08:00
"Code Block", @"User not found! ;_;
There are a few possible reasons for this:
They may have changed their username.
The account may be temporarily unavailable due to security or abuse issues.
You may have made a typo!"
},
};
}
}