mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Implement mania note + key image configs
This commit is contained in:
parent
707a6269b3
commit
db6db861c0
@ -24,6 +24,8 @@ namespace osu.Game.Skinning
|
||||
|
||||
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
|
||||
|
||||
public Dictionary<string, string> ImageLookups = new Dictionary<string, string>();
|
||||
|
||||
public readonly float[] ColumnLineWidth;
|
||||
public readonly float[] ColumnSpacing;
|
||||
public readonly float[] ColumnWidth;
|
||||
|
@ -71,12 +71,6 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
var pair = SplitKeyVal(line);
|
||||
|
||||
if (pair.Key.StartsWith("Colour"))
|
||||
{
|
||||
HandleColours(currentConfig, line);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (pair.Key)
|
||||
{
|
||||
case "ColumnLineWidth":
|
||||
@ -106,6 +100,18 @@ namespace osu.Game.Skinning
|
||||
case "LightingNWidth":
|
||||
parseArrayValue(pair.Value, currentConfig.ExplosionWidth);
|
||||
break;
|
||||
|
||||
case string _ when pair.Key.StartsWith("Colour"):
|
||||
HandleColours(currentConfig, line);
|
||||
break;
|
||||
|
||||
case string _ when pair.Key.StartsWith("NoteImage"):
|
||||
currentConfig.ImageLookups[pair.Key] = pair.Value;
|
||||
break;
|
||||
|
||||
case string _ when pair.Key.StartsWith("KeyImage"):
|
||||
currentConfig.ImageLookups[pair.Key] = pair.Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,6 +207,30 @@ namespace osu.Game.Skinning
|
||||
|
||||
case LegacyManiaSkinConfigurationLookups.ColumnLineColour:
|
||||
return SkinUtils.As<TValue>(getCustomColour(existing, "ColourColumnLine"));
|
||||
|
||||
case LegacyManiaSkinConfigurationLookups.NoteImage:
|
||||
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||
return SkinUtils.As<TValue>(getManiaImage(existing, $"NoteImage{maniaLookup.TargetColumn}"));
|
||||
|
||||
case LegacyManiaSkinConfigurationLookups.HoldNoteHeadImage:
|
||||
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||
return SkinUtils.As<TValue>(getManiaImage(existing, $"NoteImage{maniaLookup.TargetColumn}H"));
|
||||
|
||||
case LegacyManiaSkinConfigurationLookups.HoldNoteTailImage:
|
||||
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||
return SkinUtils.As<TValue>(getManiaImage(existing, $"NoteImage{maniaLookup.TargetColumn}T"));
|
||||
|
||||
case LegacyManiaSkinConfigurationLookups.HoldNoteBodyImage:
|
||||
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||
return SkinUtils.As<TValue>(getManiaImage(existing, $"NoteImage{maniaLookup.TargetColumn}L"));
|
||||
|
||||
case LegacyManiaSkinConfigurationLookups.KeyImage:
|
||||
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||
return SkinUtils.As<TValue>(getManiaImage(existing, $"KeyImage{maniaLookup.TargetColumn}"));
|
||||
|
||||
case LegacyManiaSkinConfigurationLookups.KeyImageDown:
|
||||
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||
return SkinUtils.As<TValue>(getManiaImage(existing, $"KeyImage{maniaLookup.TargetColumn}D"));
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -215,6 +239,9 @@ namespace osu.Game.Skinning
|
||||
private IBindable<Color4> getCustomColour(IHasCustomColours source, string lookup)
|
||||
=> source.CustomColours.TryGetValue(lookup, out var col) ? new Bindable<Color4>(col) : null;
|
||||
|
||||
private IBindable<string> getManiaImage(LegacyManiaSkinConfiguration source, string lookup)
|
||||
=> source.ImageLookups.TryGetValue(lookup, out var image) ? new Bindable<string>(image) : null;
|
||||
|
||||
public override Drawable GetDrawableComponent(ISkinComponent component)
|
||||
{
|
||||
switch (component)
|
||||
|
Loading…
Reference in New Issue
Block a user