mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Rename cursorScale and calculatedCursorScale
This commit is contained in:
parent
ae2fe62fd9
commit
8c671d7fde
@ -29,9 +29,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
|
||||
private readonly Drawable cursorTrail;
|
||||
|
||||
public IBindable<float> CalculatedCursorScale => calculatedCursorScale;
|
||||
private Bindable<float> calculatedCursorScale;
|
||||
public IBindable<float> CursorScale => cursorScale;
|
||||
private Bindable<float> cursorScale;
|
||||
private Bindable<float> userCursorScale;
|
||||
private Bindable<bool> autoCursorScale;
|
||||
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.ValueChanged += _ => calculateScale();
|
||||
|
||||
cursorScale = config.GetBindable<float>(OsuSetting.GameplayCursorSize);
|
||||
cursorScale.ValueChanged += _ => calculateScale();
|
||||
userCursorScale = config.GetBindable<float>(OsuSetting.GameplayCursorSize);
|
||||
userCursorScale.ValueChanged += _ => calculateScale();
|
||||
|
||||
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
|
||||
autoCursorScale.ValueChanged += _ => calculateScale();
|
||||
|
||||
calculatedCursorScale = new Bindable<float>();
|
||||
calculatedCursorScale.ValueChanged += e => ActiveCursor.Scale = cursorTrail.Scale = new Vector2(e.NewValue);
|
||||
cursorScale = new Bindable<float>();
|
||||
cursorScale.ValueChanged += e => ActiveCursor.Scale = cursorTrail.Scale = new Vector2(e.NewValue);
|
||||
|
||||
calculateScale();
|
||||
}
|
||||
|
||||
private void calculateScale()
|
||||
{
|
||||
float scale = cursorScale.Value;
|
||||
float scale = userCursorScale.Value;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
calculatedCursorScale.Value = scale;
|
||||
cursorScale.Value = scale;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -130,13 +130,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
protected override void PopIn()
|
||||
{
|
||||
fadeContainer.FadeTo(1, 300, Easing.OutQuint);
|
||||
ActiveCursor.ScaleTo(calculatedCursorScale.Value, 400, Easing.OutQuint);
|
||||
ActiveCursor.ScaleTo(cursorScale.Value, 400, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
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
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
Add(localCursorContainer = new OsuCursorContainer());
|
||||
|
||||
localCursorContainer.CalculatedCursorScale.BindValueChanged(scale =>
|
||||
localCursorContainer.CursorScale.BindValueChanged(scale =>
|
||||
{
|
||||
clickToResumeCursor.CursorScale = scale.NewValue;
|
||||
clickToResumeCursor.Scale = new Vector2(scale.NewValue);
|
||||
|
Loading…
Reference in New Issue
Block a user