mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Some elements going forward will be shared, so it makes sense to have a common base class to add these shared elements.
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
// 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.
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
|
|
|
namespace osu.Game.Rulesets.Osu.Skinning
|
|
{
|
|
public abstract class LegacySpinner : CompositeDrawable
|
|
{
|
|
protected DrawableSpinner DrawableSpinner { get; private set; }
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(DrawableHitObject drawableHitObject)
|
|
{
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
DrawableSpinner = (DrawableSpinner)drawableHitObject;
|
|
}
|
|
|
|
protected override void LoadComplete()
|
|
{
|
|
base.LoadComplete();
|
|
|
|
DrawableSpinner.ApplyCustomUpdateState += UpdateStateTransforms;
|
|
UpdateStateTransforms(DrawableSpinner, DrawableSpinner.State.Value);
|
|
}
|
|
|
|
protected virtual void UpdateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
|
{
|
|
}
|
|
|
|
protected override void Dispose(bool isDisposing)
|
|
{
|
|
base.Dispose(isDisposing);
|
|
|
|
if (DrawableSpinner != null)
|
|
DrawableSpinner.ApplyCustomUpdateState -= UpdateStateTransforms;
|
|
}
|
|
}
|
|
}
|