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

View File

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

View File

@ -26,6 +26,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected DrawableHit(Hit hit) protected DrawableHit(Hit hit)
: base(hit) : base(hit)
{ {
FillMode = FillMode.Fit;
} }
protected override void CheckJudgement(bool userTriggered) 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 targetRing;
private readonly CircularContainer expandingRing; private readonly CircularContainer expandingRing;
private readonly CirclePiece circlePiece;
private readonly Key[] rimKeys = { Key.D, Key.K }; private readonly Key[] rimKeys = { Key.D, Key.K };
private readonly Key[] centreKeys = { Key.F, Key.J }; private readonly Key[] centreKeys = { Key.F, Key.J };
private Key[] lastKeySet; private Key[] lastKeySet;
@ -52,11 +50,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public DrawableSwell(Swell swell) public DrawableSwell(Swell swell)
: base(swell) : base(swell)
{ {
Children = new Drawable[] FillMode = FillMode.Fit;
Add(bodyContainer = new Container
{ {
bodyContainer = new Container RelativeSizeAxes = Axes.Both,
{ Depth = 1,
AutoSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
expandingRing = new CircularContainer expandingRing = new CircularContainer
@ -65,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Alpha = 0, Alpha = 0,
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER), RelativeSizeAxes = Axes.Both,
BlendingMode = BlendingMode.Additive, BlendingMode = BlendingMode.Additive,
Masking = true, Masking = true,
Children = new[] Children = new[]
@ -82,7 +81,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Name = "Target ring (thick border)", Name = "Target ring (thick border)",
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER), RelativeSizeAxes = Axes.Both,
Masking = true, Masking = true,
BorderThickness = target_ring_thick_border, BorderThickness = target_ring_thick_border,
BlendingMode = BlendingMode.Additive, BlendingMode = BlendingMode.Additive,
@ -114,27 +113,18 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
} }
} }
} }
},
circlePiece = new CirclePiece
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new[]
{
symbol = new SwellSymbolPiece()
} }
} }
} });
}
}; MainPiece.Add(symbol = new SwellSymbolPiece());
circlePiece.KiaiMode = HitObject.Kiai;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
circlePiece.AccentColour = colours.YellowDark; MainPiece.AccentColour = colours.YellowDark;
expandingRing.Colour = colours.YellowLight; expandingRing.Colour = colours.YellowLight;
targetRing.BorderColour = colours.YellowDark.Opacity(0.25f); 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 osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
using OpenTK; using OpenTK;
using OpenTK.Input; using OpenTK.Input;
using System;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables 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); public override Vector2 OriginPosition => new Vector2(DrawHeight / 2);
protected override Container<Drawable> Content => bodyContainer;
protected readonly TaikoPiece MainPiece; protected readonly TaikoPiece MainPiece;
private readonly Container bodyContainer;
public new TaikoHitType HitObject; public new TaikoHitType HitObject;
protected DrawableTaikoHitObject(TaikoHitType hitObject) protected DrawableTaikoHitObject(TaikoHitType hitObject)
@ -40,19 +37,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Anchor = Anchor.CentreLeft; Anchor = Anchor.CentreLeft;
Origin = Anchor.Custom; Origin = Anchor.Custom;
AutoSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Size = new Vector2(HitObject.IsStrong ? TaikoHitObject.DEFAULT_STRONG_SIZE : TaikoHitObject.DEFAULT_SIZE);
RelativePositionAxes = Axes.X; RelativePositionAxes = Axes.X;
AddInternal(bodyContainer = new Container Add(MainPiece = CreateMainPiece());
{
AutoSizeAxes = Axes.Both,
Children = new[]
{
MainPiece = CreateMainPiece()
}
});
MainPiece.KiaiMode = HitObject.Kiai; MainPiece.KiaiMode = HitObject.Kiai;
LifetimeStart = HitObject.StartTime - HitObject.ScrollTime * 2; LifetimeStart = HitObject.StartTime - HitObject.ScrollTime * 2;