mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Remove "default" prefix from naming
This commit is contained in:
parent
1c4e02fae8
commit
41e69fbca6
@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
});
|
||||
}
|
||||
|
||||
private class TestSkin : DefaultSkinTriangles
|
||||
private class TestSkin : TrianglesSkin
|
||||
{
|
||||
public bool FlipCatcherPlate { get; set; }
|
||||
|
||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
|
||||
[Test]
|
||||
public void TestDefaultSkin()
|
||||
{
|
||||
AddStep("set default skin", () => skins.CurrentSkinInfo.Value = DefaultSkinTriangles.CreateInfo().ToLiveUnmanaged());
|
||||
AddStep("set default skin", () => skins.CurrentSkinInfo.Value = TrianglesSkin.CreateInfo().ToLiveUnmanaged());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
|
||||
hitCircle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
Child = new SkinProvidingContainer(new DefaultSkinTriangles(null))
|
||||
Child = new SkinProvidingContainer(new TrianglesSkin(null))
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = drawableHitCircle = new DrawableHitCircle(hitCircle)
|
||||
|
@ -202,7 +202,7 @@ namespace osu.Game.Tests.Skins.IO
|
||||
skinManager.CurrentSkinInfo.Value.PerformRead(s =>
|
||||
{
|
||||
Assert.IsFalse(s.Protected);
|
||||
Assert.AreEqual(typeof(DefaultSkinTriangles), s.CreateInstance(skinManager).GetType());
|
||||
Assert.AreEqual(typeof(TrianglesSkin), s.CreateInstance(skinManager).GetType());
|
||||
|
||||
new LegacySkinExporter(osu.Dependencies.Get<Storage>()).ExportModelTo(s, exportStream);
|
||||
|
||||
@ -215,7 +215,7 @@ namespace osu.Game.Tests.Skins.IO
|
||||
{
|
||||
Assert.IsFalse(s.Protected);
|
||||
Assert.AreNotEqual(originalSkinId, s.ID);
|
||||
Assert.AreEqual(typeof(DefaultSkinTriangles), s.CreateInstance(skinManager).GetType());
|
||||
Assert.AreEqual(typeof(TrianglesSkin), s.CreateInstance(skinManager).GetType());
|
||||
});
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
[Test]
|
||||
public void TestEmptyLegacyBeatmapSkinFallsBack()
|
||||
{
|
||||
CreateSkinTest(DefaultSkinTriangles.CreateInfo(), () => new LegacyBeatmapSkin(new BeatmapInfo(), null));
|
||||
CreateSkinTest(TrianglesSkin.CreateInfo(), () => new LegacyBeatmapSkin(new BeatmapInfo(), null));
|
||||
AddUntilStep("wait for hud load", () => Player.ChildrenOfType<SkinnableTargetContainer>().All(c => c.ComponentsLoaded));
|
||||
AddAssert("hud from default skin", () => AssertComponentsFromExpectedSource(SkinnableTarget.MainHUDComponents, skinManager.CurrentSkin.Value));
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
[Test]
|
||||
public void TestEditDefaultSkin()
|
||||
{
|
||||
AddAssert("is default skin", () => skinManager.CurrentSkinInfo.Value.ID == SkinInfo.DEFAULT_SKIN_TRIANGLES);
|
||||
AddAssert("is default skin", () => skinManager.CurrentSkinInfo.Value.ID == SkinInfo.TRIANGLES_SKIN);
|
||||
|
||||
AddStep("open settings", () => { Game.Settings.Show(); });
|
||||
|
||||
@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
AddStep("open skin editor", () => skinEditor.Show());
|
||||
|
||||
// Until step required as the skin editor may take time to load (and an extra scheduled frame for the mutable part).
|
||||
AddUntilStep("is modified default skin", () => skinManager.CurrentSkinInfo.Value.ID != SkinInfo.DEFAULT_SKIN_TRIANGLES);
|
||||
AddUntilStep("is modified default skin", () => skinManager.CurrentSkinInfo.Value.ID != SkinInfo.TRIANGLES_SKIN);
|
||||
AddAssert("is not protected", () => skinManager.CurrentSkinInfo.Value.PerformRead(s => !s.Protected));
|
||||
|
||||
AddUntilStep("export button enabled", () => Game.Settings.ChildrenOfType<SkinSection.ExportSkinButton>().SingleOrDefault()?.Enabled.Value == true);
|
||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Configuration
|
||||
{
|
||||
// UI/selection defaults
|
||||
SetDefault(OsuSetting.Ruleset, string.Empty);
|
||||
SetDefault(OsuSetting.Skin, SkinInfo.DEFAULT_SKIN_TRIANGLES.ToString());
|
||||
SetDefault(OsuSetting.Skin, SkinInfo.TRIANGLES_SKIN.ToString());
|
||||
|
||||
SetDefault(OsuSetting.BeatmapDetailTab, PlayBeatmapDetailArea.TabType.Details);
|
||||
SetDefault(OsuSetting.BeatmapDetailModsFilter, false);
|
||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
// In the future we should change this to properly handle ChangeSet events.
|
||||
dropdownItems.Clear();
|
||||
|
||||
dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.DEFAULT_SKIN_TRIANGLES).ToLive(realm));
|
||||
dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.TRIANGLES_SKIN).ToLive(realm));
|
||||
dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.CLASSIC_SKIN).ToLive(realm));
|
||||
|
||||
dropdownItems.Add(random_skin_info);
|
||||
|
@ -130,7 +130,7 @@ namespace osu.Game.Screens.Backgrounds
|
||||
|
||||
case BackgroundSource.Skin:
|
||||
// default skins should use the default background rotation, which won't be the case if a SkinBackground is created for them.
|
||||
if (skin.Value is DefaultSkinTriangles || skin.Value is DefaultLegacySkin)
|
||||
if (skin.Value is TrianglesSkin || skin.Value is DefaultLegacySkin)
|
||||
break;
|
||||
|
||||
newBackground = new SkinBackground(skin.Value, getBackgroundTextureName());
|
||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
}
|
||||
|
||||
int lastDefaultSkinIndex = sources.IndexOf(sources.OfType<DefaultSkinTriangles>().LastOrDefault());
|
||||
int lastDefaultSkinIndex = sources.IndexOf(sources.OfType<TrianglesSkin>().LastOrDefault());
|
||||
|
||||
// Ruleset resources should be given the ability to override game-wide defaults
|
||||
// This is achieved by placing them before the last instance of DefaultSkin.
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Skinning
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class SkinInfo : RealmObject, IHasRealmFiles, IEquatable<SkinInfo>, IHasGuidPrimaryKey, ISoftDelete, IHasNamedFiles
|
||||
{
|
||||
internal static readonly Guid DEFAULT_SKIN_TRIANGLES = new Guid("2991CFD8-2140-469A-BCB9-2EC23FBCE4AD");
|
||||
internal static readonly Guid TRIANGLES_SKIN = new Guid("2991CFD8-2140-469A-BCB9-2EC23FBCE4AD");
|
||||
internal static readonly Guid CLASSIC_SKIN = new Guid("81F02CD3-EEC6-4865-AC23-FAE26A386187");
|
||||
internal static readonly Guid RANDOM_SKIN = new Guid("D39DFEFB-477C-4372-B1EA-2BCEA5FB8908");
|
||||
|
||||
@ -56,7 +56,7 @@ namespace osu.Game.Skinning
|
||||
// This defaults to triangles to catch the case where a user has a modified triangles skin.
|
||||
// If we ever add more default skins in the future this will need some kind of proper migration rather than
|
||||
// a single catch.
|
||||
return new DefaultSkinTriangles(this, resources);
|
||||
return new TrianglesSkin(this, resources);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,9 +49,9 @@ namespace osu.Game.Skinning
|
||||
|
||||
public readonly Bindable<Skin> CurrentSkin = new Bindable<Skin>();
|
||||
|
||||
public readonly Bindable<Live<SkinInfo>> CurrentSkinInfo = new Bindable<Live<SkinInfo>>(Skinning.DefaultSkinTriangles.CreateInfo().ToLiveUnmanaged())
|
||||
public readonly Bindable<Live<SkinInfo>> CurrentSkinInfo = new Bindable<Live<SkinInfo>>(TrianglesSkin.CreateInfo().ToLiveUnmanaged())
|
||||
{
|
||||
Default = Skinning.DefaultSkinTriangles.CreateInfo().ToLiveUnmanaged()
|
||||
Default = TrianglesSkin.CreateInfo().ToLiveUnmanaged()
|
||||
};
|
||||
|
||||
private readonly SkinImporter skinImporter;
|
||||
@ -86,7 +86,7 @@ namespace osu.Game.Skinning
|
||||
var defaultSkins = new[]
|
||||
{
|
||||
DefaultLegacySkin = new DefaultLegacySkin(this),
|
||||
DefaultSkinTriangles = new DefaultSkinTriangles(this),
|
||||
DefaultSkinTriangles = new TrianglesSkin(this),
|
||||
};
|
||||
|
||||
// Ensure the default entries are present.
|
||||
@ -125,7 +125,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
if (randomChoices.Length == 0)
|
||||
{
|
||||
CurrentSkinInfo.Value = Skinning.DefaultSkinTriangles.CreateInfo().ToLiveUnmanaged();
|
||||
CurrentSkinInfo.Value = TrianglesSkin.CreateInfo().ToLiveUnmanaged();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ namespace osu.Game.Skinning
|
||||
Guid currentUserSkin = CurrentSkinInfo.Value.ID;
|
||||
|
||||
if (items.Any(s => s.ID == currentUserSkin))
|
||||
scheduler.Add(() => CurrentSkinInfo.Value = Skinning.DefaultSkinTriangles.CreateInfo().ToLiveUnmanaged());
|
||||
scheduler.Add(() => CurrentSkinInfo.Value = TrianglesSkin.CreateInfo().ToLiveUnmanaged());
|
||||
|
||||
Delete(items.ToList(), silent);
|
||||
});
|
||||
|
@ -112,7 +112,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
// Temporarily used to exclude undesirable ISkin implementations
|
||||
static bool isUserSkin(ISkin skin)
|
||||
=> skin.GetType() == typeof(DefaultSkinTriangles)
|
||||
=> skin.GetType() == typeof(TrianglesSkin)
|
||||
|| skin.GetType() == typeof(DefaultLegacySkin)
|
||||
|| skin.GetType() == typeof(LegacySkin);
|
||||
}
|
||||
|
@ -22,26 +22,26 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
public class DefaultSkinTriangles : Skin
|
||||
public class TrianglesSkin : Skin
|
||||
{
|
||||
public static SkinInfo CreateInfo() => new SkinInfo
|
||||
{
|
||||
ID = osu.Game.Skinning.SkinInfo.DEFAULT_SKIN_TRIANGLES,
|
||||
ID = osu.Game.Skinning.SkinInfo.TRIANGLES_SKIN,
|
||||
Name = "osu! \"triangles\" (2017)",
|
||||
Creator = "team osu!",
|
||||
Protected = true,
|
||||
InstantiationInfo = typeof(DefaultSkinTriangles).GetInvariantInstantiationInfo()
|
||||
InstantiationInfo = typeof(TrianglesSkin).GetInvariantInstantiationInfo()
|
||||
};
|
||||
|
||||
private readonly IStorageResourceProvider resources;
|
||||
|
||||
public DefaultSkinTriangles(IStorageResourceProvider resources)
|
||||
public TrianglesSkin(IStorageResourceProvider resources)
|
||||
: this(CreateInfo(), resources)
|
||||
{
|
||||
}
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedWithFixedConstructorSignature)]
|
||||
public DefaultSkinTriangles(SkinInfo skin, IStorageResourceProvider resources)
|
||||
public TrianglesSkin(SkinInfo skin, IStorageResourceProvider resources)
|
||||
: base(skin, resources)
|
||||
{
|
||||
this.resources = resources;
|
@ -30,7 +30,7 @@ namespace osu.Game.Tests.Visual
|
||||
public abstract class SkinnableTestScene : OsuGridTestScene, IStorageResourceProvider
|
||||
{
|
||||
private Skin metricsSkin;
|
||||
private Skin defaultSkinTriangles;
|
||||
private Skin trianglesSkin;
|
||||
private Skin specialSkin;
|
||||
private Skin oldSkin;
|
||||
|
||||
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual
|
||||
var dllStore = new DllResourceStore(GetType().Assembly);
|
||||
|
||||
metricsSkin = new TestLegacySkin(new SkinInfo { Name = "metrics-skin" }, new NamespacedResourceStore<byte[]>(dllStore, "Resources/metrics_skin"), this, true);
|
||||
defaultSkinTriangles = new DefaultLegacySkin(this);
|
||||
trianglesSkin = new DefaultLegacySkin(this);
|
||||
specialSkin = new TestLegacySkin(new SkinInfo { Name = "special-skin" }, new NamespacedResourceStore<byte[]>(dllStore, "Resources/special_skin"), this, true);
|
||||
oldSkin = new TestLegacySkin(new SkinInfo { Name = "old-skin" }, new NamespacedResourceStore<byte[]>(dllStore, "Resources/old_skin"), this, true);
|
||||
}
|
||||
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
Cell(0).Child = createProvider(null, creationFunction, beatmap);
|
||||
Cell(1).Child = createProvider(metricsSkin, creationFunction, beatmap);
|
||||
Cell(2).Child = createProvider(defaultSkinTriangles, creationFunction, beatmap);
|
||||
Cell(2).Child = createProvider(trianglesSkin, creationFunction, beatmap);
|
||||
Cell(3).Child = createProvider(specialSkin, creationFunction, beatmap);
|
||||
Cell(4).Child = createProvider(oldSkin, creationFunction, beatmap);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user