diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs index b5abd9fb10..79e7d58f63 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs @@ -8,16 +8,33 @@ namespace osu.Game.Rulesets.Mania.UI { public class DrawableManiaJudgementAdjustmentContainer : JudgementContainer { - private float scorePosition => 0; - public DrawableManiaJudgementAdjustmentContainer(float hitTargetPosition) + private float hitTargetPosition = 110; + private float scorePosition; + + public float HitTargetPosition + { + get => hitTargetPosition; + set + { + hitTargetPosition = value; + Y = value + scorePosition + 150; + } + } + + public float ScorePosition + { + set + { + scorePosition = value; + Y = hitTargetPosition + value + 150; + } + } + + public DrawableManiaJudgementAdjustmentContainer() { Anchor = Anchor.TopCentre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; - Y = hitTargetPosition + 150; } - - public DrawableManiaJudgementAdjustmentContainer() - : this(110) { } } } diff --git a/osu.Game.Rulesets.Mania/UI/Stage.cs b/osu.Game.Rulesets.Mania/UI/Stage.cs index 73af205a37..d06e341744 100644 --- a/osu.Game.Rulesets.Mania/UI/Stage.cs +++ b/osu.Game.Rulesets.Mania/UI/Stage.cs @@ -10,6 +10,7 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; +using osu.Game.Rulesets.Mania.Skinning; using osu.Game.Rulesets.Mania.UI.Components; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; @@ -32,7 +33,7 @@ namespace osu.Game.Rulesets.Mania.UI public IReadOnlyList Columns => columnFlow.Content; private readonly ColumnFlow columnFlow; - private readonly JudgementContainer judgements; + private DrawableManiaJudgementAdjustmentContainer judgements; private readonly DrawablePool judgementPool; private readonly Drawable barLineContainer; @@ -101,7 +102,10 @@ namespace osu.Game.Rulesets.Mania.UI { RelativeSizeAxes = Axes.Both }, - judgements = new DrawableManiaJudgementAdjustmentContainer(HIT_TARGET_POSITION), + judgements = new DrawableManiaJudgementAdjustmentContainer() + { + HitTargetPosition = HIT_TARGET_POSITION, + }, topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } @@ -175,6 +179,13 @@ namespace osu.Game.Rulesets.Mania.UI })); } + protected override void OnSkinChanged() + { + judgements.ScorePosition = CurrentSkin.GetConfig( + new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.ScorePosition)) + ?.Value ?? 0; + } + protected override void Update() { // Due to masking differences, it is not possible to get the width of the columns container automatically diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index 9dac3f4de1..e611f09dcf 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Skinning; using osuTK; namespace osu.Game.Rulesets.UI.Scrolling @@ -18,10 +19,21 @@ namespace osu.Game.Rulesets.UI.Scrolling [Resolved] protected IScrollingInfo ScrollingInfo { get; private set; } + protected ISkinSource CurrentSkin; + [BackgroundDependencyLoader] - private void load() + private void load(ISkinSource skin) { Direction.BindTo(ScrollingInfo.Direction); + CurrentSkin = skin; + + skin.SourceChanged += OnSkinChanged; + OnSkinChanged(); + } + + protected virtual void OnSkinChanged() + { + } ///