mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:23:22 +08:00
Rename DefaultTaikoDonTextureAnimation to TaikoDonTextureAnimation
This commit is contained in:
parent
8446fa98b5
commit
608596c3b3
@ -1,16 +1,14 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osuTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.UI
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
{
|
{
|
||||||
public sealed class DrawableTaikoCharacter : BeatSyncedContainer
|
public sealed class DrawableTaikoCharacter : BeatSyncedContainer
|
||||||
{
|
{
|
||||||
private static DefaultTaikoDonTextureAnimation idleDrawable, clearDrawable, kiaiDrawable, failDrawable;
|
private static TaikoDonTextureAnimation idleDrawable, clearDrawable, kiaiDrawable, failDrawable;
|
||||||
|
|
||||||
private TaikoDonAnimationState state;
|
private TaikoDonAnimationState state;
|
||||||
|
|
||||||
@ -22,7 +20,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
var xd = new Vector2(1);
|
var xd = new Vector2(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DefaultTaikoDonTextureAnimation getStateDrawable() => State switch
|
private TaikoDonTextureAnimation getStateDrawable() => State switch
|
||||||
{
|
{
|
||||||
TaikoDonAnimationState.Idle => idleDrawable,
|
TaikoDonAnimationState.Idle => idleDrawable,
|
||||||
TaikoDonAnimationState.Clear => clearDrawable,
|
TaikoDonAnimationState.Clear => clearDrawable,
|
||||||
@ -50,10 +48,10 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
InternalChildren = new[]
|
InternalChildren = new[]
|
||||||
{
|
{
|
||||||
idleDrawable = new DefaultTaikoDonTextureAnimation(TaikoDonAnimationState.Idle),
|
idleDrawable = new TaikoDonTextureAnimation(TaikoDonAnimationState.Idle),
|
||||||
clearDrawable = new DefaultTaikoDonTextureAnimation(TaikoDonAnimationState.Clear),
|
clearDrawable = new TaikoDonTextureAnimation(TaikoDonAnimationState.Clear),
|
||||||
kiaiDrawable = new DefaultTaikoDonTextureAnimation(TaikoDonAnimationState.Kiai),
|
kiaiDrawable = new TaikoDonTextureAnimation(TaikoDonAnimationState.Kiai),
|
||||||
failDrawable = new DefaultTaikoDonTextureAnimation(TaikoDonAnimationState.Fail),
|
failDrawable = new TaikoDonTextureAnimation(TaikoDonAnimationState.Fail),
|
||||||
};
|
};
|
||||||
|
|
||||||
// sets the state, to make sure we have the correct sprite loaded and set.
|
// sets the state, to make sure we have the correct sprite loaded and set.
|
||||||
|
@ -6,18 +6,19 @@ using osu.Game.Skinning;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.UI
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
{
|
{
|
||||||
public sealed class DefaultTaikoDonTextureAnimation : TextureAnimation
|
public sealed class TaikoDonTextureAnimation : TextureAnimation
|
||||||
{
|
{
|
||||||
private readonly TaikoDonAnimationState _state;
|
private readonly TaikoDonAnimationState state;
|
||||||
private int currentFrame;
|
private int currentFrame;
|
||||||
|
|
||||||
public DefaultTaikoDonTextureAnimation(TaikoDonAnimationState state) : base(false)
|
public TaikoDonTextureAnimation(TaikoDonAnimationState state) : base(false)
|
||||||
{
|
{
|
||||||
_state = state;
|
this.state = state;
|
||||||
this.Stop();
|
this.Stop();
|
||||||
|
|
||||||
Origin = Anchor.BottomLeft;
|
Origin = Anchor.BottomLeft;
|
||||||
Anchor = Anchor.BottomLeft;
|
Anchor = Anchor.BottomLeft;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -25,7 +26,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
for (int i = 0;; i++)
|
for (int i = 0;; i++)
|
||||||
{
|
{
|
||||||
var textureName = $"pippidon{_getStateString(_state)}{i}";
|
var textureName = $"pippidon{_getStateString(state)}{i}";
|
||||||
Texture texture = skin.GetTexture(textureName);
|
Texture texture = skin.GetTexture(textureName);
|
||||||
|
|
||||||
if (texture == null)
|
if (texture == null)
|
Loading…
Reference in New Issue
Block a user