mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:47:29 +08:00
Remove HUD skin component lookup in favour of MainHUDComponents
target system
This commit is contained in:
parent
a96603f025
commit
08ee1e4853
@ -12,7 +12,6 @@ using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
@ -81,13 +80,12 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
})
|
||||
{
|
||||
Children = new[]
|
||||
Children = new Drawable[]
|
||||
{
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ComboCounter)),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreCounter)),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.AccuracyCounter)),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.HealthDisplay)),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.SongProgress)),
|
||||
new DefaultComboCounter(),
|
||||
new DefaultScoreCounter(),
|
||||
new DefaultAccuracyCounter(),
|
||||
new DefaultHealthDisplay(),
|
||||
}
|
||||
};
|
||||
|
||||
@ -95,29 +93,6 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case HUDSkinComponent hudComponent:
|
||||
{
|
||||
switch (hudComponent.Component)
|
||||
{
|
||||
case HUDSkinComponents.ComboCounter:
|
||||
return new DefaultComboCounter();
|
||||
|
||||
case HUDSkinComponents.ScoreCounter:
|
||||
return new DefaultScoreCounter();
|
||||
|
||||
case HUDSkinComponents.AccuracyCounter:
|
||||
return new DefaultAccuracyCounter();
|
||||
|
||||
case HUDSkinComponents.HealthDisplay:
|
||||
return new DefaultHealthDisplay();
|
||||
|
||||
case HUDSkinComponents.SongProgress:
|
||||
return new SongProgress();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -1,22 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
public class HUDSkinComponent : ISkinComponent
|
||||
{
|
||||
public readonly HUDSkinComponents Component;
|
||||
|
||||
public HUDSkinComponent(HUDSkinComponents component)
|
||||
{
|
||||
Component = component;
|
||||
}
|
||||
|
||||
protected virtual string ComponentName => Component.ToString();
|
||||
|
||||
public string LookupName =>
|
||||
string.Join('/', new[] { "HUD", ComponentName }.Where(s => !string.IsNullOrEmpty(s)));
|
||||
}
|
||||
}
|
@ -17,7 +17,6 @@ using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -344,15 +343,22 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
})
|
||||
{
|
||||
Children = new[]
|
||||
{
|
||||
// TODO: these should fallback to the osu!classic skin.
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ComboCounter)) ?? new DefaultComboCounter(),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreCounter)) ?? new DefaultScoreCounter(),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.AccuracyCounter)) ?? new DefaultAccuracyCounter(),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.HealthDisplay)) ?? new DefaultHealthDisplay(),
|
||||
GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.SongProgress)) ?? new SongProgress(),
|
||||
}
|
||||
Children = this.HasFont(LegacyFont.Score)
|
||||
? new Drawable[]
|
||||
{
|
||||
new LegacyComboCounter(),
|
||||
new LegacyScoreCounter(),
|
||||
new LegacyAccuracyCounter(),
|
||||
new LegacyHealthDisplay(),
|
||||
}
|
||||
: new Drawable[]
|
||||
{
|
||||
// TODO: these should fallback to using osu!classic skin textures, rather than doing this.
|
||||
new DefaultComboCounter(),
|
||||
new DefaultScoreCounter(),
|
||||
new DefaultAccuracyCounter(),
|
||||
new DefaultHealthDisplay(),
|
||||
}
|
||||
};
|
||||
|
||||
return skinnableTargetWrapper;
|
||||
@ -360,29 +366,6 @@ namespace osu.Game.Skinning
|
||||
|
||||
return null;
|
||||
|
||||
case HUDSkinComponent hudComponent:
|
||||
{
|
||||
if (!this.HasFont(LegacyFont.Score))
|
||||
return null;
|
||||
|
||||
switch (hudComponent.Component)
|
||||
{
|
||||
case HUDSkinComponents.ComboCounter:
|
||||
return new LegacyComboCounter();
|
||||
|
||||
case HUDSkinComponents.ScoreCounter:
|
||||
return new LegacyScoreCounter();
|
||||
|
||||
case HUDSkinComponents.AccuracyCounter:
|
||||
return new LegacyAccuracyCounter();
|
||||
|
||||
case HUDSkinComponents.HealthDisplay:
|
||||
return new LegacyHealthDisplay();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
case GameplaySkinComponent<HitResult> resultComponent:
|
||||
Func<Drawable> createDrawable = () => getJudgementAnimation(resultComponent.Component);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user