mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Move proxy state check to base class
This commit is contained in:
parent
479eac8aa8
commit
5b344525e1
@ -34,7 +34,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private int userHits;
|
private int userHits;
|
||||||
|
|
||||||
private bool hasProxied;
|
|
||||||
private readonly SwellSymbolPiece symbol;
|
private readonly SwellSymbolPiece symbol;
|
||||||
|
|
||||||
public DrawableSwell(Swell swell)
|
public DrawableSwell(Swell swell)
|
||||||
@ -172,7 +171,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
hasProxied = false;
|
|
||||||
UnproxyContent();
|
UnproxyContent();
|
||||||
break;
|
break;
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
@ -193,11 +191,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
X = Math.Max(0, X);
|
X = Math.Max(0, X);
|
||||||
|
|
||||||
double t = Math.Min(HitObject.StartTime, Time.Current);
|
double t = Math.Min(HitObject.StartTime, Time.Current);
|
||||||
if (t == HitObject.StartTime && !hasProxied)
|
if (t == HitObject.StartTime)
|
||||||
{
|
|
||||||
ProxyContent();
|
ProxyContent();
|
||||||
hasProxied = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool? lastWasCentre;
|
private bool? lastWasCentre;
|
||||||
|
@ -40,23 +40,31 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected override bool ComputeIsMaskedAway(RectangleF maskingBounds) => false;
|
protected override bool ComputeIsMaskedAway(RectangleF maskingBounds) => false;
|
||||||
|
|
||||||
|
private bool isProxied;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves <see cref="Content"/> to a layer proxied above the playfield.
|
/// Moves <see cref="Content"/> to a layer proxied above the playfield.
|
||||||
|
/// Does nothing is content is already proxied.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void ProxyContent()
|
protected void ProxyContent()
|
||||||
{
|
{
|
||||||
|
if (isProxied) return;
|
||||||
|
isProxied = true;
|
||||||
|
|
||||||
nonProxiedContent.Remove(Content);
|
nonProxiedContent.Remove(Content);
|
||||||
proxiedContent.Remove(Content);
|
|
||||||
proxiedContent.Add(Content);
|
proxiedContent.Add(Content);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves <see cref="Content"/> to the normal hitobject layer.
|
/// Moves <see cref="Content"/> to the normal hitobject layer.
|
||||||
|
/// Does nothing is content is not currently proxied.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void UnproxyContent()
|
protected void UnproxyContent()
|
||||||
{
|
{
|
||||||
|
if (!isProxied) return;
|
||||||
|
isProxied = false;
|
||||||
|
|
||||||
proxiedContent.Remove(Content);
|
proxiedContent.Remove(Content);
|
||||||
nonProxiedContent.Remove(Content);
|
|
||||||
nonProxiedContent.Add(Content);
|
nonProxiedContent.Add(Content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user