1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-10 18:17:19 +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)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Height = 1;
}
[BackgroundDependencyLoader]
[BackgroundDependencyLoader(true)]
private void load()
{
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.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Skinning.Legacy
{
public partial class LegacyBarLine : CompositeDrawable
{
[BackgroundDependencyLoader]
private void load()
private void load(ISkinSource skin)
{
float skinHeight = skin.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.BarLineHeight)?.Value ?? 1;
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.
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 ComboPosition = 111 * POSITION_SCALE_FACTOR;
public float ScorePosition = 300 * POSITION_SCALE_FACTOR;
public float BarLineHeight = 1;
public bool ShowJudgementLine = true;
public bool KeysUnderNotes;
public int LightFramePerSecond = 60;

View File

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

View File

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

View File

@ -198,9 +198,15 @@ namespace osu.Game.Skinning
case LegacyManiaSkinConfigurationLookups.ComboBreakColour:
return SkinUtils.As<TValue>(getCustomColour(existing, "ColourBreak"));
case LegacyManiaSkinConfigurationLookups.BarLineColour:
return SkinUtils.As<TValue>(getCustomColour(existing, "ColourBarline"));
case LegacyManiaSkinConfigurationLookups.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:
if (existing.NoteBodyStyle != null)