mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Better style; removed initial sprites
This commit is contained in:
@ -21,7 +21,6 @@ namespace osu.Game.Tests.Visual
|
|||||||
private DependencyContainer dependencies;
|
private DependencyContainer dependencies;
|
||||||
|
|
||||||
private readonly TestChatLineContainer textContainer;
|
private readonly TestChatLineContainer textContainer;
|
||||||
private readonly ChatLine[] testSprites;
|
|
||||||
|
|
||||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent);
|
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent);
|
||||||
|
|
||||||
@ -38,21 +37,25 @@ namespace osu.Game.Tests.Visual
|
|||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
testSprites = new[]
|
testAddLinks();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testAddLinks()
|
||||||
{
|
{
|
||||||
new ChatLine(new DummyMessage("Test!")),
|
int msgCounter = 0;
|
||||||
new ChatLine(new DummyMessage("osu.ppy.sh!")),
|
void addMessage(string text, bool isAction = false) => AddStep($"Add message #{++msgCounter}", () => textContainer.Add(new ChatLine(new DummyMessage(text, isAction))));
|
||||||
new ChatLine(new DummyMessage("http://lookatmy.horse/")),
|
|
||||||
new ChatLine(new DummyMessage("https://osu.ppy.sh!")),
|
addMessage("Test!");
|
||||||
new ChatLine(new DummyMessage("00:12:345 (1,2) - Test?")),
|
addMessage("osu.ppy.sh!");
|
||||||
new ChatLine(new DummyMessage("Wiki link for tasty [[Performance Points]]")),
|
addMessage("https://osu.ppy.sh!");
|
||||||
new ChatLine(new DummyMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)")),
|
addMessage("00:12:345 (1,2) - Test?");
|
||||||
new ChatLine(new DummyMessage("[https://osu.ppy.sh/home New site] (new link format)")),
|
addMessage("Wiki link for tasty [[Performance Points]]");
|
||||||
new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")),
|
addMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)");
|
||||||
new ChatLine(new DummyMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- <Version 0>]", true)),
|
addMessage("[https://osu.ppy.sh/home New site] (new link format)");
|
||||||
new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- <Version 0>]", true)),
|
addMessage("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]");
|
||||||
new ChatLine(new DummyMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).")),
|
addMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- <Version 0>]", true);
|
||||||
};
|
addMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- <Version 0>]", true);
|
||||||
|
addMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).");
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -60,8 +63,6 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
dependencies.Cache(chat);
|
dependencies.Cache(chat);
|
||||||
dependencies.Cache(beatmapSetOverlay);
|
dependencies.Cache(beatmapSetOverlay);
|
||||||
|
|
||||||
textContainer.AddRange(testSprites);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DummyMessage : Message
|
private class DummyMessage : Message
|
||||||
|
Reference in New Issue
Block a user