mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Refactors handling of scale to a function
This commit is contained in:
parent
1a142ff944
commit
bd71da012a
@ -78,22 +78,19 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
);
|
||||
}
|
||||
public void Update(Playfield playfield)
|
||||
//terrible terrible handling on making sure cursor position stays accurate, will fix
|
||||
{
|
||||
bool beBaseSize = IsBreakTime.Value;
|
||||
var osuPlayfield = (OsuPlayfield)playfield;
|
||||
OsuPlayfield osuPlayfield = (OsuPlayfield)playfield;
|
||||
Debug.Assert(osuPlayfield.Cursor != null);
|
||||
var realCursor = (OsuCursor)osuPlayfield.Cursor.ActiveCursor;
|
||||
realCursor.isBloom = true;
|
||||
float currentCombSize = (float)Interpolation.Lerp(realCursor.ComboSize, ComboBasedSize, Math.Clamp(osuPlayfield.Time.Elapsed / TRANSITION_DURATION, 0, 1));
|
||||
Console.WriteLine(ComboBasedSize + " " + currentCombSize);
|
||||
OsuCursor realCursor = (OsuCursor)osuPlayfield.Cursor.ActiveCursor;
|
||||
float currentCombSize = (float)Interpolation.Lerp(realCursor.CursorScale.Value, ComboBasedSize, Math.Clamp(osuPlayfield.Time.Elapsed / TRANSITION_DURATION, 0, 1));
|
||||
if (beBaseSize)
|
||||
{
|
||||
realCursor.ComboSize = 1;
|
||||
realCursor.UpdateSize(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
realCursor.ComboSize = currentCombSize;
|
||||
realCursor.UpdateSize(currentCombSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ using osu.Game.Screens.Play;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
{
|
||||
@ -40,8 +39,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
public IBindable<float> CursorScale => cursorScale;
|
||||
|
||||
private readonly Bindable<float> cursorScale = new BindableFloat(1);
|
||||
public bool isBloom;
|
||||
public float ComboSize;
|
||||
|
||||
private Bindable<float> userCursorScale = null!;
|
||||
private Bindable<bool> autoCursorScale = null!;
|
||||
@ -77,16 +74,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
{
|
||||
base.LoadComplete();
|
||||
cursorScale.Value = CalculateCursorScale();
|
||||
isBloom = false;
|
||||
}
|
||||
protected override void Update()
|
||||
//this should not exist will implement sane fix
|
||||
{
|
||||
base.Update();
|
||||
if (isBloom)
|
||||
{
|
||||
cursorScale.Value = ComboSize;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual Drawable CreateCursorContent() => cursorScaleContainer = new Container
|
||||
@ -113,6 +100,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
|
||||
return scale;
|
||||
}
|
||||
public void UpdateSize(float size)
|
||||
{
|
||||
cursorScale.Value = size;
|
||||
}
|
||||
|
||||
protected override void SkinChanged(ISkinSource skin)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user