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 @@ public LegacyComboCounter(ISkin skin)
};
}
public void DisplayInitialCombo(int combo) => updateCombo(combo, null, true);
public void UpdateCombo(int combo, Color4? hitObjectColour) => updateCombo(combo, hitObjectColour, false);
private int lastDisplayedCombo;
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),
// finish them immediately before new transforms.
counter.FinishTransforms();

View File

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

View File

@ -11,16 +11,6 @@ namespace osu.Game.Rulesets.Catch.UI
/// </summary>
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>
/// Updates the counter to animate a transition from the old combo value it had to the current provided one.
/// </summary>
@ -29,6 +19,6 @@ public interface ICatchComboCounter : IDrawable
/// </remarks>
/// <param name="combo">The new combo value.</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);
}
}