mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 15:27:30 +08:00
Apply further changes to remove remaining weirdness
This commit is contained in:
parent
39fe078984
commit
fb80d76b4a
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.EmptyFreeform.Objects.Drawables
|
||||
{
|
||||
if (timeOffset >= 0)
|
||||
// todo: implement judgement logic
|
||||
ApplyResult(static (r, hitObject) => r.Type = HitResult.Perfect);
|
||||
ApplyResult(HitResult.Perfect);
|
||||
}
|
||||
|
||||
protected override void UpdateHitStateTransforms(ArmedState state)
|
||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -50,10 +49,10 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables
|
||||
{
|
||||
if (timeOffset >= 0)
|
||||
{
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
r.Type = hitObject.IsHovered ? HitResult.Perfect : HitResult.Miss;
|
||||
});
|
||||
if (IsHovered)
|
||||
ApplyMaxResult();
|
||||
else
|
||||
ApplyMinResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -24,7 +23,7 @@ namespace osu.Game.Rulesets.EmptyScrolling.Objects.Drawables
|
||||
{
|
||||
if (timeOffset >= 0)
|
||||
// todo: implement judgement logic
|
||||
ApplyResult(static (r, hitObject) => r.Type = HitResult.Perfect);
|
||||
ApplyMaxResult();
|
||||
}
|
||||
|
||||
protected override void UpdateHitStateTransforms(ArmedState state)
|
||||
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Pippidon.UI;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -50,11 +49,10 @@ namespace osu.Game.Rulesets.Pippidon.Objects.Drawables
|
||||
{
|
||||
if (timeOffset >= 0)
|
||||
{
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
var pippidonHitObject = (DrawablePippidonHitObject)hitObject;
|
||||
r.Type = pippidonHitObject.currentLane.Value == pippidonHitObject.HitObject.Lane ? HitResult.Perfect : HitResult.Miss;
|
||||
});
|
||||
if (currentLane.Value == HitObject.Lane)
|
||||
ApplyMaxResult();
|
||||
else
|
||||
ApplyMinResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,11 +64,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
|
||||
if (timeOffset >= 0 && Result != null)
|
||||
{
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
var catchHitObject = (DrawableCatchHitObject)hitObject;
|
||||
r.Type = catchHitObject.CheckPosition!.Invoke(catchHitObject.HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult;
|
||||
});
|
||||
if (CheckPosition.Invoke(HitObject))
|
||||
ApplyMaxResult();
|
||||
else
|
||||
ApplyMinResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
|
||||
private Drawable headPiece;
|
||||
|
||||
private HitResult hitResult;
|
||||
|
||||
public DrawableNote()
|
||||
: this(null)
|
||||
{
|
||||
@ -96,18 +94,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
return;
|
||||
}
|
||||
|
||||
hitResult = HitObject.HitWindows.ResultFor(timeOffset);
|
||||
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
||||
|
||||
if (hitResult == HitResult.None)
|
||||
if (result == HitResult.None)
|
||||
return;
|
||||
|
||||
hitResult = GetCappedResult(hitResult);
|
||||
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
var note = (DrawableNote)hitObject;
|
||||
r.Type = note.hitResult;
|
||||
});
|
||||
result = GetCappedResult(result);
|
||||
ApplyResult(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -160,19 +160,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
return;
|
||||
}
|
||||
|
||||
HitResult hitResult = ResultFor(timeOffset);
|
||||
var clickAction = CheckHittable?.Invoke(this, Time.Current, hitResult);
|
||||
var result = ResultFor(timeOffset);
|
||||
var clickAction = CheckHittable?.Invoke(this, Time.Current, result);
|
||||
|
||||
if (clickAction == ClickAction.Shake)
|
||||
Shake();
|
||||
|
||||
if (hitResult == HitResult.None || clickAction != ClickAction.Hit)
|
||||
if (result == HitResult.None || clickAction != ClickAction.Hit)
|
||||
return;
|
||||
|
||||
Vector2? hitPosition = null;
|
||||
|
||||
// Todo: This should also consider misses, but they're a little more interesting to handle, since we don't necessarily know the position at the time of a miss.
|
||||
if (hitResult.IsHit())
|
||||
if (result.IsHit())
|
||||
{
|
||||
var localMousePosition = ToLocalSpace(inputManager.CurrentState.Mouse.Position);
|
||||
hitPosition = HitObject.StackedPosition + (localMousePosition - DrawSize / 2);
|
||||
@ -184,7 +184,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
circleResult.Type = state.result;
|
||||
circleResult.CursorPositionAtHit = state.position;
|
||||
}, (hitResult, hitPosition));
|
||||
}, (result, hitPosition));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -11,8 +11,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
public override bool DisplayResult => false;
|
||||
|
||||
private bool hit;
|
||||
|
||||
public DrawableSpinnerTick()
|
||||
: this(null)
|
||||
{
|
||||
@ -39,12 +37,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
/// <param name="hit">Whether this tick was reached.</param>
|
||||
internal void TriggerResult(bool hit)
|
||||
{
|
||||
this.hit = hit;
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
var spinnerTick = (DrawableSpinnerTick)hitObject;
|
||||
r.Type = spinnerTick.hit ? r.Judgement.MaxResult : r.Judgement.MinResult;
|
||||
});
|
||||
if (hit)
|
||||
ApplyMaxResult();
|
||||
else
|
||||
ApplyMinResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
private double? lastPressHandleTime;
|
||||
|
||||
private HitResult hitResult;
|
||||
|
||||
private readonly Bindable<HitType> type = new Bindable<HitType>();
|
||||
|
||||
public DrawableHit()
|
||||
@ -105,20 +103,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
return;
|
||||
}
|
||||
|
||||
hitResult = HitObject.HitWindows.ResultFor(timeOffset);
|
||||
if (hitResult == HitResult.None)
|
||||
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
||||
if (result == HitResult.None)
|
||||
return;
|
||||
|
||||
if (!validActionPressed)
|
||||
ApplyMinResult();
|
||||
else
|
||||
{
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
var drawableHit = (DrawableHit)hitObject;
|
||||
r.Type = drawableHit.hitResult;
|
||||
});
|
||||
}
|
||||
ApplyResult(result);
|
||||
}
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<TaikoAction> e)
|
||||
|
@ -41,8 +41,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
private double? lastPressHandleTime;
|
||||
|
||||
private int numHits;
|
||||
|
||||
public override bool DisplayResult => false;
|
||||
|
||||
public DrawableSwell()
|
||||
@ -194,7 +192,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
nextTick?.TriggerResult(true);
|
||||
|
||||
numHits = ticks.Count(r => r.IsHit);
|
||||
int numHits = ticks.Count(r => r.IsHit);
|
||||
|
||||
float completion = (float)numHits / HitObject.RequiredHits;
|
||||
|
||||
@ -215,7 +213,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
if (timeOffset < 0)
|
||||
return;
|
||||
|
||||
numHits = 0;
|
||||
int numHits = 0;
|
||||
|
||||
foreach (var tick in ticks)
|
||||
{
|
||||
@ -229,11 +227,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
tick.TriggerResult(false);
|
||||
}
|
||||
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
var swell = (DrawableSwell)hitObject;
|
||||
r.Type = swell.numHits == swell.HitObject.RequiredHits ? r.Judgement.MaxResult : r.Judgement.MinResult;
|
||||
});
|
||||
if (numHits == HitObject.RequiredHits)
|
||||
ApplyMaxResult();
|
||||
else
|
||||
ApplyMinResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
{
|
||||
public override bool DisplayResult => false;
|
||||
|
||||
private bool hit;
|
||||
|
||||
public DrawableSwellTick()
|
||||
: this(null)
|
||||
{
|
||||
@ -31,13 +29,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
public void TriggerResult(bool hit)
|
||||
{
|
||||
this.hit = hit;
|
||||
HitObject.StartTime = Time.Current;
|
||||
ApplyResult(static (r, hitObject) =>
|
||||
{
|
||||
var swellTick = (DrawableSwellTick)hitObject;
|
||||
r.Type = swellTick.hit ? r.Judgement.MaxResult : r.Judgement.MinResult;
|
||||
});
|
||||
|
||||
if (hit)
|
||||
ApplyMaxResult();
|
||||
else
|
||||
ApplyMinResult();
|
||||
}
|
||||
|
||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||
|
Loading…
Reference in New Issue
Block a user