From 3741c2339a084244f98623b83b8cd71c35fe5d70 Mon Sep 17 00:00:00 2001 From: Firmatorenio Date: Sun, 13 Dec 2020 22:43:36 +0600 Subject: [PATCH] simplify implementation and adjust the default values --- ...awableManiaJudgementAdjustmentContainer.cs | 40 ------------------- osu.Game.Rulesets.Mania/UI/Stage.cs | 12 +++--- .../Skinning/LegacyManiaSkinConfiguration.cs | 2 +- osu.Game/Skinning/LegacyManiaSkinDecoder.cs | 2 +- 4 files changed, 9 insertions(+), 47 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs deleted file mode 100644 index 79e7d58f63..0000000000 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgementAdjustmentContainer.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using osu.Game.Rulesets.UI; -using osu.Framework.Graphics; - -namespace osu.Game.Rulesets.Mania.UI -{ - public class DrawableManiaJudgementAdjustmentContainer : JudgementContainer - { - 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; - } - } -} diff --git a/osu.Game.Rulesets.Mania/UI/Stage.cs b/osu.Game.Rulesets.Mania/UI/Stage.cs index db344a6934..7d6ddce815 100644 --- a/osu.Game.Rulesets.Mania/UI/Stage.cs +++ b/osu.Game.Rulesets.Mania/UI/Stage.cs @@ -33,7 +33,7 @@ public class Stage : ScrollingPlayfield public IReadOnlyList Columns => columnFlow.Content; private readonly ColumnFlow columnFlow; - private DrawableManiaJudgementAdjustmentContainer judgements; + private JudgementContainer judgements; private readonly DrawablePool judgementPool; private readonly Drawable barLineContainer; @@ -102,9 +102,11 @@ public Stage(int firstColumnIndex, StageDefinition definition, ref ManiaAction n { RelativeSizeAxes = Axes.Both }, - judgements = new DrawableManiaJudgementAdjustmentContainer() + judgements = new JudgementContainer() { - HitTargetPosition = HIT_TARGET_POSITION, + Anchor = Anchor.TopCentre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, }, topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } @@ -181,8 +183,8 @@ internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result protected override void OnSkinChanged() { - judgements.ScorePosition = CurrentSkin.GetManiaSkinConfig(LegacyManiaSkinConfigurationLookups.ScorePosition) - ?.Value ?? 0; + judgements.Y = CurrentSkin.GetManiaSkinConfig(LegacyManiaSkinConfigurationLookups.ScorePosition) + ?.Value ?? HIT_TARGET_POSITION + 150; } protected override void Update() diff --git a/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs b/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs index 40588f0ac4..77d390875b 100644 --- a/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs +++ b/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs @@ -35,7 +35,7 @@ public class LegacyManiaSkinConfiguration : IHasCustomColours public float HitPosition = (480 - 402) * POSITION_SCALE_FACTOR; public float LightPosition = (480 - 413) * POSITION_SCALE_FACTOR; - public float ScorePosition = (480 - 300) * POSITION_SCALE_FACTOR; + public float ScorePosition = 300 * POSITION_SCALE_FACTOR; public bool ShowJudgementLine = true; public bool KeysUnderNotes; diff --git a/osu.Game/Skinning/LegacyManiaSkinDecoder.cs b/osu.Game/Skinning/LegacyManiaSkinDecoder.cs index 49feb9c3f0..6a04a95040 100644 --- a/osu.Game/Skinning/LegacyManiaSkinDecoder.cs +++ b/osu.Game/Skinning/LegacyManiaSkinDecoder.cs @@ -95,7 +95,7 @@ private void flushPendingLines() break; case "ScorePosition": - currentConfig.ScorePosition = (480 - float.Parse(pair.Value, CultureInfo.InvariantCulture)) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR; + currentConfig.ScorePosition = (float.Parse(pair.Value, CultureInfo.InvariantCulture)) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR; break; case "JudgementLine":