2017-03-20 16:02:06 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK;
|
2017-03-29 13:01:01 +08:00
|
|
|
|
using OpenTK.Graphics;
|
2017-03-24 17:37:56 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2017-03-24 19:08:40 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-03-24 17:37:56 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-03-28 20:03:34 +08:00
|
|
|
|
using osu.Framework.Testing;
|
2017-03-24 17:37:56 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2017-03-20 15:50:22 +08:00
|
|
|
|
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
2017-03-17 21:01:06 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
|
|
|
|
{
|
|
|
|
|
internal class TestCaseTaikoHitObjects : TestCase
|
|
|
|
|
{
|
|
|
|
|
public override string Description => "Taiko hit objects";
|
|
|
|
|
|
2017-03-24 17:37:56 +08:00
|
|
|
|
private bool kiai;
|
|
|
|
|
|
2017-03-17 21:01:06 +08:00
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
2017-03-24 17:37:56 +08:00
|
|
|
|
AddToggle("Kiai", b =>
|
|
|
|
|
{
|
|
|
|
|
kiai = !kiai;
|
|
|
|
|
Reset();
|
|
|
|
|
});
|
|
|
|
|
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Add(new CirclePiece
|
2017-03-24 17:37:56 +08:00
|
|
|
|
{
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Position = new Vector2(100, 100),
|
|
|
|
|
Width = 0,
|
|
|
|
|
AccentColour = Color4.DarkRed,
|
|
|
|
|
KiaiMode = kiai,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new CentreHitSymbolPiece()
|
|
|
|
|
}
|
2017-03-20 14:07:42 +08:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Add(new StrongCirclePiece
|
2017-03-20 14:07:42 +08:00
|
|
|
|
{
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Position = new Vector2(350, 100),
|
|
|
|
|
Width = 0,
|
|
|
|
|
AccentColour = Color4.DarkRed,
|
|
|
|
|
KiaiMode = kiai,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new CentreHitSymbolPiece()
|
|
|
|
|
}
|
2017-03-17 21:01:06 +08:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Add(new CirclePiece
|
2017-03-24 17:37:56 +08:00
|
|
|
|
{
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Position = new Vector2(100, 300),
|
|
|
|
|
Width = 0,
|
|
|
|
|
AccentColour = Color4.DarkBlue,
|
|
|
|
|
KiaiMode = kiai,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new RimHitSymbolPiece()
|
|
|
|
|
}
|
2017-03-20 14:07:42 +08:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Add(new StrongCirclePiece
|
2017-03-20 14:07:42 +08:00
|
|
|
|
{
|
2017-03-29 13:01:01 +08:00
|
|
|
|
Position = new Vector2(350, 300),
|
|
|
|
|
Width = 0,
|
|
|
|
|
AccentColour = Color4.DarkBlue,
|
|
|
|
|
KiaiMode = kiai,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
new RimHitSymbolPiece()
|
|
|
|
|
}
|
2017-03-17 21:01:06 +08:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-28 10:18:12 +08:00
|
|
|
|
Add(new SwellCircle(new CirclePiece
|
2017-03-24 17:37:56 +08:00
|
|
|
|
{
|
|
|
|
|
KiaiMode = kiai
|
|
|
|
|
})
|
2017-03-17 21:01:06 +08:00
|
|
|
|
{
|
2017-03-20 15:53:31 +08:00
|
|
|
|
Position = new Vector2(100, 500)
|
2017-03-20 14:07:42 +08:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-28 10:18:12 +08:00
|
|
|
|
Add(new SwellCircle(new StrongCirclePiece
|
2017-03-24 17:37:56 +08:00
|
|
|
|
{
|
|
|
|
|
KiaiMode = kiai
|
|
|
|
|
})
|
2017-03-20 14:07:42 +08:00
|
|
|
|
{
|
2017-03-20 15:53:31 +08:00
|
|
|
|
Position = new Vector2(350, 500)
|
2017-03-17 21:01:06 +08:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-28 10:18:12 +08:00
|
|
|
|
Add(new DrumRollCircle(new CirclePiece
|
2017-03-17 21:01:06 +08:00
|
|
|
|
{
|
2017-03-24 17:37:56 +08:00
|
|
|
|
KiaiMode = kiai
|
|
|
|
|
})
|
|
|
|
|
{
|
2017-03-24 19:09:58 +08:00
|
|
|
|
Width = 250,
|
2017-03-20 15:53:31 +08:00
|
|
|
|
Position = new Vector2(575, 100)
|
2017-03-20 14:07:42 +08:00
|
|
|
|
});
|
|
|
|
|
|
2017-03-28 10:18:12 +08:00
|
|
|
|
Add(new DrumRollCircle(new StrongCirclePiece
|
2017-03-20 14:07:42 +08:00
|
|
|
|
{
|
2017-03-24 17:37:56 +08:00
|
|
|
|
KiaiMode = kiai
|
2017-03-20 14:07:42 +08:00
|
|
|
|
})
|
|
|
|
|
{
|
2017-03-24 19:09:58 +08:00
|
|
|
|
Width = 250,
|
2017-03-20 15:53:31 +08:00
|
|
|
|
Position = new Vector2(575, 300)
|
2017-03-17 21:01:06 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2017-03-24 17:37:56 +08:00
|
|
|
|
|
|
|
|
|
private class SwellCircle : BaseCircle
|
|
|
|
|
{
|
|
|
|
|
public SwellCircle(CirclePiece piece)
|
|
|
|
|
: base(piece)
|
|
|
|
|
{
|
2017-03-24 19:08:40 +08:00
|
|
|
|
Piece.Add(new TextAwesome
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2017-03-28 09:33:23 +08:00
|
|
|
|
TextSize = CirclePiece.SYMBOL_INNER_SIZE,
|
2017-03-24 21:11:11 +08:00
|
|
|
|
Icon = FontAwesome.fa_asterisk,
|
2017-03-24 19:08:40 +08:00
|
|
|
|
Shadow = false
|
|
|
|
|
});
|
2017-03-24 17:37:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2017-03-24 19:54:09 +08:00
|
|
|
|
private void load(OsuColour colours)
|
2017-03-24 17:37:56 +08:00
|
|
|
|
{
|
|
|
|
|
Piece.AccentColour = colours.YellowDark;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class DrumRollCircle : BaseCircle
|
|
|
|
|
{
|
|
|
|
|
public DrumRollCircle(CirclePiece piece)
|
|
|
|
|
: base(piece)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
Piece.AccentColour = colours.YellowDark;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private abstract class BaseCircle : Container
|
|
|
|
|
{
|
|
|
|
|
protected readonly CirclePiece Piece;
|
|
|
|
|
|
|
|
|
|
protected BaseCircle(CirclePiece piece)
|
|
|
|
|
{
|
|
|
|
|
Piece = piece;
|
|
|
|
|
|
|
|
|
|
Add(Piece);
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-17 21:01:06 +08:00
|
|
|
|
}
|
|
|
|
|
}
|