mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 22:33:05 +08:00
tidy up code
This commit is contained in:
parent
a42bfcb5ab
commit
aa476835e7
@ -17,17 +17,19 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||
{
|
||||
public TestSceneDrawableJudgement()
|
||||
{
|
||||
var HitWindows = new ManiaHitWindows();
|
||||
var hitWindows = new ManiaHitWindows();
|
||||
|
||||
foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Skip(1))
|
||||
{
|
||||
if (HitWindows.IsHitResultAllowed(result))
|
||||
if (hitWindows.IsHitResultAllowed(result))
|
||||
{
|
||||
AddStep("Show " + result.GetDescription(), () => SetContents(() =>
|
||||
new DrawableManiaJudgement(new JudgementResult(new HitObject(), new Judgement()) { Type = result }, null)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,31 +24,31 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
||||
/// Mapping of <see cref="HitResult"/> to ther corresponding
|
||||
/// <see cref="LegacyManiaSkinConfigurationLookups"/> value.
|
||||
/// </summary>
|
||||
private static readonly IReadOnlyDictionary<HitResult, LegacyManiaSkinConfigurationLookups> componentMapping
|
||||
private static readonly IReadOnlyDictionary<HitResult, LegacyManiaSkinConfigurationLookups> hitresult_mapping
|
||||
= new Dictionary<HitResult, LegacyManiaSkinConfigurationLookups>
|
||||
{
|
||||
{ HitResult.Perfect, LegacyManiaSkinConfigurationLookups.Hit300g },
|
||||
{ HitResult.Great, LegacyManiaSkinConfigurationLookups.Hit300 },
|
||||
{ HitResult.Good, LegacyManiaSkinConfigurationLookups.Hit200 },
|
||||
{ HitResult.Ok, LegacyManiaSkinConfigurationLookups.Hit100 },
|
||||
{ HitResult.Meh, LegacyManiaSkinConfigurationLookups.Hit50 },
|
||||
{ HitResult.Miss, LegacyManiaSkinConfigurationLookups.Hit0 }
|
||||
};
|
||||
{
|
||||
{ HitResult.Perfect, LegacyManiaSkinConfigurationLookups.Hit300g },
|
||||
{ HitResult.Great, LegacyManiaSkinConfigurationLookups.Hit300 },
|
||||
{ HitResult.Good, LegacyManiaSkinConfigurationLookups.Hit200 },
|
||||
{ HitResult.Ok, LegacyManiaSkinConfigurationLookups.Hit100 },
|
||||
{ HitResult.Meh, LegacyManiaSkinConfigurationLookups.Hit50 },
|
||||
{ HitResult.Miss, LegacyManiaSkinConfigurationLookups.Hit0 }
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Mapping of <see cref="HitResult"/> to their corresponding
|
||||
/// default filenames.
|
||||
/// </summary>
|
||||
private static readonly IReadOnlyDictionary<HitResult, string> defaultName
|
||||
private static readonly IReadOnlyDictionary<HitResult, string> default_hitresult_skin_filenames
|
||||
= new Dictionary<HitResult, string>
|
||||
{
|
||||
{ HitResult.Perfect, "mania-hit300g" },
|
||||
{ HitResult.Great, "mania-hit300" },
|
||||
{ HitResult.Good, "mania-hit200" },
|
||||
{ HitResult.Ok, "mania-hit100" },
|
||||
{ HitResult.Meh, "mania-hit50" },
|
||||
{ HitResult.Miss, "mania-hit0" }
|
||||
};
|
||||
{
|
||||
{ HitResult.Perfect, "mania-hit300g" },
|
||||
{ HitResult.Great, "mania-hit300" },
|
||||
{ HitResult.Good, "mania-hit200" },
|
||||
{ HitResult.Ok, "mania-hit100" },
|
||||
{ HitResult.Meh, "mania-hit50" },
|
||||
{ HitResult.Miss, "mania-hit0" }
|
||||
};
|
||||
|
||||
private Lazy<bool> isLegacySkin;
|
||||
|
||||
@ -129,8 +129,8 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
||||
private Drawable getResult(HitResult result)
|
||||
{
|
||||
string image = GetConfig<ManiaSkinConfigurationLookup, string>(
|
||||
new ManiaSkinConfigurationLookup(componentMapping[result])
|
||||
)?.Value ?? defaultName[result];
|
||||
new ManiaSkinConfigurationLookup(hitresult_mapping[result])
|
||||
)?.Value ?? default_hitresult_skin_filenames[result];
|
||||
|
||||
return this.GetAnimation(image, true, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user