mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Reorder class
This commit is contained in:
parent
de20d02672
commit
6ded53b3a9
@ -16,30 +16,15 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
public abstract class SkinnableTestScene : OsuGridTestScene
|
||||
{
|
||||
private static Skin getSkinFromResources(SkinManager skins, string name)
|
||||
{
|
||||
using (var storage = new DllResourceStore("osu.Game.Rulesets.Osu.Tests.dll"))
|
||||
{
|
||||
var tempName = Path.GetTempFileName();
|
||||
|
||||
File.Delete(tempName);
|
||||
Directory.CreateDirectory(tempName);
|
||||
|
||||
var files = storage.GetAvailableResources().Where(f => f.StartsWith($"Resources/{name}"));
|
||||
|
||||
foreach (var file in files)
|
||||
using (var stream = storage.GetStream(file))
|
||||
using (var newFile = File.Create(Path.Combine(tempName, Path.GetFileName(file))))
|
||||
stream.CopyTo(newFile);
|
||||
|
||||
return skins.GetSkin(skins.Import(tempName).Result);
|
||||
}
|
||||
}
|
||||
|
||||
private Skin metricsSkin;
|
||||
private Skin defaultSkin;
|
||||
private Skin specialSkin;
|
||||
|
||||
protected SkinnableTestScene()
|
||||
: base(2, 2)
|
||||
{
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
@ -58,9 +43,24 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
Cell(3).Child = new LocalSkinOverrideContainer(specialSkin) { RelativeSizeAxes = Axes.Both }.WithChild(creationFunction());
|
||||
}
|
||||
|
||||
protected SkinnableTestScene()
|
||||
: base(2, 2)
|
||||
private static Skin getSkinFromResources(SkinManager skins, string name)
|
||||
{
|
||||
using (var storage = new DllResourceStore("osu.Game.Rulesets.Osu.Tests.dll"))
|
||||
{
|
||||
var tempName = Path.GetTempFileName();
|
||||
|
||||
File.Delete(tempName);
|
||||
Directory.CreateDirectory(tempName);
|
||||
|
||||
var files = storage.GetAvailableResources().Where(f => f.StartsWith($"Resources/{name}"));
|
||||
|
||||
foreach (var file in files)
|
||||
using (var stream = storage.GetStream(file))
|
||||
using (var newFile = File.Create(Path.Combine(tempName, Path.GetFileName(file))))
|
||||
stream.CopyTo(newFile);
|
||||
|
||||
return skins.GetSkin(skins.Import(tempName).Result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user