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:
parent
635e225d19
commit
bfbffc4a68
@ -43,6 +43,8 @@ namespace osu.Game.Skinning
|
||||
public bool ShowJudgementLine = true;
|
||||
public bool KeysUnderNotes;
|
||||
|
||||
public LegacyNoteBodyStyle? NoteBodyStyle;
|
||||
|
||||
public LegacyManiaSkinConfiguration(int keys)
|
||||
{
|
||||
Keys = keys;
|
||||
|
@ -72,5 +72,6 @@ namespace osu.Game.Skinning
|
||||
Hit50,
|
||||
Hit0,
|
||||
KeysUnderNotes,
|
||||
NoteBodyStyle
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
15
osu.Game/Skinning/LegacyNoteBodyStyle.cs
Normal file
15
osu.Game/Skinning/LegacyNoteBodyStyle.cs
Normal 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,
|
||||
}
|
||||
}
|
@ -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}"));
|
||||
|
Loading…
Reference in New Issue
Block a user