mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 13:07:18 +08:00
Remove need for PlaySongSelect ctor to take a db
This commit is contained in:
parent
69cb9cf4de
commit
89effca12e
@ -1 +1 @@
|
|||||||
Subproject commit 09c18c415d280448c44cb73f2c4e60e0092b974c
|
Subproject commit d9bd79c4c15f7e5eb4e69fa7898b7d358e4516e4
|
@ -1,31 +1,32 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Desktop.VisualTests.Platform;
|
using osu.Desktop.VisualTests.Platform;
|
||||||
using osu.Framework.GameModes.Testing;
|
using osu.Framework.GameModes.Testing;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Modes;
|
using osu.Game.Modes;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
{
|
{
|
||||||
class TestCasePlaySongSelect : TestCase
|
class TestCasePlaySongSelect : TestCase
|
||||||
{
|
{
|
||||||
private BeatmapDatabase db;
|
private BeatmapDatabase db;
|
||||||
private TestStorage storage;
|
private TestStorage storage;
|
||||||
|
|
||||||
public override string Name => @"Song Select";
|
public override string Name => @"Song Select";
|
||||||
public override string Description => @"with fake data";
|
public override string Description => @"with fake data";
|
||||||
|
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
|
||||||
if (db == null)
|
if (db == null)
|
||||||
{
|
{
|
||||||
storage = new TestStorage(@"TestCasePlaySongSelect");
|
storage = new TestStorage(@"TestCasePlaySongSelect");
|
||||||
db = new BeatmapDatabase(storage);
|
db = new BeatmapDatabase(storage);
|
||||||
|
Dependencies.Cache(db, true);
|
||||||
|
|
||||||
var sets = new List<BeatmapSetInfo>();
|
var sets = new List<BeatmapSetInfo>();
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
db.Import(sets);
|
db.Import(sets);
|
||||||
}
|
}
|
||||||
|
|
||||||
Add(new PlaySongSelect(db));
|
Add(new PlaySongSelect());
|
||||||
}
|
}
|
||||||
|
|
||||||
private BeatmapSetInfo createTestBeatmapSet(int i)
|
private BeatmapSetInfo createTestBeatmapSet(int i)
|
||||||
@ -89,6 +90,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ namespace osu.Game
|
|||||||
Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host));
|
Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host));
|
||||||
|
|
||||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||||
Dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 0.01f });
|
Dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 0.01f }, true);
|
||||||
|
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
||||||
|
@ -73,11 +73,8 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <param name="database">Optionally provide a database to use instead of the OsuGame one.</param>
|
public PlaySongSelect()
|
||||||
public PlaySongSelect(BeatmapDatabase database = null)
|
|
||||||
{
|
{
|
||||||
this.database = database;
|
|
||||||
|
|
||||||
const float carouselWidth = 640;
|
const float carouselWidth = 640;
|
||||||
const float bottomToolHeight = 50;
|
const float bottomToolHeight = 50;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user