simplify implementation and adjust the default values

This commit is contained in:
Firmatorenio 2020-12-13 22:43:36 +06:00
parent 2108844319
commit 3741c2339a
4 changed files with 9 additions and 47 deletions

View File

@ -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<DrawableManiaJudgement>
{
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;
}
}
}

View File

@ -33,7 +33,7 @@ public class Stage : ScrollingPlayfield
public IReadOnlyList<Column> Columns => columnFlow.Content;
private readonly ColumnFlow<Column> columnFlow;
private DrawableManiaJudgementAdjustmentContainer judgements;
private JudgementContainer<DrawableManiaJudgement> judgements;
private readonly DrawablePool<DrawableManiaJudgement> 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<DrawableManiaJudgement>()
{
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<float>(LegacyManiaSkinConfigurationLookups.ScorePosition)
?.Value ?? 0;
judgements.Y = CurrentSkin.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.ScorePosition)
?.Value ?? HIT_TARGET_POSITION + 150;
}
protected override void Update()

View File

@ -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;

View File

@ -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":