Add parsing for hold note light/scale

This commit is contained in:
smoogipoo 2020-08-26 20:21:41 +09:00
parent e6116890af
commit c0c67c11b1
4 changed files with 22 additions and 0 deletions

View File

@ -31,6 +31,7 @@ namespace osu.Game.Skinning
public readonly float[] ColumnSpacing;
public readonly float[] ColumnWidth;
public readonly float[] ExplosionWidth;
public readonly float[] HoldNoteLightWidth;
public float HitPosition = (480 - 402) * POSITION_SCALE_FACTOR;
public float LightPosition = (480 - 413) * POSITION_SCALE_FACTOR;
@ -44,6 +45,7 @@ namespace osu.Game.Skinning
ColumnSpacing = new float[keys - 1];
ColumnWidth = new float[keys];
ExplosionWidth = new float[keys];
HoldNoteLightWidth = new float[keys];
ColumnLineWidth.AsSpan().Fill(2);
ColumnWidth.AsSpan().Fill(DEFAULT_COLUMN_SIZE);

View File

@ -34,6 +34,8 @@ namespace osu.Game.Skinning
HoldNoteHeadImage,
HoldNoteTailImage,
HoldNoteBodyImage,
HoldNoteLightImage,
HoldNoteLightScale,
ExplosionImage,
ExplosionScale,
ColumnLineColour,

View File

@ -101,6 +101,10 @@ namespace osu.Game.Skinning
parseArrayValue(pair.Value, currentConfig.ExplosionWidth);
break;
case "LightingLWidth":
parseArrayValue(pair.Value, currentConfig.HoldNoteLightWidth);
break;
case "WidthForNoteHeightScale":
float minWidth = float.Parse(pair.Value, CultureInfo.InvariantCulture) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
if (minWidth > 0)

View File

@ -220,6 +220,20 @@ namespace osu.Game.Skinning
Debug.Assert(maniaLookup.TargetColumn != null);
return SkinUtils.As<TValue>(getManiaImage(existing, $"NoteImage{maniaLookup.TargetColumn}L"));
case LegacyManiaSkinConfigurationLookups.HoldNoteLightImage:
return SkinUtils.As<TValue>(getManiaImage(existing, "LightingL"));
case LegacyManiaSkinConfigurationLookups.HoldNoteLightScale:
Debug.Assert(maniaLookup.TargetColumn != null);
if (GetConfig<LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version)?.Value < 2.5m)
return SkinUtils.As<TValue>(new Bindable<float>(1));
if (existing.HoldNoteLightWidth[maniaLookup.TargetColumn.Value] != 0)
return SkinUtils.As<TValue>(new Bindable<float>(existing.HoldNoteLightWidth[maniaLookup.TargetColumn.Value] / LegacyManiaSkinConfiguration.DEFAULT_COLUMN_SIZE));
return SkinUtils.As<TValue>(new Bindable<float>(existing.ColumnWidth[maniaLookup.TargetColumn.Value] / LegacyManiaSkinConfiguration.DEFAULT_COLUMN_SIZE));
case LegacyManiaSkinConfigurationLookups.KeyImage:
Debug.Assert(maniaLookup.TargetColumn != null);
return SkinUtils.As<TValue>(getManiaImage(existing, $"KeyImage{maniaLookup.TargetColumn}"));