2020-04-30 15:42:38 +08: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.
|
|
|
|
|
2022-12-02 16:33:18 +08:00
|
|
|
using System;
|
2020-04-30 15:42:38 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Audio.Track;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
using osuTK;
|
|
|
|
|
2020-12-07 11:30:25 +08:00
|
|
|
namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
2020-04-30 15:42:38 +08:00
|
|
|
{
|
|
|
|
public partial class TaikoLegacyPlayfieldBackgroundRight : BeatSyncedContainer
|
|
|
|
{
|
2022-11-02 16:07:19 +08:00
|
|
|
private Sprite kiai = null!;
|
2020-04-30 15:42:38 +08:00
|
|
|
|
2022-12-02 16:33:18 +08:00
|
|
|
private bool isKiaiActive;
|
2020-04-30 15:42:38 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(ISkinSource skin)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
|
|
|
new Sprite
|
|
|
|
{
|
|
|
|
Texture = skin.GetTexture("taiko-bar-right"),
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Size = Vector2.One,
|
|
|
|
},
|
|
|
|
kiai = new Sprite
|
|
|
|
{
|
|
|
|
Texture = skin.GetTexture("taiko-bar-right-glow"),
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Size = Vector2.One,
|
|
|
|
Alpha = 0,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-12-02 16:33:18 +08:00
|
|
|
protected override void Update()
|
2020-04-30 15:42:38 +08:00
|
|
|
{
|
2022-12-02 16:33:18 +08:00
|
|
|
base.Update();
|
2020-04-30 15:42:38 +08:00
|
|
|
|
2022-12-02 16:33:18 +08:00
|
|
|
if (isKiaiActive)
|
|
|
|
kiai.Alpha = (float)Math.Min(1, kiai.Alpha + Math.Abs(Clock.ElapsedFrameTime) / 200f);
|
|
|
|
else
|
|
|
|
kiai.Alpha = (float)Math.Max(0, kiai.Alpha - Math.Abs(Clock.ElapsedFrameTime) / 200f);
|
|
|
|
}
|
2020-04-30 15:42:38 +08:00
|
|
|
|
2022-12-02 16:33:18 +08:00
|
|
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
|
|
|
{
|
|
|
|
isKiaiActive = effectPoint.KiaiMode;
|
2020-04-30 15:42:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|