mirror of
https://github.com/osukey/osukey.git
synced 2025-08-01 21:58:46 +09:00
Merge branch 'master' into mod-overlay
# Conflicts: # osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj # osu.Game/Screens/Select/PlaySongSelect.cs # osu.Game/osu.Game.csproj
This commit is contained in:
80
osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs
Normal file
80
osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs
Normal file
@ -0,0 +1,80 @@
|
||||
// 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.Screens.Testing;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Dialog;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
class TestCaseDialogOverlay : TestCase
|
||||
{
|
||||
public override string Name => @"Dialog Overlay";
|
||||
public override string Description => @"Display dialogs";
|
||||
|
||||
DialogOverlay overlay;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
Add(overlay = new DialogOverlay());
|
||||
|
||||
AddButton("dialog #1", () => overlay.Push(new PopupDialog
|
||||
{
|
||||
Icon = FontAwesome.fa_trash_o,
|
||||
HeaderText = @"Confirm deletion of",
|
||||
BodyText = @"Ayase Rie - Yuima-ru*World TVver.",
|
||||
Buttons = new PopupDialogButton[]
|
||||
{
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"I never want to see this again.",
|
||||
Action = () => System.Console.WriteLine(@"OK"),
|
||||
},
|
||||
new PopupDialogCancelButton
|
||||
{
|
||||
Text = @"Firetruck, I still want quick ranks!",
|
||||
Action = () => System.Console.WriteLine(@"Cancel"),
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
AddButton("dialog #2", () => overlay.Push(new PopupDialog
|
||||
{
|
||||
Icon = FontAwesome.fa_gear,
|
||||
HeaderText = @"What do you want to do with",
|
||||
BodyText = "Camellia as \"Bang Riot\" - Blastix Riotz",
|
||||
Buttons = new PopupDialogButton[]
|
||||
{
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Manage collections",
|
||||
},
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Delete...",
|
||||
},
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Remove from unplayed",
|
||||
},
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Clear local scores",
|
||||
},
|
||||
new PopupDialogOkButton
|
||||
{
|
||||
Text = @"Edit",
|
||||
},
|
||||
new PopupDialogCancelButton
|
||||
{
|
||||
Text = @"Cancel",
|
||||
},
|
||||
},
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
@ -95,7 +95,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
AddButton(@"slider", () => load(HitObjectType.Slider));
|
||||
AddButton(@"spinner", () => load(HitObjectType.Spinner));
|
||||
|
||||
AddToggle(@"auto", () => { auto = !auto; load(mode); });
|
||||
AddToggle(@"auto", (state) => { auto = state; load(mode); });
|
||||
|
||||
ButtonsContainer.Add(new SpriteText { Text = "Playback Speed" });
|
||||
ButtonsContainer.Add(new BasicSliderBar<double>
|
||||
|
@ -5,6 +5,7 @@ using osu.Framework.Screens.Testing;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Anchor = Anchor.Centre
|
||||
};
|
||||
Add(mc);
|
||||
AddToggle(@"Show", mc.ToggleVisibility);
|
||||
AddToggle(@"Show", (state) => mc.State = state ? Visibility.Visible : Visibility.Hidden);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.MathUtils;
|
||||
using osu.Game.Overlays;
|
||||
using System.Linq;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Origin = Anchor.TopRight,
|
||||
});
|
||||
|
||||
AddToggle(@"show", manager.ToggleVisibility);
|
||||
AddToggle(@"show", (state) => manager.State = state ? Visibility.Visible : Visibility.Hidden);
|
||||
|
||||
AddButton(@"simple #1", sendNotification1);
|
||||
AddButton(@"simple #2", sendNotification2);
|
||||
|
@ -1,9 +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 System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Desktop.VisualTests.Platform;
|
||||
using osu.Framework.Screens.Testing;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Select;
|
||||
@ -14,6 +16,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
private BeatmapDatabase db, oldDb;
|
||||
private TestStorage storage;
|
||||
private PlaySongSelect songSelect;
|
||||
|
||||
public override string Name => @"Song Select";
|
||||
public override string Description => @"with fake data";
|
||||
@ -35,9 +38,15 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
db.Import(sets);
|
||||
}
|
||||
Add(new PlaySongSelect());
|
||||
|
||||
Add(songSelect = new PlaySongSelect());
|
||||
|
||||
AddButton(@"Sort by Artist", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Artist; });
|
||||
AddButton(@"Sort by Title", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Title; });
|
||||
AddButton(@"Sort by Author", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Author; });
|
||||
AddButton(@"Sort by Difficulty", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Difficulty; });
|
||||
}
|
||||
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
if (oldDb != null)
|
||||
@ -59,9 +68,10 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
OnlineBeatmapSetID = 1234 + i,
|
||||
Artist = "MONACA",
|
||||
Title = "Black Song",
|
||||
Author = "Some Guy",
|
||||
// Create random metadata, then we can check if sorting works based on these
|
||||
Artist = "MONACA " + RNG.Next(0, 9),
|
||||
Title = "Black Song " + RNG.Next(0, 9),
|
||||
Author = "Some Guy " + RNG.Next(0, 9),
|
||||
},
|
||||
Beatmaps = new List<BeatmapInfo>(new[]
|
||||
{
|
||||
|
@ -22,9 +22,9 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
FlowContainer flow;
|
||||
FillFlowContainer flow;
|
||||
|
||||
Add(flow = new FlowContainer()
|
||||
Add(flow = new FillFlowContainer()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.5f),
|
||||
|
@ -195,6 +195,7 @@
|
||||
<Compile Include="Tests\TestCaseOptions.cs" />
|
||||
<Compile Include="Tests\TestCasePauseOverlay.cs" />
|
||||
<Compile Include="Tests\TestCaseModSelectOverlay.cs" />
|
||||
<Compile Include="Tests\TestCaseDialogOverlay.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
|
Reference in New Issue
Block a user