1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 16:12:54 +08:00

Add missing judgement line

This commit is contained in:
smoogipoo 2020-03-31 12:26:31 +09:00
parent 02237133cb
commit 71387016b2
5 changed files with 30 additions and 6 deletions

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI.Scrolling;
@ -34,17 +35,31 @@ namespace osu.Game.Rulesets.Mania.Skinning
new LegacyManiaSkinConfigurationLookup(stage?.Columns.Count ?? 4, LegacyManiaSkinConfigurationLookups.HitTargetImage))?.Value
?? "mania-stage-hint";
bool showJudgementLine = skin.GetConfig<LegacyManiaSkinConfigurationLookup, bool>(
new LegacyManiaSkinConfigurationLookup(stage?.Columns.Count ?? 4, LegacyManiaSkinConfigurationLookups.ShowJudgementLine))?.Value
?? true;
InternalChild = directionContainer = new Container
{
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Child = new Sprite
Children = new Drawable[]
{
Texture = skin.GetTexture(targetImage),
Scale = new Vector2(1, 0.9f * 1.6025f),
RelativeSizeAxes = Axes.X,
Width = 1
new Sprite
{
Texture = skin.GetTexture(targetImage),
Scale = new Vector2(1, 0.9f * 1.6025f),
RelativeSizeAxes = Axes.X,
Width = 1
},
new Box
{
Anchor = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
Height = 1,
Alpha = showJudgementLine ? 0.9f : 0
}
}
};

View File

@ -14,6 +14,7 @@ namespace osu.Game.Skinning
public readonly float[] ColumnWidth;
public float HitPosition = 124.8f; // (480 - 402) * 1.6f
public bool ShowJudgementLine = true;
public LegacyManiaSkinConfiguration(int keys)
{

View File

@ -20,6 +20,7 @@ namespace osu.Game.Skinning
public enum LegacyManiaSkinConfigurationLookups
{
HitPosition,
HitTargetImage
HitTargetImage,
ShowJudgementLine
}
}

View File

@ -90,6 +90,10 @@ namespace osu.Game.Skinning
case "HitPosition":
currentConfig.HitPosition = (480 - float.Parse(pair.Value, CultureInfo.InvariantCulture)) * size_scale_factor;
break;
case "JudgementLine":
currentConfig.ShowJudgementLine = pair.Value == "1";
break;
}
}
}

View File

@ -131,6 +131,9 @@ namespace osu.Game.Skinning
{
case LegacyManiaSkinConfigurationLookups.HitPosition:
return SkinUtils.As<TValue>(new Bindable<float>(existing.HitPosition));
case LegacyManiaSkinConfigurationLookups.ShowJudgementLine:
return SkinUtils.As<TValue>(new Bindable<bool>(existing.ShowJudgementLine));
}
break;