Merge branch 'master' into taiko-drumroll-party

# Conflicts:
#	osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs
#	osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
This commit is contained in:
Tim Oliver
2020-04-22 23:15:48 +08:00
245 changed files with 6349 additions and 1990 deletions

View File

@ -14,6 +14,8 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
@ -29,7 +31,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
/// </summary>
private int rollingHits;
private readonly Container<DrawableDrumRollTick> tickContainer;
private Container tickContainer;
private Color4 colourIdle;
private Color4 colourEngaged;
@ -46,14 +48,20 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
: base(drumRoll)
{
RelativeSizeAxes = Axes.Y;
MainPiece.Add(tickContainer = new Container<DrawableDrumRollTick> { RelativeSizeAxes = Axes.Both });
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
MainPiece.AccentColour = colourIdle = colours.YellowDark;
colourIdle = colours.YellowDark;
colourEngaged = colours.YellowDarker;
updateColour();
Content.Add(tickContainer = new Container { RelativeSizeAxes = Axes.Both });
if (MainPiece.Drawable is IHasAccentColour accentMain)
accentMain.AccentColour = colourIdle;
}
protected override void LoadComplete()
@ -92,7 +100,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
return base.CreateNestedHitObject(hitObject);
}
protected override TaikoPiece CreateMainPiece() => new ElongatedCirclePiece();
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.DrumRollBody),
_ => new ElongatedCirclePiece());
public override bool OnPressed(TaikoAction action)
{
@ -120,8 +129,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
rollingHits = Math.Clamp(rollingHits, 0, rolling_hits_for_engaged_colour);
Color4 newColour = Interpolation.ValueAt((float)rollingHits / rolling_hits_for_engaged_colour, colourIdle, colourEngaged, 0, 1);
MainPiece.FadeAccent(newColour, 100);
updateColour();
}
protected override void CheckForResult(bool userTriggered, double timeOffset)
@ -153,8 +161,22 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
}
}
protected override void Update()
{
base.Update();
OriginPosition = new Vector2(DrawHeight);
Content.X = DrawHeight / 2;
}
protected override DrawableStrongNestedHit CreateStrongHit(StrongHitObject hitObject) => new StrongNestedHit(hitObject, this);
private void updateColour()
{
Color4 newColour = Interpolation.ValueAt((float)rollingHits / rolling_hits_for_engaged_colour, colourIdle, colourEngaged, 0, 1);
(MainPiece.Drawable as IHasAccentColour)?.FadeAccent(newColour, 100);
}
private class StrongNestedHit : DrawableStrongNestedHit
{
public StrongNestedHit(StrongHitObject strong, DrawableDrumRoll drumRoll)