mirror of https://github.com/ppy/osu
Refactor taiko flashlight a bit
This commit is contained in:
parent
f584d6593a
commit
2d39131202
|
@ -36,24 +36,25 @@ private class TaikoFlashlight : Flashlight
|
|||
public TaikoFlashlight(TaikoPlayfield taikoPlayfield)
|
||||
{
|
||||
this.taikoPlayfield = taikoPlayfield;
|
||||
FlashlightSize = new Vector2(0, getSizeFor(0));
|
||||
FlashlightSize = getSizeFor(0);
|
||||
|
||||
AddLayout(flashlightProperties);
|
||||
}
|
||||
|
||||
private float getSizeFor(int combo)
|
||||
private Vector2 getSizeFor(int combo)
|
||||
{
|
||||
if (combo > 200)
|
||||
return default_flashlight_size * 0.8f;
|
||||
else if (combo > 100)
|
||||
return default_flashlight_size * 0.9f;
|
||||
else
|
||||
return default_flashlight_size;
|
||||
return new Vector2(0, default_flashlight_size * 0.8f);
|
||||
|
||||
if (combo > 100)
|
||||
return new Vector2(0, default_flashlight_size * 0.9f);
|
||||
|
||||
return new Vector2(0, default_flashlight_size);
|
||||
}
|
||||
|
||||
protected override void OnComboChange(ValueChangedEvent<int> e)
|
||||
{
|
||||
this.TransformTo(nameof(FlashlightSize), new Vector2(0, getSizeFor(e.NewValue)), FLASHLIGHT_FADE_DURATION);
|
||||
this.TransformTo(nameof(FlashlightSize), getSizeFor(e.NewValue), FLASHLIGHT_FADE_DURATION);
|
||||
}
|
||||
|
||||
protected override string FragmentShader => "CircularFlashlight";
|
||||
|
|
|
@ -81,7 +81,7 @@ public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
|
|||
|
||||
public abstract class Flashlight : Drawable
|
||||
{
|
||||
internal BindableInt Combo;
|
||||
protected internal BindableInt Combo { get; internal set; }
|
||||
private IShader shader;
|
||||
|
||||
protected override DrawNode CreateDrawNode() => new FlashlightDrawNode(this);
|
||||
|
|
Loading…
Reference in New Issue