Remove DisplayInitialCombo method for simplicity

This commit is contained in:
Dean Herbert
2020-09-22 12:35:18 +09:00
parent 92cda6bccb
commit 08d8975566
3 changed files with 11 additions and 15 deletions

View File

@ -50,11 +50,17 @@ namespace osu.Game.Rulesets.Catch.Skinning
}; };
} }
public void DisplayInitialCombo(int combo) => updateCombo(combo, null, true); private int lastDisplayedCombo;
public void UpdateCombo(int combo, Color4? hitObjectColour) => updateCombo(combo, hitObjectColour, false);
private void updateCombo(int combo, Color4? hitObjectColour, bool immediate) public void UpdateCombo(int combo, Color4? hitObjectColour = null)
{ {
bool immediate = Time.Elapsed < 0;
if (combo == lastDisplayedCombo)
return;
lastDisplayedCombo = combo;
// There may still be existing transforms to the counter (including value change after 250ms), // There may still be existing transforms to the counter (including value change after 250ms),
// finish them immediately before new transforms. // finish them immediately before new transforms.
counter.FinishTransforms(); counter.FinishTransforms();

View File

@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Catch.UI
protected override void SkinChanged(ISkinSource skin, bool allowFallback) protected override void SkinChanged(ISkinSource skin, bool allowFallback)
{ {
base.SkinChanged(skin, allowFallback); base.SkinChanged(skin, allowFallback);
ComboCounter?.DisplayInitialCombo(currentCombo); ComboCounter?.UpdateCombo(currentCombo);
} }
public void OnNewResult(DrawableCatchHitObject judgedObject, JudgementResult result) public void OnNewResult(DrawableCatchHitObject judgedObject, JudgementResult result)

View File

@ -11,16 +11,6 @@ namespace osu.Game.Rulesets.Catch.UI
/// </summary> /// </summary>
public interface ICatchComboCounter : IDrawable public interface ICatchComboCounter : IDrawable
{ {
/// <summary>
/// Updates the counter to display the provided <paramref name="combo"/> as initial value.
/// The value should be immediately displayed without any animation.
/// </summary>
/// <remarks>
/// This is required for when instantiating a combo counter in middle of accumulating combo (via skin change).
/// </remarks>
/// <param name="combo">The combo value to be displayed as initial.</param>
void DisplayInitialCombo(int combo);
/// <summary> /// <summary>
/// Updates the counter to animate a transition from the old combo value it had to the current provided one. /// Updates the counter to animate a transition from the old combo value it had to the current provided one.
/// </summary> /// </summary>
@ -29,6 +19,6 @@ namespace osu.Game.Rulesets.Catch.UI
/// </remarks> /// </remarks>
/// <param name="combo">The new combo value.</param> /// <param name="combo">The new combo value.</param>
/// <param name="hitObjectColour">The colour of the object if hit, null on miss.</param> /// <param name="hitObjectColour">The colour of the object if hit, null on miss.</param>
void UpdateCombo(int combo, Color4? hitObjectColour); void UpdateCombo(int combo, Color4? hitObjectColour = null);
} }
} }