mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:52:55 +08:00
Merge pull request #9947 from bdach/mania-legacy-background-line-padding
Add padding to mania column borders to match stable
This commit is contained in:
commit
0295ae2921
@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -20,9 +21,12 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
||||||
private readonly bool isLastColumn;
|
private readonly bool isLastColumn;
|
||||||
|
|
||||||
|
private Container borderLineContainer;
|
||||||
private Container lightContainer;
|
private Container lightContainer;
|
||||||
private Sprite light;
|
private Sprite light;
|
||||||
|
|
||||||
|
private float hitPosition;
|
||||||
|
|
||||||
public LegacyColumnBackground(bool isLastColumn)
|
public LegacyColumnBackground(bool isLastColumn)
|
||||||
{
|
{
|
||||||
this.isLastColumn = isLastColumn;
|
this.isLastColumn = isLastColumn;
|
||||||
@ -44,6 +48,9 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
bool hasRightLine = rightLineWidth > 0 && skin.GetConfig<LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version)?.Value >= 2.4m
|
bool hasRightLine = rightLineWidth > 0 && skin.GetConfig<LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version)?.Value >= 2.4m
|
||||||
|| isLastColumn;
|
|| isLastColumn;
|
||||||
|
|
||||||
|
hitPosition = GetColumnSkinConfig<float>(skin, LegacyManiaSkinConfigurationLookups.HitPosition)?.Value
|
||||||
|
?? Stage.HIT_TARGET_POSITION;
|
||||||
|
|
||||||
float lightPosition = GetColumnSkinConfig<float>(skin, LegacyManiaSkinConfigurationLookups.LightPosition)?.Value
|
float lightPosition = GetColumnSkinConfig<float>(skin, LegacyManiaSkinConfigurationLookups.LightPosition)?.Value
|
||||||
?? 0;
|
?? 0;
|
||||||
|
|
||||||
@ -63,6 +70,11 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = backgroundColour
|
Colour = backgroundColour
|
||||||
},
|
},
|
||||||
|
borderLineContainer = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
@ -80,6 +92,8 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
Scale = new Vector2(0.740f, 1),
|
Scale = new Vector2(0.740f, 1),
|
||||||
Colour = lineColour,
|
Colour = lineColour,
|
||||||
Alpha = hasRightLine ? 1 : 0
|
Alpha = hasRightLine ? 1 : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
lightContainer = new Container
|
lightContainer = new Container
|
||||||
{
|
{
|
||||||
@ -109,11 +123,15 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
{
|
{
|
||||||
lightContainer.Anchor = Anchor.TopCentre;
|
lightContainer.Anchor = Anchor.TopCentre;
|
||||||
lightContainer.Scale = new Vector2(1, -1);
|
lightContainer.Scale = new Vector2(1, -1);
|
||||||
|
|
||||||
|
borderLineContainer.Padding = new MarginPadding { Top = hitPosition };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lightContainer.Anchor = Anchor.BottomCentre;
|
lightContainer.Anchor = Anchor.BottomCentre;
|
||||||
lightContainer.Scale = Vector2.One;
|
lightContainer.Scale = Vector2.One;
|
||||||
|
|
||||||
|
borderLineContainer.Padding = new MarginPadding { Bottom = hitPosition };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user