mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
split shader, remove unnecessary clutter and fix some bugs
This commit is contained in:
@ -1,13 +1,12 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Taiko.Objects;
|
||||
using osu.Game.Rulesets.Taiko.UI;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
@ -34,22 +33,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
public TaikoFlashlight(TaikoPlayfield taikoPlayfield)
|
||||
{
|
||||
this.taikoPlayfield = taikoPlayfield;
|
||||
MousePosWrapper.CircularFlashlightSize = getSizeFor(0);
|
||||
MousePosWrapper.Rectangular = false;
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
private float flashlightSize
|
||||
{
|
||||
set
|
||||
{
|
||||
if (MousePosWrapper.CircularFlashlightSize == value) return;
|
||||
|
||||
MousePosWrapper.CircularFlashlightSize = value;
|
||||
MousePosWrapper.CircularFlashlightSizeChanged = true;
|
||||
}
|
||||
|
||||
get => MousePosWrapper.CircularFlashlightSize;
|
||||
FlashlightSize = new Vector2(0, getSizeFor(0));
|
||||
}
|
||||
|
||||
private float getSizeFor(int combo)
|
||||
@ -64,17 +48,18 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
|
||||
protected override void OnComboChange(int newCombo)
|
||||
{
|
||||
this.TransformTo(nameof(flashlightSize), getSizeFor(newCombo), FLASHLIGHT_FADE_DURATION);
|
||||
this.TransformTo(nameof(FlashlightSize), new Vector2(0, getSizeFor(newCombo)), FLASHLIGHT_FADE_DURATION);
|
||||
}
|
||||
|
||||
protected override string FragmentShader => "CircularFlashlight";
|
||||
|
||||
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
|
||||
{
|
||||
if ((invalidation & Invalidation.DrawSize) > 0)
|
||||
{
|
||||
Schedule(() =>
|
||||
{
|
||||
MousePosWrapper.FlashlightPosition = taikoPlayfield.HitExplosionContainer.ScreenSpaceDrawQuad.Centre;
|
||||
MousePosWrapper.FlashlightPositionChanged = true;
|
||||
FlashlightPosition = taikoPlayfield.HitTarget.ToSpaceOfOtherDrawable(taikoPlayfield.HitTarget.OriginPosition, this);
|
||||
});
|
||||
}
|
||||
|
||||
@ -85,8 +70,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
MousePosWrapper.FlashlightPosition = taikoPlayfield.HitExplosionContainer.ScreenSpaceDrawQuad.Centre;
|
||||
MousePosWrapper.FlashlightPositionChanged = true;
|
||||
FlashlightPosition = taikoPlayfield.HitTarget.ToSpaceOfOtherDrawable(taikoPlayfield.HitTarget.OriginPosition, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user