if scrolling with mouse wheel: show cursor and handle that
This commit is contained in:
1 parent
5bf8bebb9d
commit
909e763ed3
1 file changed
+14
-1
@@ -100,7 +100,7 @@ namespace Vocaluxe.Menu
|
|||||||
if (t < _CursorFadingTime)
|
if (t < _CursorFadingTime)
|
||||||
{
|
{
|
||||||
if (_CursorTargetAlpha >= _CursorStartAlpha)
|
if (_CursorTargetAlpha >= _CursorStartAlpha)
|
||||||
_Cursor.color.A = (_CursorTargetAlpha - _CursorStartAlpha) * t / _CursorFadingTime;
|
_Cursor.color.A = _CursorStartAlpha + (_CursorTargetAlpha - _CursorStartAlpha) * t / _CursorFadingTime;
|
||||||
else
|
else
|
||||||
_Cursor.color.A = (_CursorStartAlpha - _CursorTargetAlpha) * (1f - t / _CursorFadingTime);
|
_Cursor.color.A = (_CursorStartAlpha - _CursorTargetAlpha) * (1f - t / _CursorFadingTime);
|
||||||
}
|
}
|
||||||
@@ -150,6 +150,13 @@ namespace Vocaluxe.Menu
|
|||||||
Fade(0f, 0.5f);
|
Fade(0f, 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void FadeIn()
|
||||||
|
{
|
||||||
|
_Movetimer.Reset();
|
||||||
|
_Movetimer.Start();
|
||||||
|
Fade(1f, 0.2f);
|
||||||
|
}
|
||||||
|
|
||||||
private void Fade(float targetAlpha, float time)
|
private void Fade(float targetAlpha, float time)
|
||||||
{
|
{
|
||||||
_CursorFadingTimer.Stop();
|
_CursorFadingTimer.Stop();
|
||||||
@@ -418,6 +425,12 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
while (Mouse.PollEvent(ref MouseEvent))
|
while (Mouse.PollEvent(ref MouseEvent))
|
||||||
{
|
{
|
||||||
|
if (MouseEvent.Wheel != 0)
|
||||||
|
{
|
||||||
|
CSettings.MouseActive();
|
||||||
|
_Cursor.FadeIn();
|
||||||
|
}
|
||||||
|
|
||||||
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
|
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
|
||||||
|
|
||||||
if (!_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB))
|
if (!_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB))
|
||||||
|
|||||||
Reference in new issue
Block a user