mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Merge https://github.com/ppy/osu into roompanel
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Screens.Select;
|
||||
|
@ -5,7 +5,6 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Screens.Tournament;
|
||||
using osu.Game.Screens.Tournament.Teams;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -25,57 +24,57 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
private class TestTeamList : ITeamList
|
||||
{
|
||||
public IEnumerable<Country> Teams { get; } = new[]
|
||||
public IEnumerable<DrawingsTeam> Teams { get; } = new[]
|
||||
{
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "GB",
|
||||
FullName = "United Kingdom",
|
||||
Acronym = "UK"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "FR",
|
||||
FullName = "France",
|
||||
Acronym = "FRA"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "CN",
|
||||
FullName = "China",
|
||||
Acronym = "CHN"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "AU",
|
||||
FullName = "Australia",
|
||||
Acronym = "AUS"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "JP",
|
||||
FullName = "Japan",
|
||||
Acronym = "JPN"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "RO",
|
||||
FullName = "Romania",
|
||||
Acronym = "ROM"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "IT",
|
||||
FullName = "Italy",
|
||||
Acronym = "PIZZA"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "VE",
|
||||
FullName = "Venezuela",
|
||||
Acronym = "VNZ"
|
||||
},
|
||||
new Country
|
||||
new DrawingsTeam
|
||||
{
|
||||
FlagName = "US",
|
||||
FullName = "United States of America",
|
||||
|
@ -18,6 +18,7 @@ using osu.Game.Rulesets.Taiko.UI;
|
||||
using System.Collections.Generic;
|
||||
using osu.Desktop.VisualTests.Beatmaps;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -52,6 +53,12 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
time += RNG.Next(50, 500);
|
||||
}
|
||||
|
||||
TimingInfo timing = new TimingInfo();
|
||||
timing.ControlPoints.Add(new ControlPoint
|
||||
{
|
||||
BeatLength = 200
|
||||
});
|
||||
|
||||
WorkingBeatmap beatmap = new TestWorkingBeatmap(new Beatmap
|
||||
{
|
||||
HitObjects = objects,
|
||||
@ -64,8 +71,9 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Artist = @"Unknown",
|
||||
Title = @"Sample Beatmap",
|
||||
Author = @"peppy",
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
TimingInfo = timing
|
||||
});
|
||||
|
||||
Add(new Drawable[]
|
||||
@ -77,25 +85,25 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Clock = new FramedClock(),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuHitRenderer(beatmap)
|
||||
new OsuHitRenderer(beatmap, false)
|
||||
{
|
||||
Scale = new Vector2(0.5f),
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft
|
||||
},
|
||||
new TaikoHitRenderer(beatmap)
|
||||
new TaikoHitRenderer(beatmap, false)
|
||||
{
|
||||
Scale = new Vector2(0.5f),
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight
|
||||
},
|
||||
new CatchHitRenderer(beatmap)
|
||||
new CatchHitRenderer(beatmap, false)
|
||||
{
|
||||
Scale = new Vector2(0.5f),
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft
|
||||
},
|
||||
new ManiaHitRenderer(beatmap)
|
||||
new ManiaHitRenderer(beatmap, false)
|
||||
{
|
||||
Scale = new Vector2(0.5f),
|
||||
Anchor = Anchor.BottomRight,
|
||||
|
@ -129,8 +129,6 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
};
|
||||
|
||||
Add(clockAdjustContainer);
|
||||
|
||||
load(mode);
|
||||
}
|
||||
|
||||
private int depth;
|
||||
|
81
osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs
Normal file
81
osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs
Normal file
@ -0,0 +1,81 @@
|
||||
// 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.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
internal class TestCaseManiaHitObjects : TestCase
|
||||
{
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
Add(new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(10, 0),
|
||||
// Imagine that the containers containing the drawable notes are the "columns"
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
Name = "Normal note column",
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Width = 50,
|
||||
Children = new[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
Name = "Timing section",
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativeCoordinateSpace = new Vector2(1, 10000),
|
||||
Children = new[]
|
||||
{
|
||||
new DrawableNote(new Note { StartTime = 5000 }) { AccentColour = Color4.Red },
|
||||
new DrawableNote(new Note { StartTime = 6000 }) { AccentColour = Color4.Red }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new Container
|
||||
{
|
||||
Name = "Hold note column",
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Width = 50,
|
||||
Children = new[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
Name = "Timing section",
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativeCoordinateSpace = new Vector2(1, 10000),
|
||||
Children = new[]
|
||||
{
|
||||
new DrawableHoldNote(new HoldNote
|
||||
{
|
||||
StartTime = 5000,
|
||||
Duration = 1000
|
||||
}) { AccentColour = Color4.Red }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
98
osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs
Normal file
98
osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs
Normal file
@ -0,0 +1,98 @@
|
||||
// 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.Input;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
using OpenTK;
|
||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
internal class TestCaseManiaPlayfield : TestCase
|
||||
{
|
||||
public override string Description => @"Mania playfield";
|
||||
|
||||
protected override double TimePerAction => 200;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
Action<int, SpecialColumnPosition> createPlayfield = (cols, pos) =>
|
||||
{
|
||||
Clear();
|
||||
Add(new ManiaPlayfield(cols, new List<ControlPoint>())
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
SpecialColumnPosition = pos,
|
||||
Scale = new Vector2(1, -1)
|
||||
});
|
||||
};
|
||||
|
||||
Action<int, SpecialColumnPosition> createPlayfieldWithNotes = (cols, pos) =>
|
||||
{
|
||||
Clear();
|
||||
|
||||
ManiaPlayfield playField;
|
||||
Add(playField = new ManiaPlayfield(cols, new List<ControlPoint> { new ControlPoint { BeatLength = 200 } })
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
SpecialColumnPosition = pos,
|
||||
Scale = new Vector2(1, -1)
|
||||
});
|
||||
|
||||
for (int i = 0; i < cols; i++)
|
||||
{
|
||||
playField.Add(new DrawableNote(new Note
|
||||
{
|
||||
StartTime = Time.Current + 1000,
|
||||
Column = i
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
AddStep("1 column", () => createPlayfield(1, SpecialColumnPosition.Normal));
|
||||
AddStep("4 columns", () => createPlayfield(4, SpecialColumnPosition.Normal));
|
||||
AddStep("Left special style", () => createPlayfield(4, SpecialColumnPosition.Left));
|
||||
AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right));
|
||||
AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal));
|
||||
AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal));
|
||||
AddStep("Left special style", () => createPlayfield(8, SpecialColumnPosition.Left));
|
||||
AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right));
|
||||
|
||||
AddStep("Normal special style", () => createPlayfield(4, SpecialColumnPosition.Normal));
|
||||
|
||||
AddStep("Notes", () => createPlayfieldWithNotes(4, SpecialColumnPosition.Normal));
|
||||
AddWaitStep(10);
|
||||
AddStep("Left special style", () => createPlayfieldWithNotes(4, SpecialColumnPosition.Left));
|
||||
AddWaitStep(10);
|
||||
AddStep("Right special style", () => createPlayfieldWithNotes(4, SpecialColumnPosition.Right));
|
||||
AddWaitStep(10);
|
||||
}
|
||||
|
||||
private void triggerKeyDown(Column column)
|
||||
{
|
||||
column.TriggerKeyDown(new InputState(), new KeyDownEventArgs
|
||||
{
|
||||
Key = column.Key,
|
||||
Repeat = false
|
||||
});
|
||||
}
|
||||
|
||||
private void triggerKeyUp(Column column)
|
||||
{
|
||||
column.TriggerKeyUp(new InputState(), new KeyUpEventArgs
|
||||
{
|
||||
Key = column.Key
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
public override string Description => @"Tests pause and fail overlays";
|
||||
|
||||
private PauseOverlay pauseOverlay;
|
||||
private PauseContainer.PauseOverlay pauseOverlay;
|
||||
private FailOverlay failOverlay;
|
||||
private int retryCount;
|
||||
|
||||
@ -22,7 +22,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
retryCount = 0;
|
||||
|
||||
Add(pauseOverlay = new PauseOverlay
|
||||
Add(pauseOverlay = new PauseContainer.PauseOverlay
|
||||
{
|
||||
OnResume = () => Logger.Log(@"Resume"),
|
||||
OnRetry = () => Logger.Log(@"Retry"),
|
||||
|
@ -6,16 +6,21 @@ using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays.Mods;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
internal class TestCaseModSelectOverlay : TestCase
|
||||
internal class TestCaseMods : TestCase
|
||||
{
|
||||
public override string Description => @"Tests the mod select overlay";
|
||||
public override string Description => @"Mod select overlay and in-game display";
|
||||
|
||||
private ModSelectOverlay modSelect;
|
||||
private ModDisplay modDisplay;
|
||||
|
||||
private RulesetDatabase rulesets;
|
||||
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(RulesetDatabase rulesets)
|
||||
{
|
||||
@ -33,6 +38,16 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Anchor = Anchor.BottomCentre,
|
||||
});
|
||||
|
||||
Add(modDisplay = new ModDisplay
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Position = new Vector2(0, 25),
|
||||
});
|
||||
|
||||
modDisplay.Current.BindTo(modSelect.SelectedMods);
|
||||
|
||||
AddStep("Toggle", modSelect.ToggleVisibility);
|
||||
|
||||
foreach (var ruleset in rulesets.AllRulesets)
|
47
osu.Desktop.VisualTests/Tests/TestCaseOnScreenDisplay.cs
Normal file
47
osu.Desktop.VisualTests/Tests/TestCaseOnScreenDisplay.cs
Normal file
@ -0,0 +1,47 @@
|
||||
// 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.Configuration;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
internal class TestCaseOnScreenDisplay : TestCase
|
||||
{
|
||||
private FrameworkConfigManager config;
|
||||
private Bindable<FrameSync> frameSyncMode;
|
||||
|
||||
public override string Description => @"Make it easier to see setting changes";
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
Add(new OnScreenDisplay());
|
||||
|
||||
frameSyncMode = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync);
|
||||
|
||||
FrameSync initial = frameSyncMode.Value;
|
||||
|
||||
AddRepeatStep(@"Change frame limiter", setNextMode, 3);
|
||||
|
||||
AddStep(@"Restore frame limiter", () => frameSyncMode.Value = initial);
|
||||
}
|
||||
|
||||
private void setNextMode()
|
||||
{
|
||||
var nextMode = frameSyncMode.Value + 1;
|
||||
if (nextMode > FrameSync.Unlimited)
|
||||
nextMode = FrameSync.VSync;
|
||||
frameSyncMode.Value = nextMode;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkConfigManager config)
|
||||
{
|
||||
this.config = config;
|
||||
}
|
||||
}
|
||||
}
|
@ -47,7 +47,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Accuracy = 0.98,
|
||||
MaxCombo = 123,
|
||||
Rank = ScoreRank.A,
|
||||
Date = DateTime.Now,
|
||||
Date = DateTimeOffset.Now,
|
||||
Statistics = new Dictionary<string, dynamic>()
|
||||
{
|
||||
{ "300", 50 },
|
||||
|
@ -3,12 +3,11 @@
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
|
@ -6,18 +6,18 @@ using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
internal class TestCaseOptions : TestCase
|
||||
internal class TestCaseSettings : TestCase
|
||||
{
|
||||
public override string Description => @"Tests the options overlay";
|
||||
public override string Description => @"Tests the settings overlay";
|
||||
|
||||
private OptionsOverlay options;
|
||||
private SettingsOverlay settings;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
Children = new[] { options = new OptionsOverlay() };
|
||||
options.ToggleVisibility();
|
||||
Children = new[] { settings = new SettingsOverlay() };
|
||||
settings.ToggleVisibility();
|
||||
}
|
||||
}
|
||||
}
|
@ -18,10 +18,14 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
private SongProgress progress;
|
||||
private SongProgressGraph graph;
|
||||
|
||||
private StopwatchClock clock;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
clock = new StopwatchClock(true);
|
||||
|
||||
Add(progress = new SongProgress
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -55,6 +59,9 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
progress.Objects = objects;
|
||||
graph.Objects = objects;
|
||||
|
||||
progress.AudioClock = clock;
|
||||
progress.OnSeek = pos => clock.Seek(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
// 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.Graphics;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
base.Reset();
|
||||
|
||||
Add(new BackButton());
|
||||
Add(new SkipButton());
|
||||
Add(new SkipButton(Clock.CurrentTime + 5000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user