Update with framework bindable changes

This commit is contained in:
smoogipoo
2019-02-21 18:56:34 +09:00
parent d637b184e4
commit bca347427f
195 changed files with 567 additions and 555 deletions

View File

@ -104,7 +104,7 @@ namespace osu.Game.Rulesets.Mods
}
}
protected abstract void OnComboChange(int newCombo);
protected abstract void OnComboChange(ValueChangedEvent<int> e);
protected abstract string FragmentShader { get; }

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Mods
public virtual void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
foreach (var d in drawables.Skip(IncreaseFirstObjectVisibility ? 1 : 0))
foreach (var d in drawables.Skip(IncreaseFirstObjectVisibility.Value ? 1 : 0))
d.ApplyCustomUpdateState += ApplyHiddenState;
}

View File

@ -124,14 +124,14 @@ namespace osu.Game.Rulesets.Objects.Drawables
{
base.LoadComplete();
State.ValueChanged += state =>
State.ValueChanged += e =>
{
UpdateState(state);
UpdateState(e.NewValue);
// apply any custom state overrides
ApplyCustomUpdateState?.Invoke(this, state);
ApplyCustomUpdateState?.Invoke(this, e.NewValue);
if (State == ArmedState.Hit)
if (e.NewValue == ArmedState.Hit)
PlaySamples();
};

View File

@ -168,11 +168,11 @@ namespace osu.Game.Rulesets.Scoring
/// </summary>
public virtual void PopulateScore(ScoreInfo score)
{
score.TotalScore = (int)Math.Round(TotalScore);
score.Combo = Combo;
score.MaxCombo = HighestCombo;
score.Accuracy = Math.Round(Accuracy, 4);
score.Rank = Rank;
score.TotalScore = (int)Math.Round(TotalScore.Value);
score.Combo = Combo.Value;
score.MaxCombo = HighestCombo.Value;
score.Accuracy = Math.Round(Accuracy.Value, 4);
score.Rank = Rank.Value;
score.Date = DateTimeOffset.Now;
var hitWindows = CreateHitWindows();
@ -298,8 +298,8 @@ namespace osu.Game.Rulesets.Scoring
/// <param name="result">The <see cref="JudgementResult"/> to apply.</param>
protected virtual void ApplyResult(JudgementResult result)
{
result.ComboAtJudgement = Combo;
result.HighestComboAtJudgement = HighestCombo;
result.ComboAtJudgement = Combo.Value;
result.HighestComboAtJudgement = HighestCombo.Value;
JudgedHits++;
@ -371,10 +371,10 @@ namespace osu.Game.Rulesets.Scoring
{
default:
case ScoringMode.Standardised:
return max_score * (base_portion * baseScore / maxBaseScore + combo_portion * HighestCombo / maxHighestCombo) + bonusScore;
return max_score * (base_portion * baseScore / maxBaseScore + combo_portion * HighestCombo.Value / maxHighestCombo) + bonusScore;
case ScoringMode.Classic:
// should emulate osu-stable's scoring as closely as we can (https://osu.ppy.sh/help/wiki/Score/ScoreV1)
return bonusScore + baseScore * (1 + Math.Max(0, HighestCombo - 1) / 25);
return bonusScore + baseScore * (1 + Math.Max(0, HighestCombo.Value - 1) / 25);
}
}
@ -389,7 +389,7 @@ namespace osu.Game.Rulesets.Scoring
if (storeResults)
{
MaxHits = JudgedHits;
maxHighestCombo = HighestCombo;
maxHighestCombo = HighestCombo.Value;
maxBaseScore = baseScore;
}

View File

@ -94,12 +94,12 @@ namespace osu.Game.Rulesets.UI
Ruleset = ruleset;
playfield = new Lazy<Playfield>(CreatePlayfield);
IsPaused.ValueChanged += paused =>
IsPaused.ValueChanged += e =>
{
if (HasReplayLoaded)
if (HasReplayLoaded.Value)
return;
KeyBindingInputManager.UseParentInput = !paused;
KeyBindingInputManager.UseParentInput = !e.NewValue;
};
Cursor = CreateCursor();

View File

@ -157,10 +157,10 @@ namespace osu.Game.Rulesets.UI.Scrolling
switch (action)
{
case GlobalAction.IncreaseScrollSpeed:
this.TransformBindableTo(TimeRange, TimeRange - time_span_step, 200, Easing.OutQuint);
this.TransformBindableTo(TimeRange, TimeRange.Value - time_span_step, 200, Easing.OutQuint);
return true;
case GlobalAction.DecreaseScrollSpeed:
this.TransformBindableTo(TimeRange, TimeRange + time_span_step, 200, Easing.OutQuint);
this.TransformBindableTo(TimeRange, TimeRange.Value + time_span_step, 200, Easing.OutQuint);
return true;
}