Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass osu!taiko "argon" skin #21153

Merged
merged 23 commits into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
688f50e
Merge branch 'taiko-tick-trackiung' into taiko-fixes-combined
peppy Nov 7, 2022
2648175
Merge branch 'taiko-barline-separation' into taiko-fixes-combined
peppy Nov 7, 2022
ddc2ed1
Fix height of playfield in taiko tests
peppy Nov 7, 2022
baf8db8
Add basic setup for taiko argon skinning
peppy Nov 2, 2022
bc0e937
Add basic argon hits
peppy Nov 2, 2022
421bdd2
Add playfield background implementations
peppy Nov 7, 2022
f1a1f29
Add hit target implementation
peppy Nov 7, 2022
529e321
Add barline implementation
peppy Nov 7, 2022
6636545
Move taiko argon hit icon to respective centre/rim pieces
peppy Nov 7, 2022
f1556c9
Add drum roll implementation
peppy Nov 7, 2022
938a8f8
Adjust transform of taiko drum roll ticks to not scale to 0 (looks bad)
peppy Nov 7, 2022
aa61eb8
Add note about taiko pooling oversight
peppy Nov 7, 2022
e204679
Add argon drum roll ticks
peppy Nov 7, 2022
37cb187
Move strong hit scale to `DefaultHitExplosion`
peppy Nov 7, 2022
d5c375b
Add argon hit explosion implementation
peppy Nov 7, 2022
b15d1bc
Add argon result display implementation
peppy Nov 7, 2022
d57ec4b
Add argon input drum implementation
peppy Nov 7, 2022
01803c3
Adjust judgement text to be more visible
peppy Nov 8, 2022
3089064
Flash piece when hit
peppy Nov 8, 2022
7379f6f
Merge branch 'master' into argon-taiko
bdach Nov 11, 2022
7ef11ca
Adjust taiko argon transformer to new naming
bdach Nov 11, 2022
6a4c97b
Fix code inspection
bdach Nov 11, 2022
8b8147c
Rename `{catch -> taiko}Component`
bdach Nov 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private void load()
var cont = new Container
{
RelativeSizeAxes = Axes.Both,
Height = 0.8f,
Height = 0.2f,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
Expand All @@ -63,7 +63,7 @@ private void load()
var cont = new Container
{
RelativeSizeAxes = Axes.Both,
Height = 0.8f,
Height = 0.2f,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
Expand All @@ -88,7 +88,7 @@ private BarLine createBarLineAtCurrentTime(bool major = false)
var barLine = new BarLine
{
Major = major,
StartTime = Time.Current + 2000,
StartTime = Time.Current + 5000,
};

var cpi = new ControlPointInfo();
Expand Down
24 changes: 20 additions & 4 deletions osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneTaikoPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#nullable disable

using System;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
Expand All @@ -25,11 +26,10 @@ public class TestSceneTaikoPlayfield : TaikoSkinnableTestScene
TimeRange = { Value = 5000 },
};

public TestSceneTaikoPlayfield()
[SetUpSteps]
public void SetUpSteps()
{
TaikoBeatmap beatmap;
bool kiai = false;

AddStep("set beatmap", () =>
{
Beatmap.Value = CreateWorkingBeatmap(beatmap = new TaikoBeatmap());
Expand All @@ -41,12 +41,28 @@ public TestSceneTaikoPlayfield()

AddStep("Load playfield", () => SetContents(_ => new TaikoPlayfield
{
Height = 0.2f,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Height = 0.6f,
}));
}

[Test]
public void TestBasic()
{
AddStep("do nothing", () => { });
}

[Test]
public void TestHeightChanges()
{
AddRepeatStep("change height", () => this.ChildrenOfType<TaikoPlayfield>().ForEach(p => p.Height = Math.Max(0.2f, (p.Height + 0.2f) % 1f)), 50);
}

[Test]
public void TestKiai()
{
bool kiai = false;

AddStep("Toggle kiai", () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ protected override void UpdateHitStateTransforms(ArmedState state)
switch (state)
{
case ArmedState.Hit:
this.ScaleTo(0, 100, Easing.OutQuint);
this.ScaleTo(1.4f, 200, Easing.OutQuint);
this.FadeOut(200, Easing.OutQuint);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ protected DrawableTaikoHitObject([CanBeNull] TObject hitObject)
protected override void OnApply()
{
base.OnApply();

// TODO: THIS CANNOT BE HERE, it makes pooling pointless (see https://github.com/ppy/osu/issues/21072).
RecreatePieces();
}

Expand Down
83 changes: 83 additions & 0 deletions osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonBarLine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects.Drawables;
using osuTK;

namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
public class ArgonBarLine : CompositeDrawable
{
private Container majorEdgeContainer = null!;

private Bindable<bool> major = null!;

[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableHitObject)
{
RelativeSizeAxes = Axes.Both;

const float line_offset = 8;
var majorPieceSize = new Vector2(6, 20);

InternalChildren = new Drawable[]
{
line = new Box
{
RelativeSizeAxes = Axes.Both,
EdgeSmoothness = new Vector2(0.5f, 0),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
majorEdgeContainer = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Children = new[]
{
new Circle
{
Name = "Top line",
Anchor = Anchor.TopCentre,
Origin = Anchor.BottomCentre,
Size = majorPieceSize,
Y = -line_offset,
},
new Circle
{
Name = "Bottom line",
Anchor = Anchor.BottomCentre,
Origin = Anchor.TopCentre,
Size = majorPieceSize,
Y = line_offset,
},
}
}
};

major = ((DrawableBarLine)drawableHitObject).Major.GetBoundCopy();
}

protected override void LoadComplete()
{
base.LoadComplete();
major.BindValueChanged(updateMajor, true);
}

private Box line = null!;

private void updateMajor(ValueChangedEvent<bool> major)
{
line.Alpha = major.NewValue ? 1f : 0.5f;
line.Width = major.NewValue ? 1 : 0.5f;
majorEdgeContainer.Alpha = major.NewValue ? 1 : 0;
}
}
}
34 changes: 34 additions & 0 deletions osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCentreCirclePiece.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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.Colour;
using osu.Framework.Graphics.Sprites;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
public class ArgonCentreCirclePiece : ArgonCirclePiece
{
[BackgroundDependencyLoader]
private void load()
{
AccentColour = ColourInfo.GradientVertical(
new Color4(241, 0, 0, 255),
new Color4(167, 0, 0, 255)
);

AddInternal(new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Icon = FontAwesome.Solid.AngleLeft,
Size = new Vector2(ICON_SIZE),
Scale = new Vector2(0.8f, 1)
});
}
}
}
112 changes: 112 additions & 0 deletions osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCirclePiece.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// 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.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
public abstract class ArgonCirclePiece : BeatSyncedContainer
{
public const float ICON_SIZE = 20 / 70f;

private const double pre_beat_transition_time = 80;

private const float flash_opacity = 0.3f;

private ColourInfo accentColour;

/// <summary>
/// The colour of the inner circle and outer glows.
/// </summary>
public ColourInfo AccentColour
{
get => accentColour;
set
{
accentColour = value;

ring.Colour = AccentColour.MultiplyAlpha(0.5f);
ring2.Colour = AccentColour;
}
}

[Resolved]
private DrawableHitObject drawableHitObject { get; set; } = null!;

private readonly Drawable flash;

private readonly RingPiece ring;
private readonly RingPiece ring2;

protected ArgonCirclePiece()
{
RelativeSizeAxes = Axes.Both;

EarlyActivationMilliseconds = pre_beat_transition_time;

AddRangeInternal(new[]
{
new Circle
{
RelativeSizeAxes = Axes.Both,
Colour = new Color4(0, 0, 0, 190)
},
ring = new RingPiece(20 / 70f),
ring2 = new RingPiece(5 / 70f),
flash = new Circle
{
Name = "Flash layer",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Blending = BlendingParameters.Additive,
Alpha = 0,
},
});
}

protected override void LoadComplete()
{
base.LoadComplete();

drawableHitObject.ApplyCustomUpdateState += updateStateTransforms;
updateStateTransforms(drawableHitObject, drawableHitObject.State.Value);
}

private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
{
switch (state)
{
case ArmedState.Hit:
using (BeginAbsoluteSequence(drawableHitObject.HitStateUpdateTime))
{
flash.FadeTo(0.9f).FadeOut(500, Easing.OutQuint);
}

break;
}
}

protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{
if (!effectPoint.KiaiMode)
return;

if (drawableHitObject.State.Value == ArmedState.Idle)
{
flash
.FadeTo(flash_opacity)
.Then()
.FadeOut(timingPoint.BeatLength * 0.75, Easing.OutSine);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 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.Colour;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
public class ArgonElongatedCirclePiece : ArgonCirclePiece
{
public ArgonElongatedCirclePiece()
{
RelativeSizeAxes = Axes.Y;
}

[BackgroundDependencyLoader]
private void load()
{
AccentColour = ColourInfo.GradientVertical(
new Color4(241, 161, 0, 255),
new Color4(167, 111, 0, 255)
);
}

protected override void Update()
{
base.Update();
Width = Parent.DrawSize.X + DrawHeight;
}
}
}
Loading