1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 00:02:56 +08:00

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 @@ namespace osu.Game.Rulesets.Mania.UI
public IReadOnlyList<Column> Columns => columnFlow.Content; public IReadOnlyList<Column> Columns => columnFlow.Content;
private readonly ColumnFlow<Column> columnFlow; private readonly ColumnFlow<Column> columnFlow;
private DrawableManiaJudgementAdjustmentContainer judgements; private JudgementContainer<DrawableManiaJudgement> judgements;
private readonly DrawablePool<DrawableManiaJudgement> judgementPool; private readonly DrawablePool<DrawableManiaJudgement> judgementPool;
private readonly Drawable barLineContainer; private readonly Drawable barLineContainer;
@ -102,9 +102,11 @@ namespace osu.Game.Rulesets.Mania.UI
{ {
RelativeSizeAxes = Axes.Both 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 } topLevelContainer = new Container { RelativeSizeAxes = Axes.Both }
} }
@ -181,8 +183,8 @@ namespace osu.Game.Rulesets.Mania.UI
protected override void OnSkinChanged() protected override void OnSkinChanged()
{ {
judgements.ScorePosition = CurrentSkin.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.ScorePosition) judgements.Y = CurrentSkin.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.ScorePosition)
?.Value ?? 0; ?.Value ?? HIT_TARGET_POSITION + 150;
} }
protected override void Update() protected override void Update()

View File

@ -35,7 +35,7 @@ namespace osu.Game.Skinning
public float HitPosition = (480 - 402) * POSITION_SCALE_FACTOR; public float HitPosition = (480 - 402) * POSITION_SCALE_FACTOR;
public float LightPosition = (480 - 413) * 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 ShowJudgementLine = true;
public bool KeysUnderNotes; public bool KeysUnderNotes;

View File

@ -95,7 +95,7 @@ namespace osu.Game.Skinning
break; break;
case "ScorePosition": 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; break;
case "JudgementLine": case "JudgementLine":