mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Merge branch 'master' into tooltips
This commit is contained in:
@ -9,21 +9,30 @@ using osu.Framework.Testing;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes.Catch.UI;
|
||||
using osu.Game.Modes.Mania.UI;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Osu.Objects;
|
||||
using osu.Game.Modes.Osu.UI;
|
||||
using osu.Game.Modes.Taiko.UI;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Rulesets.Taiko.UI;
|
||||
using System.Collections.Generic;
|
||||
using osu.Desktop.VisualTests.Beatmaps;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
internal class TestCaseGamefield : TestCase
|
||||
{
|
||||
private RulesetDatabase rulesets;
|
||||
|
||||
public override string Description => @"Showing hitobjects and what not.";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RulesetDatabase rulesets)
|
||||
{
|
||||
this.rulesets = rulesets;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
@ -36,7 +45,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
objects.Add(new HitCircle
|
||||
{
|
||||
StartTime = time,
|
||||
Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)),
|
||||
Position = new Vector2(RNG.Next(0, (int)OsuPlayfield.BASE_SIZE.X), RNG.Next(0, (int)OsuPlayfield.BASE_SIZE.Y)),
|
||||
Scale = RNG.NextSingle(0.5f, 1.0f),
|
||||
});
|
||||
|
||||
@ -49,6 +58,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
Difficulty = new BeatmapDifficulty(),
|
||||
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = @"Unknown",
|
||||
|
@ -10,11 +10,11 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Osu.Judgements;
|
||||
using osu.Game.Modes.Osu.Objects;
|
||||
using osu.Game.Modes.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Judgements;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
|
@ -4,9 +4,9 @@
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Modes.Osu.Mods;
|
||||
using osu.Game.Modes.Scoring;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
using osu.Game.Users;
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays.Mods;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Database;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -13,6 +14,13 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
public override string Description => @"Tests the mod select overlay";
|
||||
|
||||
private ModSelectOverlay modSelect;
|
||||
private RulesetDatabase rulesets;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RulesetDatabase rulesets)
|
||||
{
|
||||
this.rulesets = rulesets;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
@ -26,10 +34,9 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
});
|
||||
|
||||
AddStep("Toggle", modSelect.ToggleVisibility);
|
||||
AddStep("osu!", () => modSelect.PlayMode.Value = PlayMode.Osu);
|
||||
AddStep("osu!taiko", () => modSelect.PlayMode.Value = PlayMode.Taiko);
|
||||
AddStep("osu!catch", () => modSelect.PlayMode.Value = PlayMode.Catch);
|
||||
AddStep("osu!mania", () => modSelect.PlayMode.Value = PlayMode.Mania);
|
||||
|
||||
foreach (var ruleset in rulesets.AllRulesets)
|
||||
AddStep(ruleset.CreateInstance().Description, () => modSelect.Ruleset.Value = ruleset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ using osu.Desktop.VisualTests.Platform;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Select;
|
||||
using osu.Game.Screens.Select.Filter;
|
||||
|
||||
@ -20,13 +19,19 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
public override string Description => @"with fake data";
|
||||
|
||||
private RulesetDatabase rulesets;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
if (db == null)
|
||||
{
|
||||
storage = new TestStorage(@"TestCasePlaySongSelect");
|
||||
db = new BeatmapDatabase(storage);
|
||||
|
||||
var backingDatabase = storage.GetDatabase(@"client");
|
||||
|
||||
rulesets = new RulesetDatabase(storage, backingDatabase);
|
||||
db = new BeatmapDatabase(storage, backingDatabase, rulesets);
|
||||
|
||||
var sets = new List<BeatmapSetInfo>();
|
||||
|
||||
@ -72,7 +77,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = 1234 + i,
|
||||
Mode = PlayMode.Osu,
|
||||
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
||||
Path = "normal.osu",
|
||||
Version = "Normal",
|
||||
Difficulty = new BeatmapDifficulty
|
||||
@ -83,7 +88,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = 1235 + i,
|
||||
Mode = PlayMode.Osu,
|
||||
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
||||
Path = "hard.osu",
|
||||
Version = "Hard",
|
||||
Difficulty = new BeatmapDifficulty
|
||||
@ -94,7 +99,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = 1236 + i,
|
||||
Mode = PlayMode.Osu,
|
||||
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
||||
Path = "insane.osu",
|
||||
Version = "Insane",
|
||||
Difficulty = new BeatmapDifficulty
|
||||
|
@ -9,12 +9,12 @@ using osu.Game.Beatmaps;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Osu.Objects;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Screens.Play;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Desktop.VisualTests.Beatmaps;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -22,12 +22,14 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
protected Player Player;
|
||||
private BeatmapDatabase db;
|
||||
private RulesetDatabase rulesets;
|
||||
|
||||
public override string Description => @"Showing everything to play the game.";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapDatabase db)
|
||||
private void load(BeatmapDatabase db, RulesetDatabase rulesets)
|
||||
{
|
||||
this.rulesets = rulesets;
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
@ -37,7 +39,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
WorkingBeatmap beatmap = null;
|
||||
|
||||
var beatmapInfo = db.Query<BeatmapInfo>().FirstOrDefault(b => b.Mode == PlayMode.Osu);
|
||||
var beatmapInfo = db.Query<BeatmapInfo>().FirstOrDefault(b => b.RulesetID == 0);
|
||||
if (beatmapInfo != null)
|
||||
beatmap = db.GetWorkingBeatmap(beatmapInfo);
|
||||
|
||||
@ -51,8 +53,8 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
objects.Add(new HitCircle
|
||||
{
|
||||
StartTime = time,
|
||||
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : 512,
|
||||
i % 4 < 2 ? 0 : 384),
|
||||
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : OsuPlayfield.BASE_SIZE.X,
|
||||
i % 4 < 2 ? 0 : OsuPlayfield.BASE_SIZE.Y),
|
||||
NewCombo = i % 4 == 0
|
||||
});
|
||||
|
||||
@ -65,6 +67,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
Difficulty = new BeatmapDifficulty(),
|
||||
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = @"Unknown",
|
||||
|
@ -2,8 +2,8 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Modes.Osu.Mods;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
|
@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Modes.UI;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
@ -16,6 +16,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
public override string Description => @"With fake data";
|
||||
|
||||
private SongProgress progress;
|
||||
private SongProgressGraph graph;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
@ -23,11 +24,20 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
Add(progress = new SongProgress
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AudioClock = new StopwatchClock(true),
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
});
|
||||
|
||||
Add(graph = new SongProgressGraph
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 200,
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
});
|
||||
|
||||
AddStep("Toggle Bar", progress.ToggleBar);
|
||||
AddWaitStep(5);
|
||||
AddStep("Toggle Bar", progress.ToggleBar);
|
||||
@ -44,6 +54,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
objects.Add(new HitObject { StartTime = i });
|
||||
|
||||
progress.Objects = objects;
|
||||
graph.Objects = objects;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
||||
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
|
@ -7,11 +7,11 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using osu.Game.Modes.Taiko.Objects;
|
||||
using osu.Game.Modes.Taiko.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.UI;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Taiko.Judgements;
|
||||
using osu.Game.Rulesets.Taiko.Objects;
|
||||
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Taiko.UI;
|
||||
using System;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
|
Reference in New Issue
Block a user