mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Move play modes to their own projects.
This commit is contained in:
63
osu.Game.Modes.Taiko/UI/TaikoComboCounter.cs
Normal file
63
osu.Game.Modes.Taiko/UI/TaikoComboCounter.cs
Normal file
@ -0,0 +1,63 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.Modes.UI;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows tint and scaling animations. Used in osu!taiko.
|
||||
/// </summary>
|
||||
public class TaikoComboCounter : ComboCounter
|
||||
{
|
||||
protected virtual int AnimationDuration => 300;
|
||||
protected virtual float ScaleFactor => 2;
|
||||
protected virtual EasingTypes AnimationEasing => EasingTypes.None;
|
||||
protected virtual bool CanAnimateWhenBackwards => false;
|
||||
|
||||
public TaikoComboCounter()
|
||||
{
|
||||
DisplayedCountSpriteText.Origin = Framework.Graphics.Anchor.BottomCentre;
|
||||
DisplayedCountSpriteText.Anchor = Framework.Graphics.Anchor.BottomCentre;
|
||||
}
|
||||
|
||||
protected virtual void TransformAnimate(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||
DisplayedCountSpriteText.ScaleTo(new Vector2(1, ScaleFactor));
|
||||
DisplayedCountSpriteText.ScaleTo(new Vector2(1, 1), AnimationDuration, AnimationEasing);
|
||||
}
|
||||
|
||||
protected virtual void TransformNotAnimate(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||
DisplayedCountSpriteText.ScaleTo(1);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue)
|
||||
{
|
||||
if (newValue == 0)
|
||||
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
||||
else
|
||||
DisplayedCountSpriteText.Show();
|
||||
|
||||
TransformNotAnimate(newValue);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountChange(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.FadeTo(newValue == 0 ? 0 : 1);
|
||||
|
||||
TransformNotAnimate(newValue);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountIncrement(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Show();
|
||||
|
||||
TransformAnimate(newValue);
|
||||
}
|
||||
}
|
||||
}
|
18
osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs
Normal file
18
osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs
Normal file
@ -0,0 +1,18 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Taiko.Objects;
|
||||
using osu.Game.Modes.UI;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.UI
|
||||
{
|
||||
public class TaikoHitRenderer : HitRenderer<TaikoBaseHit>
|
||||
{
|
||||
protected override HitObjectConverter<TaikoBaseHit> Converter => new TaikoConverter();
|
||||
|
||||
protected override Playfield CreatePlayfield() => new TaikoPlayfield();
|
||||
|
||||
protected override DrawableHitObject GetVisualRepresentation(TaikoBaseHit h) => null;// new DrawableTaikoHit(h);
|
||||
}
|
||||
}
|
40
osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs
Normal file
40
osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs
Normal file
@ -0,0 +1,40 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Modes.UI;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.UI
|
||||
{
|
||||
public class TaikoPlayfield : Playfield
|
||||
{
|
||||
public TaikoPlayfield()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Size = new Vector2(1, 100);
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||
|
||||
Add(new Sprite
|
||||
{
|
||||
Texture = textures.Get(@"Menu/logo"),
|
||||
Origin = Anchor.Centre,
|
||||
Scale = new Vector2(0.2f),
|
||||
RelativePositionAxes = Axes.Both,
|
||||
Position = new Vector2(0.1f, 0.5f),
|
||||
Colour = Color4.Gray
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user