if scrolling with mouse wheel: show cursor and handle that

This commit is contained in:
Alexander Eckart committed 2012-02-29 19:10:21 +01:00
1 parent 5bf8bebb9d
commit 909e763ed3
1 file changed
+14 -1
+14 -1
View File
@@ -100,7 +100,7 @@ namespace Vocaluxe.Menu
if (t < _CursorFadingTime)
{
if (_CursorTargetAlpha >= _CursorStartAlpha)
_Cursor.color.A = (_CursorTargetAlpha - _CursorStartAlpha) * t / _CursorFadingTime;
_Cursor.color.A = _CursorStartAlpha + (_CursorTargetAlpha - _CursorStartAlpha) * t / _CursorFadingTime;
else
_Cursor.color.A = (_CursorStartAlpha - _CursorTargetAlpha) * (1f - t / _CursorFadingTime);
}
@@ -150,6 +150,13 @@ namespace Vocaluxe.Menu
Fade(0f, 0.5f);
}
public void FadeIn()
{
_Movetimer.Reset();
_Movetimer.Start();
Fade(1f, 0.2f);
}
private void Fade(float targetAlpha, float time)
{
_CursorFadingTimer.Stop();
@@ -418,6 +425,12 @@ namespace Vocaluxe.Menu
while (Mouse.PollEvent(ref MouseEvent))
{
if (MouseEvent.Wheel != 0)
{
CSettings.MouseActive();
_Cursor.FadeIn();
}
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
if (!_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB))