1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Rename cursorScale and calculatedCursorScale

This commit is contained in:
HoLLy 2019-10-15 20:12:08 +02:00
parent ae2fe62fd9
commit 8c671d7fde
2 changed files with 11 additions and 11 deletions

View File

@ -29,9 +29,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
private readonly Drawable cursorTrail; private readonly Drawable cursorTrail;
public IBindable<float> CalculatedCursorScale => calculatedCursorScale; public IBindable<float> CursorScale => cursorScale;
private Bindable<float> calculatedCursorScale;
private Bindable<float> cursorScale; private Bindable<float> cursorScale;
private Bindable<float> userCursorScale;
private Bindable<bool> autoCursorScale; private Bindable<bool> autoCursorScale;
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>(); private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
@ -52,21 +52,21 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
this.beatmap.BindTo(beatmap); this.beatmap.BindTo(beatmap);
this.beatmap.ValueChanged += _ => calculateScale(); this.beatmap.ValueChanged += _ => calculateScale();
cursorScale = config.GetBindable<float>(OsuSetting.GameplayCursorSize); userCursorScale = config.GetBindable<float>(OsuSetting.GameplayCursorSize);
cursorScale.ValueChanged += _ => calculateScale(); userCursorScale.ValueChanged += _ => calculateScale();
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize); autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
autoCursorScale.ValueChanged += _ => calculateScale(); autoCursorScale.ValueChanged += _ => calculateScale();
calculatedCursorScale = new Bindable<float>(); cursorScale = new Bindable<float>();
calculatedCursorScale.ValueChanged += e => ActiveCursor.Scale = cursorTrail.Scale = new Vector2(e.NewValue); cursorScale.ValueChanged += e => ActiveCursor.Scale = cursorTrail.Scale = new Vector2(e.NewValue);
calculateScale(); calculateScale();
} }
private void calculateScale() private void calculateScale()
{ {
float scale = cursorScale.Value; float scale = userCursorScale.Value;
if (autoCursorScale.Value && beatmap.Value != null) if (autoCursorScale.Value && beatmap.Value != null)
{ {
@ -74,7 +74,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
scale *= 1f - 0.7f * (1f + beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize - BeatmapDifficulty.DEFAULT_DIFFICULTY) / BeatmapDifficulty.DEFAULT_DIFFICULTY; scale *= 1f - 0.7f * (1f + beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize - BeatmapDifficulty.DEFAULT_DIFFICULTY) / BeatmapDifficulty.DEFAULT_DIFFICULTY;
} }
calculatedCursorScale.Value = scale; cursorScale.Value = scale;
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -130,13 +130,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
protected override void PopIn() protected override void PopIn()
{ {
fadeContainer.FadeTo(1, 300, Easing.OutQuint); fadeContainer.FadeTo(1, 300, Easing.OutQuint);
ActiveCursor.ScaleTo(calculatedCursorScale.Value, 400, Easing.OutQuint); ActiveCursor.ScaleTo(cursorScale.Value, 400, Easing.OutQuint);
} }
protected override void PopOut() protected override void PopOut()
{ {
fadeContainer.FadeTo(0.05f, 450, Easing.OutQuint); fadeContainer.FadeTo(0.05f, 450, Easing.OutQuint);
ActiveCursor.ScaleTo(calculatedCursorScale.Value * 0.8f, 450, Easing.OutQuint); ActiveCursor.ScaleTo(cursorScale.Value * 0.8f, 450, Easing.OutQuint);
} }
private class DefaultCursorTrail : CursorTrail private class DefaultCursorTrail : CursorTrail

View File

@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.UI
{ {
Add(localCursorContainer = new OsuCursorContainer()); Add(localCursorContainer = new OsuCursorContainer());
localCursorContainer.CalculatedCursorScale.BindValueChanged(scale => localCursorContainer.CursorScale.BindValueChanged(scale =>
{ {
clickToResumeCursor.CursorScale = scale.NewValue; clickToResumeCursor.CursorScale = scale.NewValue;
clickToResumeCursor.Scale = new Vector2(scale.NewValue); clickToResumeCursor.Scale = new Vector2(scale.NewValue);