1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 01:47:45 +08:00

Add support for legacy osu!mania barline height and colour spec

This commit is contained in:
Dean Herbert 2025-02-28 15:13:13 +09:00
parent 3e8dafa3c5
commit cb29459a1e
No known key found for this signature in database
6 changed files with 23 additions and 4 deletions

View File

@ -26,10 +26,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
: base(barLine) : base(barLine)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; Height = 1;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader(true)]
private void load() private void load()
{ {
AddInternal(new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.BarLine), _ => new DefaultBarLine()) AddInternal(new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.BarLine), _ => new DefaultBarLine())

View File

@ -5,17 +5,22 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Skinning;
using osuTK; using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Skinning.Legacy namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{ {
public partial class LegacyBarLine : CompositeDrawable public partial class LegacyBarLine : CompositeDrawable
{ {
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load(ISkinSource skin)
{ {
float skinHeight = skin.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.BarLineHeight)?.Value ?? 1;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = 1.2f; Height = 1.2f * skinHeight;
Colour = skin.GetManiaSkinConfig<Color4>(LegacyManiaSkinConfigurationLookups.BarLineColour)?.Value ?? Color4.White;
// Avoid flickering due to no anti-aliasing of boxes by default. // Avoid flickering due to no anti-aliasing of boxes by default.
var edgeSmoothness = new Vector2(0.3f); var edgeSmoothness = new Vector2(0.3f);

View File

@ -41,6 +41,7 @@ namespace osu.Game.Skinning
public float LightPosition = (480 - 413) * POSITION_SCALE_FACTOR; public float LightPosition = (480 - 413) * POSITION_SCALE_FACTOR;
public float ComboPosition = 111 * POSITION_SCALE_FACTOR; public float ComboPosition = 111 * POSITION_SCALE_FACTOR;
public float ScorePosition = 300 * POSITION_SCALE_FACTOR; public float ScorePosition = 300 * POSITION_SCALE_FACTOR;
public float BarLineHeight = 1;
public bool ShowJudgementLine = true; public bool ShowJudgementLine = true;
public bool KeysUnderNotes; public bool KeysUnderNotes;
public int LightFramePerSecond = 60; public int LightFramePerSecond = 60;

View File

@ -70,6 +70,9 @@ namespace osu.Game.Skinning
RightStageImage, RightStageImage,
BottomStageImage, BottomStageImage,
BarLineHeight,
BarLineColour,
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
Hit300g, Hit300g,

View File

@ -86,6 +86,10 @@ namespace osu.Game.Skinning
parseArrayValue(pair.Value, currentConfig.ColumnWidth); parseArrayValue(pair.Value, currentConfig.ColumnWidth);
break; break;
case "BarlineHeight":
currentConfig.BarLineHeight = float.Parse(pair.Value, CultureInfo.InvariantCulture);
break;
case "HitPosition": case "HitPosition":
currentConfig.HitPosition = (480 - Math.Clamp(float.Parse(pair.Value, CultureInfo.InvariantCulture), 240, 480)) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR; currentConfig.HitPosition = (480 - Math.Clamp(float.Parse(pair.Value, CultureInfo.InvariantCulture), 240, 480)) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
break; break;

View File

@ -198,9 +198,15 @@ namespace osu.Game.Skinning
case LegacyManiaSkinConfigurationLookups.ComboBreakColour: case LegacyManiaSkinConfigurationLookups.ComboBreakColour:
return SkinUtils.As<TValue>(getCustomColour(existing, "ColourBreak")); return SkinUtils.As<TValue>(getCustomColour(existing, "ColourBreak"));
case LegacyManiaSkinConfigurationLookups.BarLineColour:
return SkinUtils.As<TValue>(getCustomColour(existing, "ColourBarline"));
case LegacyManiaSkinConfigurationLookups.MinimumColumnWidth: case LegacyManiaSkinConfigurationLookups.MinimumColumnWidth:
return SkinUtils.As<TValue>(new Bindable<float>(existing.MinimumColumnWidth)); return SkinUtils.As<TValue>(new Bindable<float>(existing.MinimumColumnWidth));
case LegacyManiaSkinConfigurationLookups.BarLineHeight:
return SkinUtils.As<TValue>(new Bindable<float>(existing.BarLineHeight));
case LegacyManiaSkinConfigurationLookups.NoteBodyStyle: case LegacyManiaSkinConfigurationLookups.NoteBodyStyle:
if (existing.NoteBodyStyle != null) if (existing.NoteBodyStyle != null)