2019-01-24 17:43:03 +09:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
#nullable disable
|
|
|
|
|
2025-01-25 20:17:21 -05:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Bindables;
|
2017-09-11 17:53:27 +09:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2020-11-17 14:59:34 +09:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2025-01-25 20:17:21 -05:00
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
2017-09-11 17:53:27 +09:00
|
|
|
namespace osu.Game.Rulesets.Mania.UI
|
|
|
|
{
|
2018-05-21 23:24:10 +03:00
|
|
|
public partial class DrawableManiaJudgement : DrawableJudgement
|
2017-09-11 17:53:27 +09:00
|
|
|
{
|
2025-01-25 20:17:21 -05:00
|
|
|
private IBindable<ScrollingDirection> direction;
|
2020-11-17 14:59:34 +09:00
|
|
|
|
2025-01-25 20:17:21 -05:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(IScrollingInfo scrollingInfo)
|
2020-11-17 14:59:34 +09:00
|
|
|
{
|
2025-01-25 20:17:21 -05:00
|
|
|
direction = scrollingInfo.Direction.GetBoundCopy();
|
|
|
|
direction.BindValueChanged(_ => onDirectionChanged(), true);
|
|
|
|
}
|
2020-12-14 13:07:55 +09:00
|
|
|
|
2025-01-25 20:17:21 -05:00
|
|
|
private void onDirectionChanged()
|
|
|
|
{
|
|
|
|
Anchor = direction.Value == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
|
|
|
|
Origin = Anchor.Centre;
|
2020-11-17 14:59:34 +09:00
|
|
|
}
|
2025-01-25 20:17:21 -05:00
|
|
|
|
|
|
|
protected override Drawable CreateDefaultJudgement(HitResult result) => new DefaultManiaJudgementPiece(result);
|
2017-09-11 17:53:27 +09:00
|
|
|
}
|
|
|
|
}
|