mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 05:52:54 +08:00
Merge pull request #1153 from smoogipooo/fix-taiko-barlines
Fix taiko major bar lines not showing triangles
This commit is contained in:
commit
5068bbfd87
@ -1 +1 @@
|
|||||||
Subproject commit 825505e788c4f093b269c61b485d38d50cd68096
|
Subproject commit bce1e26732360caf4acb716fde439de48805014e
|
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
|
protected override TaikoJudgement CreateJudgement() => null;
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateState(ArmedState state)
|
||||||
{
|
{
|
||||||
|
@ -20,10 +20,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const float triangle_size = 20f;
|
private const float triangle_size = 20f;
|
||||||
|
|
||||||
|
private readonly Container triangleContainer;
|
||||||
|
|
||||||
public DrawableBarLineMajor(BarLine barLine)
|
public DrawableBarLineMajor(BarLine barLine)
|
||||||
: base(barLine)
|
: base(barLine)
|
||||||
{
|
{
|
||||||
Add(new Container
|
Add(triangleContainer = new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -53,5 +55,13 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
Tracker.Alpha = 1f;
|
Tracker.Alpha = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
using (triangleContainer.BeginAbsoluteSequence(HitObject.StartTime))
|
||||||
|
triangleContainer.FadeOut(150);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -45,6 +45,8 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
private readonly Container topLevelHitContainer;
|
private readonly Container topLevelHitContainer;
|
||||||
|
|
||||||
|
private readonly Container barlineContainer;
|
||||||
|
|
||||||
private readonly Container overlayBackgroundContainer;
|
private readonly Container overlayBackgroundContainer;
|
||||||
private readonly Container backgroundContainer;
|
private readonly Container backgroundContainer;
|
||||||
|
|
||||||
@ -85,7 +87,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Masked elements",
|
Name = "Masked elements before hit objects",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Left = HIT_TARGET_OFFSET },
|
Padding = new MarginPadding { Left = HIT_TARGET_OFFSET },
|
||||||
Masking = true,
|
Masking = true,
|
||||||
@ -103,12 +105,20 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fit
|
FillMode = FillMode.Fit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
barlineContainer = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }
|
||||||
},
|
},
|
||||||
content = new Container
|
content = new Container
|
||||||
{
|
{
|
||||||
|
Name = "Hit objects",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
Padding = new MarginPadding { Left = HIT_TARGET_OFFSET },
|
||||||
}
|
Masking = true
|
||||||
},
|
},
|
||||||
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
||||||
{
|
{
|
||||||
@ -198,6 +208,10 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
base.Add(h);
|
base.Add(h);
|
||||||
|
|
||||||
|
var barline = h as DrawableBarLine;
|
||||||
|
if (barline != null)
|
||||||
|
barlineContainer.Add(barline.CreateProxy());
|
||||||
|
|
||||||
// Swells should be moved at the very top of the playfield when they reach the hit target
|
// Swells should be moved at the very top of the playfield when they reach the hit target
|
||||||
var swell = h as DrawableSwell;
|
var swell = h as DrawableSwell;
|
||||||
if (swell != null)
|
if (swell != null)
|
||||||
|
@ -106,6 +106,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
/// <returns>Whether a hit was processed.</returns>
|
/// <returns>Whether a hit was processed.</returns>
|
||||||
protected bool UpdateJudgement(bool userTriggered)
|
protected bool UpdateJudgement(bool userTriggered)
|
||||||
{
|
{
|
||||||
|
if (Judgement == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
var partial = Judgement as IPartialJudgement;
|
var partial = Judgement as IPartialJudgement;
|
||||||
|
|
||||||
// Never re-process non-partial hits
|
// Never re-process non-partial hits
|
||||||
|
@ -151,10 +151,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableBool Reversed = new BindableBool();
|
public readonly BindableBool Reversed = new BindableBool();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Hit objects that are to be re-processed on the next update.
|
|
||||||
/// </summary>
|
|
||||||
private readonly List<DrawableHitObject> queuedHitObjects = new List<DrawableHitObject>();
|
|
||||||
private readonly Container<SpeedAdjustmentContainer> speedAdjustments;
|
private readonly Container<SpeedAdjustmentContainer> speedAdjustments;
|
||||||
|
|
||||||
private readonly Axes scrollingAxes;
|
private readonly Axes scrollingAxes;
|
||||||
@ -168,6 +164,9 @@ namespace osu.Game.Rulesets.UI
|
|||||||
this.scrollingAxes = scrollingAxes;
|
this.scrollingAxes = scrollingAxes;
|
||||||
|
|
||||||
AddInternal(speedAdjustments = new Container<SpeedAdjustmentContainer> { RelativeSizeAxes = Axes.Both });
|
AddInternal(speedAdjustments = new Container<SpeedAdjustmentContainer> { RelativeSizeAxes = Axes.Both });
|
||||||
|
|
||||||
|
// Default speed adjustment
|
||||||
|
AddSpeedAdjustment(new SpeedAdjustmentContainer(new MultiplierControlPoint(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -180,6 +179,21 @@ namespace osu.Game.Rulesets.UI
|
|||||||
speedAdjustment.VisibleTimeRange.BindTo(VisibleTimeRange);
|
speedAdjustment.VisibleTimeRange.BindTo(VisibleTimeRange);
|
||||||
speedAdjustment.Reversed.BindTo(Reversed);
|
speedAdjustment.Reversed.BindTo(Reversed);
|
||||||
speedAdjustments.Add(speedAdjustment);
|
speedAdjustments.Add(speedAdjustment);
|
||||||
|
|
||||||
|
// We now need to re-sort the hit objects in the last speed adjustment prior to this one, to see if they need a new parent
|
||||||
|
var previousSpeedAdjustment = speedAdjustments.LastOrDefault(s => s.ControlPoint.StartTime < speedAdjustment.ControlPoint.StartTime);
|
||||||
|
if (previousSpeedAdjustment == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (DrawableHitObject h in previousSpeedAdjustment.Children)
|
||||||
|
{
|
||||||
|
var newSpeedAdjustment = adjustmentContainerFor(h);
|
||||||
|
if (newSpeedAdjustment == previousSpeedAdjustment)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
previousSpeedAdjustment.Remove(h);
|
||||||
|
newSpeedAdjustment.Add(h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerable<DrawableHitObject> Objects => speedAdjustments.SelectMany(s => s.Children);
|
public override IEnumerable<DrawableHitObject> Objects => speedAdjustments.SelectMany(s => s.Children);
|
||||||
@ -194,31 +208,15 @@ namespace osu.Game.Rulesets.UI
|
|||||||
if (!(hitObject is IScrollingHitObject))
|
if (!(hitObject is IScrollingHitObject))
|
||||||
throw new InvalidOperationException($"Hit objects added to a {nameof(ScrollingHitObjectContainer)} must implement {nameof(IScrollingHitObject)}.");
|
throw new InvalidOperationException($"Hit objects added to a {nameof(ScrollingHitObjectContainer)} must implement {nameof(IScrollingHitObject)}.");
|
||||||
|
|
||||||
queuedHitObjects.Add(hitObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Remove(DrawableHitObject hitObject) => speedAdjustments.Any(s => s.Remove(hitObject)) || queuedHitObjects.Remove(hitObject);
|
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
base.Update();
|
|
||||||
|
|
||||||
// Todo: At the moment this is going to re-process every single Update, however this will only be a null-op
|
|
||||||
// when there are no SpeedAdjustmentContainers available. This should probably error or something, but it's okay for now.
|
|
||||||
|
|
||||||
for (int i = queuedHitObjects.Count - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
var hitObject = queuedHitObjects[i];
|
|
||||||
|
|
||||||
var target = adjustmentContainerFor(hitObject);
|
var target = adjustmentContainerFor(hitObject);
|
||||||
if (target == null)
|
if (target == null)
|
||||||
continue;
|
throw new InvalidOperationException($"A {nameof(SpeedAdjustmentContainer)} to container {hitObject} could not be found.");
|
||||||
|
|
||||||
target.Add(hitObject);
|
target.Add(hitObject);
|
||||||
queuedHitObjects.RemoveAt(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool Remove(DrawableHitObject hitObject) => speedAdjustments.Any(s => s.Remove(hitObject));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds the <see cref="SpeedAdjustmentContainer"/> which provides the speed adjustment active at the start time
|
/// Finds the <see cref="SpeedAdjustmentContainer"/> which provides the speed adjustment active at the start time
|
||||||
/// of a hit object. If there is no <see cref="SpeedAdjustmentContainer"/> active at the start time of the hit object,
|
/// of a hit object. If there is no <see cref="SpeedAdjustmentContainer"/> active at the start time of the hit object,
|
||||||
|
Loading…
Reference in New Issue
Block a user