mirror of
https://github.com/osukey/osukey.git
synced 2025-05-22 22:17:36 +09:00
Fix DrawableTaikoHitObject + drawable hit objects.
This commit is contained in:
parent
786bad3d71
commit
e55a406e4d
@ -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)
|
||||||
|
@ -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
|
||||||
|
@ -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)
|
||||||
|
@ -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,89 +50,81 @@ 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,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
expandingRing = new CircularContainer
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
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",
|
new Box
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Alpha = 0,
|
|
||||||
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER),
|
|
||||||
BlendingMode = BlendingMode.Additive,
|
|
||||||
Masking = true,
|
|
||||||
Children = new[]
|
|
||||||
{
|
{
|
||||||
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)",
|
new Box
|
||||||
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
|
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,
|
new Box
|
||||||
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
|
RelativeSizeAxes = Axes.Both,
|
||||||
{
|
Alpha = 0,
|
||||||
RelativeSizeAxes = Axes.Both,
|
AlwaysPresent = true
|
||||||
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]
|
[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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user