1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 10:33:07 +08:00

Fix DrawableTaikoHitObject + drawable hit objects.

This commit is contained in:
smoogipooo 2017-08-03 13:54:13 +09:30
parent 786bad3d71
commit e55a406e4d
5 changed files with 63 additions and 77 deletions

View File

@ -10,6 +10,7 @@ using osu.Game.Rulesets.Taiko.Judgements;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
using osu.Framework.Graphics;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
@ -30,6 +31,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public DrawableDrumRoll(DrumRoll drumRoll)
: base(drumRoll)
{
RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X;
foreach (var tick in drumRoll.Ticks)
{
var newTick = new DrawableDrumRollTick(tick)

View File

@ -15,6 +15,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public DrawableDrumRollTick(DrumRollTick tick)
: base(tick)
{
FillMode = FillMode.Fit;
}
protected override TaikoPiece CreateMainPiece() => new TickPiece

View File

@ -26,6 +26,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected DrawableHit(Hit hit)
: base(hit)
{
FillMode = FillMode.Fit;
}
protected override void CheckJudgement(bool userTriggered)

View File

@ -35,8 +35,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
private readonly CircularContainer targetRing;
private readonly CircularContainer expandingRing;
private readonly CirclePiece circlePiece;
private readonly Key[] rimKeys = { Key.D, Key.K };
private readonly Key[] centreKeys = { Key.F, Key.J };
private Key[] lastKeySet;
@ -52,89 +50,81 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public DrawableSwell(Swell swell)
: base(swell)
{
Children = new Drawable[]
FillMode = FillMode.Fit;
Add(bodyContainer = new Container
{
bodyContainer = new Container
RelativeSizeAxes = Axes.Both,
Depth = 1,
Children = new Drawable[]
{
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
expandingRing = new CircularContainer
{
expandingRing = new CircularContainer
Name = "Expanding ring",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Alpha = 0,
RelativeSizeAxes = Axes.Both,
BlendingMode = BlendingMode.Additive,
Masking = true,
Children = new[]
{
Name = "Expanding ring",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Alpha = 0,
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER),
BlendingMode = BlendingMode.Additive,
Masking = true,
Children = new[]
new Box
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = inner_ring_alpha,
}
RelativeSizeAxes = Axes.Both,
Alpha = inner_ring_alpha,
}
},
targetRing = new CircularContainer
}
},
targetRing = new CircularContainer
{
Name = "Target ring (thick border)",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = target_ring_thick_border,
BlendingMode = BlendingMode.Additive,
Children = new Drawable[]
{
Name = "Target ring (thick border)",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER),
Masking = true,
BorderThickness = target_ring_thick_border,
BlendingMode = BlendingMode.Additive,
Children = new Drawable[]
new Box
{
new Box
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
},
new CircularContainer
{
Name = "Target ring (thin border)",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = target_ring_thin_border,
BorderColour = Color4.White,
Children = new[]
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
},
new CircularContainer
{
Name = "Target ring (thin border)",
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = target_ring_thin_border,
BorderColour = Color4.White,
Children = new[]
new Box
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
}
}
},
circlePiece = new CirclePiece
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new[]
{
symbol = new SwellSymbolPiece()
}
}
}
}
};
});
MainPiece.Add(symbol = new SwellSymbolPiece());
circlePiece.KiaiMode = HitObject.Kiai;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
circlePiece.AccentColour = colours.YellowDark;
MainPiece.AccentColour = colours.YellowDark;
expandingRing.Colour = colours.YellowLight;
targetRing.BorderColour = colours.YellowDark.Opacity(0.25f);
}

View File

@ -10,6 +10,7 @@ using osu.Game.Rulesets.Taiko.Judgements;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
using OpenTK;
using OpenTK.Input;
using System;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
@ -24,12 +25,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public override Vector2 OriginPosition => new Vector2(DrawHeight / 2);
protected override Container<Drawable> Content => bodyContainer;
protected readonly TaikoPiece MainPiece;
private readonly Container bodyContainer;
public new TaikoHitType HitObject;
protected DrawableTaikoHitObject(TaikoHitType hitObject)
@ -40,19 +37,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Anchor = Anchor.CentreLeft;
Origin = Anchor.Custom;
AutoSizeAxes = Axes.Both;
RelativeSizeAxes = Axes.Both;
Size = new Vector2(HitObject.IsStrong ? TaikoHitObject.DEFAULT_STRONG_SIZE : TaikoHitObject.DEFAULT_SIZE);
RelativePositionAxes = Axes.X;
AddInternal(bodyContainer = new Container
{
AutoSizeAxes = Axes.Both,
Children = new[]
{
MainPiece = CreateMainPiece()
}
});
Add(MainPiece = CreateMainPiece());
MainPiece.KiaiMode = HitObject.Kiai;
LifetimeStart = HitObject.StartTime - HitObject.ScrollTime * 2;