mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 14:42:56 +08:00
wip
This commit is contained in:
parent
c31676f8f1
commit
d7f1766ee2
@ -86,7 +86,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
Child = songSelect = new TestSongSelect();
|
Child = songSelect = new TestSongSelect();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
//[Test]
|
||||||
public void TestDummy()
|
public void TestDummy()
|
||||||
{
|
{
|
||||||
AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap);
|
AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap);
|
||||||
@ -99,7 +99,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap);
|
AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
//[Test]
|
||||||
public void TestSorting()
|
public void TestSorting()
|
||||||
{
|
{
|
||||||
addManyTestMaps();
|
addManyTestMaps();
|
||||||
@ -116,11 +116,20 @@ namespace osu.Game.Tests.Visual
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestRulesetChange()
|
public void TestRulesetChange()
|
||||||
{
|
{
|
||||||
|
AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 2));
|
||||||
|
|
||||||
AddStep("import test maps", () =>
|
AddStep("import test maps", () =>
|
||||||
{
|
{
|
||||||
manager.Import(createTestBeatmapSet(0, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray()));
|
manager.Import(createTestBeatmapSet(0, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray()));
|
||||||
manager.Import(createTestBeatmapSet(1, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray()));
|
manager.Import(createTestBeatmapSet(1, rulesets.AvailableRulesets.Where(r => r.ID == 2).ToArray()));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 1));
|
||||||
|
|
||||||
|
AddUntilStep(() => songSelect.Carousel.SelectedBeatmap == null, "no selection");
|
||||||
|
|
||||||
|
AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addManyTestMaps()
|
private void addManyTestMaps()
|
||||||
|
@ -13,6 +13,7 @@ using osu.Framework.Configuration;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -310,12 +311,15 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
void performLoad()
|
void performLoad()
|
||||||
{
|
{
|
||||||
|
Logger.Log($"performLoad with b:{beatmap} r:{ruleset}");
|
||||||
|
|
||||||
WorkingBeatmap working = Beatmap.Value;
|
WorkingBeatmap working = Beatmap.Value;
|
||||||
|
|
||||||
bool preview = false;
|
bool preview = false;
|
||||||
|
|
||||||
if (ruleset?.Equals(Ruleset.Value) == false)
|
if (ruleset?.Equals(Ruleset.Value) == false)
|
||||||
{
|
{
|
||||||
|
Logger.Log($"ruleset changed from {Ruleset.Value} to {ruleset}");
|
||||||
Ruleset.Value = ruleset;
|
Ruleset.Value = ruleset;
|
||||||
|
|
||||||
// force a filter before attempting to change the beatmap.
|
// force a filter before attempting to change the beatmap.
|
||||||
@ -327,6 +331,8 @@ namespace osu.Game.Screens.Select
|
|||||||
// In these cases, the other component has already loaded the beatmap, so we don't need to do so again.
|
// In these cases, the other component has already loaded the beatmap, so we don't need to do so again.
|
||||||
if (!Equals(beatmap, Beatmap.Value.BeatmapInfo))
|
if (!Equals(beatmap, Beatmap.Value.BeatmapInfo))
|
||||||
{
|
{
|
||||||
|
Logger.Log($"beatmap changed from {Beatmap.Value.BeatmapInfo} to {beatmap}");
|
||||||
|
|
||||||
preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID;
|
preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID;
|
||||||
working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value);
|
working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value);
|
||||||
|
|
||||||
@ -467,6 +473,8 @@ namespace osu.Game.Screens.Select
|
|||||||
/// <param name="beatmap">The working beatmap.</param>
|
/// <param name="beatmap">The working beatmap.</param>
|
||||||
protected virtual void UpdateBeatmap(WorkingBeatmap beatmap)
|
protected virtual void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
|
Logger.Log($"working beatmap updated to {beatmap}");
|
||||||
|
|
||||||
if (Background is BackgroundScreenBeatmap backgroundModeBeatmap)
|
if (Background is BackgroundScreenBeatmap backgroundModeBeatmap)
|
||||||
{
|
{
|
||||||
backgroundModeBeatmap.Beatmap = beatmap;
|
backgroundModeBeatmap.Beatmap = beatmap;
|
||||||
|
Loading…
Reference in New Issue
Block a user