1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-12 03:53:21 +08:00

Add parsing support for mania NoteBodyStyle

This commit is contained in:
Dean Herbert 2023-02-10 19:30:41 +09:00
parent 635e225d19
commit bfbffc4a68
5 changed files with 33 additions and 0 deletions

View File

@ -43,6 +43,8 @@ namespace osu.Game.Skinning
public bool ShowJudgementLine = true;
public bool KeysUnderNotes;
public LegacyNoteBodyStyle? NoteBodyStyle;
public LegacyManiaSkinConfiguration(int keys)
{
Keys = keys;

View File

@ -72,5 +72,6 @@ namespace osu.Game.Skinning
Hit50,
Hit0,
KeysUnderNotes,
NoteBodyStyle
}
}

View File

@ -114,6 +114,11 @@ namespace osu.Game.Skinning
parseArrayValue(pair.Value, currentConfig.HoldNoteLightWidth);
break;
case "NoteBodyStyle":
if (Enum.TryParse<LegacyNoteBodyStyle>(pair.Value, out var style))
currentConfig.NoteBodyStyle = style;
break;
case "WidthForNoteHeightScale":
currentConfig.WidthForNoteHeightScale = (float.Parse(pair.Value, CultureInfo.InvariantCulture)) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
break;

View File

@ -0,0 +1,15 @@
// 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.
namespace osu.Game.Skinning
{
public enum LegacyNoteBodyStyle
{
Stretch = 0,
RepeatTop = 2,
RepeatBottom = 3,
RepeatTopAndBottom = 4,
//Repeat = 1,
//RepeatMiddle = 5,
}
}

View File

@ -189,6 +189,16 @@ namespace osu.Game.Skinning
case LegacyManiaSkinConfigurationLookups.MinimumColumnWidth:
return SkinUtils.As<TValue>(new Bindable<float>(existing.MinimumColumnWidth));
case LegacyManiaSkinConfigurationLookups.NoteBodyStyle:
if (existing.NoteBodyStyle != null)
return SkinUtils.As<TValue>(new Bindable<LegacyNoteBodyStyle>(existing.NoteBodyStyle.Value));
if (GetConfig<SkinConfiguration.LegacySetting, decimal>(SkinConfiguration.LegacySetting.Version)?.Value < 2.5m)
return SkinUtils.As<TValue>(new Bindable<LegacyNoteBodyStyle>(LegacyNoteBodyStyle.Stretch));
return SkinUtils.As<TValue>(new Bindable<LegacyNoteBodyStyle>(LegacyNoteBodyStyle.RepeatBottom));
case LegacyManiaSkinConfigurationLookups.NoteImage:
Debug.Assert(maniaLookup.ColumnIndex != null);
return SkinUtils.As<TValue>(getManiaImage(existing, $"NoteImage{maniaLookup.ColumnIndex}"));