mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
fetch ScorePosition from the skin
This commit is contained in:
parent
60379b09db
commit
f14e49c72e
@ -8,16 +8,33 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
{
|
{
|
||||||
public class DrawableManiaJudgementAdjustmentContainer : JudgementContainer<DrawableManiaJudgement>
|
public class DrawableManiaJudgementAdjustmentContainer : JudgementContainer<DrawableManiaJudgement>
|
||||||
{
|
{
|
||||||
private float scorePosition => 0;
|
private float hitTargetPosition = 110;
|
||||||
public DrawableManiaJudgementAdjustmentContainer(float hitTargetPosition)
|
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;
|
Anchor = Anchor.TopCentre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Y = hitTargetPosition + 150;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrawableManiaJudgementAdjustmentContainer()
|
|
||||||
: this(110) { }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ using osu.Game.Rulesets.Judgements;
|
|||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Mania.Skinning;
|
||||||
using osu.Game.Rulesets.Mania.UI.Components;
|
using osu.Game.Rulesets.Mania.UI.Components;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
@ -32,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 readonly JudgementContainer<DrawableManiaJudgement> judgements;
|
private DrawableManiaJudgementAdjustmentContainer judgements;
|
||||||
private readonly DrawablePool<DrawableManiaJudgement> judgementPool;
|
private readonly DrawablePool<DrawableManiaJudgement> judgementPool;
|
||||||
|
|
||||||
private readonly Drawable barLineContainer;
|
private readonly Drawable barLineContainer;
|
||||||
@ -101,7 +102,10 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
},
|
||||||
judgements = new DrawableManiaJudgementAdjustmentContainer(HIT_TARGET_POSITION),
|
judgements = new DrawableManiaJudgementAdjustmentContainer()
|
||||||
|
{
|
||||||
|
HitTargetPosition = HIT_TARGET_POSITION,
|
||||||
|
},
|
||||||
topLevelContainer = new Container { RelativeSizeAxes = Axes.Both }
|
topLevelContainer = new Container { RelativeSizeAxes = Axes.Both }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -175,6 +179,13 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnSkinChanged()
|
||||||
|
{
|
||||||
|
judgements.ScorePosition = CurrentSkin.GetConfig<ManiaSkinConfigurationLookup, float>(
|
||||||
|
new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.ScorePosition))
|
||||||
|
?.Value ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
// Due to masking differences, it is not possible to get the width of the columns container automatically
|
// Due to masking differences, it is not possible to get the width of the columns container automatically
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.UI.Scrolling
|
namespace osu.Game.Rulesets.UI.Scrolling
|
||||||
@ -18,10 +19,21 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
protected IScrollingInfo ScrollingInfo { get; private set; }
|
protected IScrollingInfo ScrollingInfo { get; private set; }
|
||||||
|
|
||||||
|
protected ISkinSource CurrentSkin;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(ISkinSource skin)
|
||||||
{
|
{
|
||||||
Direction.BindTo(ScrollingInfo.Direction);
|
Direction.BindTo(ScrollingInfo.Direction);
|
||||||
|
CurrentSkin = skin;
|
||||||
|
|
||||||
|
skin.SourceChanged += OnSkinChanged;
|
||||||
|
OnSkinChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnSkinChanged()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user