mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
split shader, remove unnecessary clutter and fix some bugs
This commit is contained in:
@ -1,12 +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.Framework.Input.Events;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
@ -22,31 +22,15 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public OsuFlashlight()
|
||||
{
|
||||
MousePosWrapper.CircularFlashlightSize = getSizeFor(0);
|
||||
MousePosWrapper.Rectangular = false;
|
||||
FlashlightSize = new Vector2(0, getSizeFor(0));
|
||||
}
|
||||
|
||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||
{
|
||||
MousePosWrapper.FlashlightPosition = e.ScreenSpaceMousePosition;
|
||||
MousePosWrapper.FlashlightPositionChanged = true;
|
||||
FlashlightPosition = e.MousePosition;
|
||||
return base.OnMouseMove(e);
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
private float flashlightSize
|
||||
{
|
||||
set
|
||||
{
|
||||
if (MousePosWrapper.CircularFlashlightSize == value) return;
|
||||
|
||||
MousePosWrapper.CircularFlashlightSize = value;
|
||||
MousePosWrapper.CircularFlashlightSizeChanged = true;
|
||||
}
|
||||
|
||||
get => MousePosWrapper.CircularFlashlightSize;
|
||||
}
|
||||
|
||||
private float getSizeFor(int combo)
|
||||
{
|
||||
if (combo > 200)
|
||||
@ -59,8 +43,10 @@ namespace osu.Game.Rulesets.Osu.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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user