mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 08:27:49 +08:00
Merge pull request #8822 from smoogipoo/columnlinewidth-skinning
Implement ColumnLineWidth skinning
This commit is contained in:
commit
7662cdd3c6
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,6 @@
|
|||||||
|
[General]
|
||||||
|
Version: 2.4
|
||||||
|
|
||||||
|
[Mania]
|
||||||
|
Keys: 4
|
||||||
|
ColumnLineWidth: 3,1,3,1,1
|
@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Width = 0.5f,
|
Width = 0.5f,
|
||||||
Child = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground, 0), _ => new DefaultColumnBackground())
|
Child = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground, 1), _ => new DefaultColumnBackground())
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = leftLineWidth,
|
Width = leftLineWidth,
|
||||||
|
Scale = new Vector2(0.740f, 1),
|
||||||
Colour = lineColour,
|
Colour = lineColour,
|
||||||
Alpha = hasLeftLine ? 1 : 0
|
Alpha = hasLeftLine ? 1 : 0
|
||||||
},
|
},
|
||||||
@ -76,6 +77,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = rightLineWidth,
|
Width = rightLineWidth,
|
||||||
|
Scale = new Vector2(0.740f, 1),
|
||||||
Colour = lineColour,
|
Colour = lineColour,
|
||||||
Alpha = hasRightLine ? 1 : 0
|
Alpha = hasRightLine ? 1 : 0
|
||||||
},
|
},
|
||||||
|
@ -74,7 +74,7 @@ namespace osu.Game.Skinning
|
|||||||
switch (pair.Key)
|
switch (pair.Key)
|
||||||
{
|
{
|
||||||
case "ColumnLineWidth":
|
case "ColumnLineWidth":
|
||||||
parseArrayValue(pair.Value, currentConfig.ColumnLineWidth);
|
parseArrayValue(pair.Value, currentConfig.ColumnLineWidth, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "ColumnSpacing":
|
case "ColumnSpacing":
|
||||||
@ -124,7 +124,7 @@ namespace osu.Game.Skinning
|
|||||||
pendingLines.Clear();
|
pendingLines.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseArrayValue(string value, float[] output)
|
private void parseArrayValue(string value, float[] output, bool applyScaleFactor = true)
|
||||||
{
|
{
|
||||||
string[] values = value.Split(',');
|
string[] values = value.Split(',');
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ namespace osu.Game.Skinning
|
|||||||
if (i >= output.Length)
|
if (i >= output.Length)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
output[i] = float.Parse(values[i], CultureInfo.InvariantCulture) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
|
output[i] = float.Parse(values[i], CultureInfo.InvariantCulture) * (applyScaleFactor ? LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR : 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,14 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
case LegacyManiaSkinConfigurationLookups.RightStageImage:
|
case LegacyManiaSkinConfigurationLookups.RightStageImage:
|
||||||
return SkinUtils.As<TValue>(getManiaImage(existing, "StageRight"));
|
return SkinUtils.As<TValue>(getManiaImage(existing, "StageRight"));
|
||||||
|
|
||||||
|
case LegacyManiaSkinConfigurationLookups.LeftLineWidth:
|
||||||
|
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||||
|
return SkinUtils.As<TValue>(new Bindable<float>(existing.ColumnLineWidth[maniaLookup.TargetColumn.Value]));
|
||||||
|
|
||||||
|
case LegacyManiaSkinConfigurationLookups.RightLineWidth:
|
||||||
|
Debug.Assert(maniaLookup.TargetColumn != null);
|
||||||
|
return SkinUtils.As<TValue>(new Bindable<float>(existing.ColumnLineWidth[maniaLookup.TargetColumn.Value + 1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user