mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Combo should not be longs.
This commit is contained in:
parent
eca980bb95
commit
2bc36fecc6
@ -10,8 +10,8 @@ namespace osu.Game.Modes
|
|||||||
public double TotalScore { get; set; }
|
public double TotalScore { get; set; }
|
||||||
public double Accuracy { get; set; }
|
public double Accuracy { get; set; }
|
||||||
public double Health { get; set; }
|
public double Health { get; set; }
|
||||||
public long Combo { get; set; }
|
public int MaxCombo { get; set; }
|
||||||
public long MaxCombo { get; set; }
|
public int Combo { get; set; }
|
||||||
|
|
||||||
public Replay Replay;
|
public Replay Replay;
|
||||||
public BeatmapInfo Beatmap;
|
public BeatmapInfo Beatmap;
|
||||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
public readonly BindableDouble Health = new BindableDouble { MinValue = 0, MaxValue = 1 };
|
public readonly BindableDouble Health = new BindableDouble { MinValue = 0, MaxValue = 1 };
|
||||||
|
|
||||||
public readonly BindableLong Combo = new BindableLong();
|
public readonly BindableInt Combo = new BindableInt();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Are we allowed to fail?
|
/// Are we allowed to fail?
|
||||||
@ -43,7 +43,7 @@ namespace osu.Game.Modes
|
|||||||
/// Keeps track of the highest combo ever achieved in this play.
|
/// Keeps track of the highest combo ever achieved in this play.
|
||||||
/// This is handled automatically by ScoreProcessor.
|
/// This is handled automatically by ScoreProcessor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableLong HighestCombo = new BindableLong();
|
public readonly BindableInt HighestCombo = new BindableInt();
|
||||||
|
|
||||||
public readonly List<JudgementInfo> Judgements;
|
public readonly List<JudgementInfo> Judgements;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
public abstract class ComboCounter : Container
|
public abstract class ComboCounter : Container
|
||||||
{
|
{
|
||||||
public BindableLong Current = new BindableLong
|
public BindableInt Current = new BindableInt
|
||||||
{
|
{
|
||||||
MinValue = 0,
|
MinValue = 0,
|
||||||
};
|
};
|
||||||
@ -42,7 +42,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
protected SpriteText DisplayedCountSpriteText;
|
protected SpriteText DisplayedCountSpriteText;
|
||||||
|
|
||||||
private long previousValue;
|
private int previousValue;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base of all combo counters.
|
/// Base of all combo counters.
|
||||||
@ -85,11 +85,11 @@ namespace osu.Game.Modes.UI
|
|||||||
StopRolling();
|
StopRolling();
|
||||||
}
|
}
|
||||||
|
|
||||||
private long displayedCount;
|
private int displayedCount;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value shown at the current moment.
|
/// Value shown at the current moment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual long DisplayedCount
|
public virtual int DisplayedCount
|
||||||
{
|
{
|
||||||
get { return displayedCount; }
|
get { return displayedCount; }
|
||||||
protected set
|
protected set
|
||||||
@ -116,7 +116,7 @@ namespace osu.Game.Modes.UI
|
|||||||
/// Increments the combo by an amount.
|
/// Increments the combo by an amount.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="amount"></param>
|
/// <param name="amount"></param>
|
||||||
public void Increment(long amount = 1)
|
public void Increment(int amount = 1)
|
||||||
{
|
{
|
||||||
Current.Value = Current + amount;
|
Current.Value = Current + amount;
|
||||||
}
|
}
|
||||||
@ -129,33 +129,33 @@ namespace osu.Game.Modes.UI
|
|||||||
updateCount(false);
|
updateCount(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual string FormatCount(long count)
|
protected virtual string FormatCount(int count)
|
||||||
{
|
{
|
||||||
return count.ToString();
|
return count.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCountRolling(long currentValue, long newValue)
|
protected virtual void OnCountRolling(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
transformRoll(new TransformComboRoll(), currentValue, newValue);
|
transformRoll(new TransformComboRoll(), currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCountIncrement(long currentValue, long newValue)
|
protected virtual void OnCountIncrement(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCount = newValue;
|
DisplayedCount = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCountChange(long currentValue, long newValue)
|
protected virtual void OnCountChange(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCount = newValue;
|
DisplayedCount = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getProportionalDuration(long currentValue, long newValue)
|
private double getProportionalDuration(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
double difference = currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
double difference = currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
||||||
return difference * RollingDuration;
|
return difference * RollingDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDisplayedCount(long currentValue, long newValue, bool rolling)
|
private void updateDisplayedCount(int currentValue, int newValue, bool rolling)
|
||||||
{
|
{
|
||||||
displayedCount = newValue;
|
displayedCount = newValue;
|
||||||
if (rolling)
|
if (rolling)
|
||||||
@ -168,7 +168,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
private void updateCount(bool rolling)
|
private void updateCount(bool rolling)
|
||||||
{
|
{
|
||||||
long prev = previousValue;
|
int prev = previousValue;
|
||||||
previousValue = Current;
|
previousValue = Current;
|
||||||
|
|
||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
@ -192,7 +192,7 @@ namespace osu.Game.Modes.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformRoll(TransformComboRoll transform, long currentValue, long newValue)
|
private void transformRoll(TransformComboRoll transform, int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
Flush(false, typeof(TransformComboRoll));
|
Flush(false, typeof(TransformComboRoll));
|
||||||
|
|
||||||
@ -211,9 +211,9 @@ namespace osu.Game.Modes.UI
|
|||||||
Transforms.Add(transform);
|
Transforms.Add(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class TransformComboRoll : Transform<long>
|
protected class TransformComboRoll : Transform<int>
|
||||||
{
|
{
|
||||||
protected override long CurrentValue
|
protected override int CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -221,7 +221,7 @@ namespace osu.Game.Modes.UI
|
|||||||
if (time < StartTime) return StartValue;
|
if (time < StartTime) return StartValue;
|
||||||
if (time >= EndTime) return EndValue;
|
if (time >= EndTime) return EndValue;
|
||||||
|
|
||||||
return (long)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
return (int)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,8 +232,8 @@ namespace osu.Game.Modes.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void OnDisplayedCountRolling(long currentValue, long newValue);
|
protected abstract void OnDisplayedCountRolling(int currentValue, int newValue);
|
||||||
protected abstract void OnDisplayedCountIncrement(long newValue);
|
protected abstract void OnDisplayedCountIncrement(int newValue);
|
||||||
protected abstract void OnDisplayedCountChange(long newValue);
|
protected abstract void OnDisplayedCountChange(int newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,12 @@ namespace osu.Game.Modes.UI
|
|||||||
PopOutCount.Anchor = Anchor;
|
PopOutCount.Anchor = Anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string FormatCount(long count)
|
protected override string FormatCount(int count)
|
||||||
{
|
{
|
||||||
return $@"{count}x";
|
return $@"{count}x";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformPopOut(long newValue)
|
protected virtual void TransformPopOut(int newValue)
|
||||||
{
|
{
|
||||||
PopOutCount.Text = FormatCount(newValue);
|
PopOutCount.Text = FormatCount(newValue);
|
||||||
|
|
||||||
@ -43,19 +43,19 @@ namespace osu.Game.Modes.UI
|
|||||||
PopOutCount.MoveTo(DisplayedCountSpriteText.Position, PopOutDuration, PopOutEasing);
|
PopOutCount.MoveTo(DisplayedCountSpriteText.Position, PopOutDuration, PopOutEasing);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformPopOutRolling(long newValue)
|
protected virtual void TransformPopOutRolling(int newValue)
|
||||||
{
|
{
|
||||||
TransformPopOut(newValue);
|
TransformPopOut(newValue);
|
||||||
TransformPopOutSmall(newValue);
|
TransformPopOutSmall(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformNoPopOut(long newValue)
|
protected virtual void TransformNoPopOut(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||||
DisplayedCountSpriteText.ScaleTo(1);
|
DisplayedCountSpriteText.ScaleTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformPopOutSmall(long newValue)
|
protected virtual void TransformPopOutSmall(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||||
DisplayedCountSpriteText.ScaleTo(PopOutSmallScale);
|
DisplayedCountSpriteText.ScaleTo(PopOutSmallScale);
|
||||||
@ -71,7 +71,7 @@ namespace osu.Game.Modes.UI
|
|||||||
DisplayedCount++;
|
DisplayedCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCountRolling(long currentValue, long newValue)
|
protected override void OnCountRolling(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
ScheduledPopOutCurrentId++;
|
ScheduledPopOutCurrentId++;
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ namespace osu.Game.Modes.UI
|
|||||||
base.OnCountRolling(currentValue, newValue);
|
base.OnCountRolling(currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCountIncrement(long currentValue, long newValue)
|
protected override void OnCountIncrement(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
ScheduledPopOutCurrentId++;
|
ScheduledPopOutCurrentId++;
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ namespace osu.Game.Modes.UI
|
|||||||
}, PopOutDuration);
|
}, PopOutDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCountChange(long currentValue, long newValue)
|
protected override void OnCountChange(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
ScheduledPopOutCurrentId++;
|
ScheduledPopOutCurrentId++;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ namespace osu.Game.Modes.UI
|
|||||||
base.OnCountChange(currentValue, newValue);
|
base.OnCountChange(currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplayedCountRolling(long currentValue, long newValue)
|
protected override void OnDisplayedCountRolling(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
if (newValue == 0)
|
if (newValue == 0)
|
||||||
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
||||||
@ -123,14 +123,14 @@ namespace osu.Game.Modes.UI
|
|||||||
TransformNoPopOut(newValue);
|
TransformNoPopOut(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplayedCountChange(long newValue)
|
protected override void OnDisplayedCountChange(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.FadeTo(newValue == 0 ? 0 : 1);
|
DisplayedCountSpriteText.FadeTo(newValue == 0 ? 0 : 1);
|
||||||
|
|
||||||
TransformNoPopOut(newValue);
|
TransformNoPopOut(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplayedCountIncrement(long newValue)
|
protected override void OnDisplayedCountIncrement(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Show();
|
DisplayedCountSpriteText.Show();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user