first wiimote support
This commit is contained in:
1 parent
9ce6b16aff
commit
f577e53925
11 files changed
+133
-67
No files matched your search
+33
-21
@@ -14,7 +14,7 @@ using Vocaluxe.Lib.Draw;
|
|||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
{
|
{
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum Modifier
|
public enum EModifier
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
Shift,
|
Shift,
|
||||||
@@ -22,8 +22,17 @@ namespace Vocaluxe.Base
|
|||||||
Ctrl
|
Ctrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum ESender
|
||||||
|
{
|
||||||
|
Mouse,
|
||||||
|
Keyboard,
|
||||||
|
WiiMote,
|
||||||
|
Gamepad
|
||||||
|
}
|
||||||
|
|
||||||
public struct KeyEvent
|
public struct KeyEvent
|
||||||
{
|
{
|
||||||
|
public ESender Sender;
|
||||||
public bool ModALT;
|
public bool ModALT;
|
||||||
public bool ModSHIFT;
|
public bool ModSHIFT;
|
||||||
public bool ModCTRL;
|
public bool ModCTRL;
|
||||||
@@ -31,10 +40,11 @@ namespace Vocaluxe.Base
|
|||||||
public bool Handled;
|
public bool Handled;
|
||||||
public Keys Key;
|
public Keys Key;
|
||||||
public Char Unicode;
|
public Char Unicode;
|
||||||
public Modifier Mod;
|
public EModifier Mod;
|
||||||
|
|
||||||
public KeyEvent(bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key)
|
public KeyEvent(ESender sender, bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key)
|
||||||
{
|
{
|
||||||
|
Sender = sender;
|
||||||
ModALT = alt;
|
ModALT = alt;
|
||||||
ModSHIFT = shift;
|
ModSHIFT = shift;
|
||||||
ModCTRL = ctrl;
|
ModCTRL = ctrl;
|
||||||
@@ -43,21 +53,21 @@ namespace Vocaluxe.Base
|
|||||||
Key = key;
|
Key = key;
|
||||||
Handled = false;
|
Handled = false;
|
||||||
|
|
||||||
Modifier mALT = Modifier.None;
|
EModifier mALT = EModifier.None;
|
||||||
Modifier mSHIFT = Modifier.None;
|
EModifier mSHIFT = EModifier.None;
|
||||||
Modifier mCTRL = Modifier.None;
|
EModifier mCTRL = EModifier.None;
|
||||||
|
|
||||||
if (alt)
|
if (alt)
|
||||||
mALT = Modifier.Alt;
|
mALT = EModifier.Alt;
|
||||||
|
|
||||||
if (shift)
|
if (shift)
|
||||||
mSHIFT = Modifier.Shift;
|
mSHIFT = EModifier.Shift;
|
||||||
|
|
||||||
if (ctrl)
|
if (ctrl)
|
||||||
mCTRL = Modifier.Ctrl;
|
mCTRL = EModifier.Ctrl;
|
||||||
|
|
||||||
if (!alt && !shift && !ctrl)
|
if (!alt && !shift && !ctrl)
|
||||||
Mod = Modifier.None;
|
Mod = EModifier.None;
|
||||||
else
|
else
|
||||||
Mod = mALT | mSHIFT | mCTRL;
|
Mod = mALT | mSHIFT | mCTRL;
|
||||||
}
|
}
|
||||||
@@ -65,6 +75,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public struct MouseEvent
|
public struct MouseEvent
|
||||||
{
|
{
|
||||||
|
public ESender Sender;
|
||||||
public int X;
|
public int X;
|
||||||
public int Y;
|
public int Y;
|
||||||
public bool LB; //left button click
|
public bool LB; //left button click
|
||||||
@@ -80,11 +91,12 @@ namespace Vocaluxe.Base
|
|||||||
public bool ModSHIFT;
|
public bool ModSHIFT;
|
||||||
public bool ModCTRL;
|
public bool ModCTRL;
|
||||||
|
|
||||||
public Modifier Mod;
|
public EModifier Mod;
|
||||||
public int Wheel;
|
public int Wheel;
|
||||||
|
|
||||||
public MouseEvent(bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh)
|
public MouseEvent(ESender sender, bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh)
|
||||||
{
|
{
|
||||||
|
Sender = sender;
|
||||||
X = x;
|
X = x;
|
||||||
Y = y;
|
Y = y;
|
||||||
LB = lb;
|
LB = lb;
|
||||||
@@ -100,21 +112,21 @@ namespace Vocaluxe.Base
|
|||||||
ModSHIFT = shift;
|
ModSHIFT = shift;
|
||||||
ModCTRL = ctrl;
|
ModCTRL = ctrl;
|
||||||
|
|
||||||
Modifier mALT = Modifier.None;
|
EModifier mALT = EModifier.None;
|
||||||
Modifier mSHIFT = Modifier.None;
|
EModifier mSHIFT = EModifier.None;
|
||||||
Modifier mCTRL = Modifier.None;
|
EModifier mCTRL = EModifier.None;
|
||||||
|
|
||||||
if (alt)
|
if (alt)
|
||||||
mALT = Modifier.Alt;
|
mALT = EModifier.Alt;
|
||||||
|
|
||||||
if (shift)
|
if (shift)
|
||||||
mSHIFT = Modifier.Shift;
|
mSHIFT = EModifier.Shift;
|
||||||
|
|
||||||
if (ctrl)
|
if (ctrl)
|
||||||
mCTRL = Modifier.Ctrl;
|
mCTRL = EModifier.Ctrl;
|
||||||
|
|
||||||
if (!alt && !shift && !ctrl)
|
if (!alt && !shift && !ctrl)
|
||||||
Mod = Modifier.None;
|
Mod = EModifier.None;
|
||||||
else
|
else
|
||||||
Mod = mALT | mSHIFT | mCTRL;
|
Mod = mALT | mSHIFT | mCTRL;
|
||||||
|
|
||||||
@@ -223,7 +235,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
if (!_timer.IsRunning || (_timer.ElapsedMilliseconds > 75) || !KeyRepeat)
|
if (!_timer.IsRunning || (_timer.ElapsedMilliseconds > 75) || !KeyRepeat)
|
||||||
{
|
{
|
||||||
KeyEvent pool = new KeyEvent(alt, shift, ctrl, pressed && (unicode != Char.MinValue), unicode, key);
|
KeyEvent pool = new KeyEvent(ESender.Keyboard, alt, shift, ctrl, pressed && (unicode != Char.MinValue), unicode, key);
|
||||||
|
|
||||||
lock (_CopyLock)
|
lock (_CopyLock)
|
||||||
{
|
{
|
||||||
@@ -360,7 +372,7 @@ namespace Vocaluxe.Base
|
|||||||
x = (int)((float)x * (float)CSettings.iRenderW / (float)CDraw.GetScreenWidth());
|
x = (int)((float)x * (float)CSettings.iRenderW / (float)CDraw.GetScreenWidth());
|
||||||
y = (int)((float)y * (float)CSettings.iRenderH / (float)CDraw.GetScreenHeight());
|
y = (int)((float)y * (float)CSettings.iRenderH / (float)CDraw.GetScreenHeight());
|
||||||
|
|
||||||
MouseEvent pool = new MouseEvent(alt, shift, ctrl, x, y, lb, ld, rb, -wheel / 120, lbh, rbh, mb, mbh);
|
MouseEvent pool = new MouseEvent(ESender.Mouse, alt, shift, ctrl, x, y, lb, ld, rb, -wheel / 120, lbh, rbh, mb, mbh);
|
||||||
|
|
||||||
lock (_CopyLock)
|
lock (_CopyLock)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,6 +63,20 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct SPoint3f
|
||||||
|
{
|
||||||
|
public float X;
|
||||||
|
public float Y;
|
||||||
|
public float Z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct SPoint3
|
||||||
|
{
|
||||||
|
public int X;
|
||||||
|
public int Y;
|
||||||
|
public int Z;
|
||||||
|
}
|
||||||
|
|
||||||
public struct STexture
|
public struct STexture
|
||||||
{
|
{
|
||||||
public int index;
|
public int index;
|
||||||
|
|||||||
@@ -331,6 +331,7 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
CSound.Update();
|
CSound.Update();
|
||||||
CBackgroundMusic.Update();
|
CBackgroundMusic.Update();
|
||||||
|
CInput.Update();
|
||||||
|
|
||||||
if (CConfig.CoverLoading == ECoverLoading.TR_CONFIG_COVERLOADING_DYNAMIC && _CurrentScreen != EScreens.ScreenSing)
|
if (CConfig.CoverLoading == ECoverLoading.TR_CONFIG_COVERLOADING_DYNAMIC && _CurrentScreen != EScreens.ScreenSing)
|
||||||
CSongs.LoadCover(30L, 1);
|
CSongs.LoadCover(30L, 1);
|
||||||
@@ -450,13 +451,21 @@ namespace Vocaluxe.Menu
|
|||||||
{
|
{
|
||||||
KeyEvent KeyEvent = new KeyEvent();
|
KeyEvent KeyEvent = new KeyEvent();
|
||||||
MouseEvent MouseEvent = new MouseEvent();
|
MouseEvent MouseEvent = new MouseEvent();
|
||||||
|
KeyEvent InputKeyEvent = new KeyEvent();
|
||||||
|
MouseEvent InputMouseEvent = new MouseEvent();
|
||||||
|
|
||||||
bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing &&
|
bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing &&
|
||||||
_CurrentScreen != EScreens.ScreenSong && _CurrentScreen != EScreens.ScreenCredits;
|
_CurrentScreen != EScreens.ScreenSong && _CurrentScreen != EScreens.ScreenCredits;
|
||||||
|
|
||||||
bool Resume = true;
|
bool Resume = true;
|
||||||
while (keys.PollEvent(ref KeyEvent))
|
bool EventsAvailable = false;
|
||||||
|
bool InputEventsAvailable = CInput.PollKeyEvent(ref InputKeyEvent);
|
||||||
|
|
||||||
|
while ((EventsAvailable = keys.PollEvent(ref KeyEvent)) || InputEventsAvailable)
|
||||||
{
|
{
|
||||||
|
if (!EventsAvailable)
|
||||||
|
KeyEvent = InputKeyEvent;
|
||||||
|
|
||||||
if (KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down)
|
if (KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down)
|
||||||
{
|
{
|
||||||
CSettings.MouseInactive();
|
CSettings.MouseInactive();
|
||||||
@@ -495,10 +504,18 @@ namespace Vocaluxe.Menu
|
|||||||
Resume &= _Screens[(int)_CurrentScreen].HandleInput(KeyEvent);
|
Resume &= _Screens[(int)_CurrentScreen].HandleInput(KeyEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!EventsAvailable)
|
||||||
|
InputEventsAvailable = CInput.PollKeyEvent(ref InputKeyEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (Mouse.PollEvent(ref MouseEvent))
|
InputEventsAvailable = CInput.PollMouseEvent(ref InputMouseEvent);
|
||||||
|
|
||||||
|
while ((EventsAvailable = Mouse.PollEvent(ref MouseEvent)) || InputEventsAvailable)
|
||||||
{
|
{
|
||||||
|
if (!EventsAvailable)
|
||||||
|
MouseEvent = InputMouseEvent;
|
||||||
|
|
||||||
if (MouseEvent.Wheel != 0)
|
if (MouseEvent.Wheel != 0)
|
||||||
{
|
{
|
||||||
CSettings.MouseActive();
|
CSettings.MouseActive();
|
||||||
@@ -522,7 +539,10 @@ namespace Vocaluxe.Menu
|
|||||||
handled = _PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
|
handled = _PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
|
||||||
|
|
||||||
if (!handled && !_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB || MouseEvent.MB))
|
if (!handled && !_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB || MouseEvent.MB))
|
||||||
Resume &= _Screens[(int)_CurrentScreen].HandleMouse(MouseEvent);
|
Resume &= _Screens[(int)_CurrentScreen].HandleMouse(MouseEvent);
|
||||||
|
|
||||||
|
if (!EventsAvailable)
|
||||||
|
InputEventsAvailable = CInput.PollMouseEvent(ref InputMouseEvent);
|
||||||
}
|
}
|
||||||
return Resume;
|
return Resume;
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-18
@@ -877,7 +877,7 @@ namespace Vocaluxe.Menu
|
|||||||
{
|
{
|
||||||
if (KeyEvent.Key == Keys.Left)
|
if (KeyEvent.Key == Keys.Left)
|
||||||
{
|
{
|
||||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift)
|
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != EModifier.Shift)
|
||||||
KeyEvent.Handled = PrevElement();
|
KeyEvent.Handled = PrevElement();
|
||||||
else
|
else
|
||||||
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
||||||
@@ -885,7 +885,7 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
if (KeyEvent.Key == Keys.Right)
|
if (KeyEvent.Key == Keys.Right)
|
||||||
{
|
{
|
||||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift)
|
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != EModifier.Shift)
|
||||||
KeyEvent.Handled = NextElement();
|
KeyEvent.Handled = NextElement();
|
||||||
else
|
else
|
||||||
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
||||||
@@ -900,7 +900,7 @@ namespace Vocaluxe.Menu
|
|||||||
{
|
{
|
||||||
if (KeyEvent.Key == Keys.Tab)
|
if (KeyEvent.Key == Keys.Tab)
|
||||||
{
|
{
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
PrevInteraction();
|
PrevInteraction();
|
||||||
else
|
else
|
||||||
NextInteraction();
|
NextInteraction();
|
||||||
@@ -955,40 +955,40 @@ namespace Vocaluxe.Menu
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Up:
|
case Keys.Up:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(0, -1);
|
MoveElement(0, -1);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(0, 1);
|
ResizeElement(0, 1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Keys.Down:
|
case Keys.Down:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(0, 1);
|
MoveElement(0, 1);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(0, -1);
|
ResizeElement(0, -1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Right:
|
case Keys.Right:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(1, 0);
|
MoveElement(1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(1, 0);
|
ResizeElement(1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.None)
|
if (KeyEvent.Mod == EModifier.None)
|
||||||
NextInteraction();
|
NextInteraction();
|
||||||
break;
|
break;
|
||||||
case Keys.Left:
|
case Keys.Left:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(-1, 0);
|
MoveElement(-1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(-1, 0);
|
ResizeElement(-1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.None)
|
if (KeyEvent.Mod == EModifier.None)
|
||||||
PrevInteraction();
|
PrevInteraction();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1005,7 +1005,7 @@ namespace Vocaluxe.Menu
|
|||||||
int stepX = 0;
|
int stepX = 0;
|
||||||
int stepY = 0;
|
int stepY = 0;
|
||||||
|
|
||||||
if ((MouseEvent.Mod & Modifier.Ctrl) == Modifier.Ctrl)
|
if ((MouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||||
{
|
{
|
||||||
_PrevMouseX = MouseEvent.X;
|
_PrevMouseX = MouseEvent.X;
|
||||||
_PrevMouseY = MouseEvent.Y;
|
_PrevMouseY = MouseEvent.Y;
|
||||||
@@ -1039,16 +1039,16 @@ namespace Vocaluxe.Menu
|
|||||||
{
|
{
|
||||||
//if (IsMouseOver(MouseEvent.X, _PrevMouseY))
|
//if (IsMouseOver(MouseEvent.X, _PrevMouseY))
|
||||||
//{
|
//{
|
||||||
if (MouseEvent.Mod == Modifier.None)
|
if (MouseEvent.Mod == EModifier.None)
|
||||||
MoveElement(stepX, stepY);
|
MoveElement(stepX, stepY);
|
||||||
|
|
||||||
if (MouseEvent.Mod == Modifier.Ctrl)
|
if (MouseEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(_MouseDX, _MouseDY);
|
MoveElement(_MouseDX, _MouseDY);
|
||||||
|
|
||||||
if (MouseEvent.Mod == Modifier.Shift)
|
if (MouseEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(stepX, stepY);
|
ResizeElement(stepX, stepY);
|
||||||
|
|
||||||
if (MouseEvent.Mod == (Modifier.Shift | Modifier.Ctrl))
|
if (MouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||||
ResizeElement(_MouseDX, _MouseDY);
|
ResizeElement(_MouseDX, _MouseDY);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ namespace Vocaluxe.Menu
|
|||||||
{
|
{
|
||||||
if (KeyEvent.Key == Keys.Left)
|
if (KeyEvent.Key == Keys.Left)
|
||||||
{
|
{
|
||||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift)
|
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != EModifier.Shift)
|
||||||
KeyEvent.Handled = PrevElement();
|
KeyEvent.Handled = PrevElement();
|
||||||
else
|
else
|
||||||
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
||||||
@@ -131,7 +131,7 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
if (KeyEvent.Key == Keys.Right)
|
if (KeyEvent.Key == Keys.Right)
|
||||||
{
|
{
|
||||||
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift)
|
if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != EModifier.Shift)
|
||||||
KeyEvent.Handled = NextElement();
|
KeyEvent.Handled = NextElement();
|
||||||
else
|
else
|
||||||
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
KeyEvent.Handled = _NextInteraction(KeyEvent);
|
||||||
@@ -146,7 +146,7 @@ namespace Vocaluxe.Menu
|
|||||||
{
|
{
|
||||||
if (KeyEvent.Key == Keys.Tab)
|
if (KeyEvent.Key == Keys.Tab)
|
||||||
{
|
{
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
PrevInteraction();
|
PrevInteraction();
|
||||||
else
|
else
|
||||||
NextInteraction();
|
NextInteraction();
|
||||||
@@ -197,40 +197,40 @@ namespace Vocaluxe.Menu
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Up:
|
case Keys.Up:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(0, -1);
|
MoveElement(0, -1);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(0, 1);
|
ResizeElement(0, 1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Keys.Down:
|
case Keys.Down:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(0, 1);
|
MoveElement(0, 1);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(0, -1);
|
ResizeElement(0, -1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Right:
|
case Keys.Right:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(1, 0);
|
MoveElement(1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(1, 0);
|
ResizeElement(1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.None)
|
if (KeyEvent.Mod == EModifier.None)
|
||||||
NextInteraction();
|
NextInteraction();
|
||||||
break;
|
break;
|
||||||
case Keys.Left:
|
case Keys.Left:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(-1, 0);
|
MoveElement(-1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.Shift)
|
if (KeyEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(-1, 0);
|
ResizeElement(-1, 0);
|
||||||
|
|
||||||
if (KeyEvent.Mod == Modifier.None)
|
if (KeyEvent.Mod == EModifier.None)
|
||||||
PrevInteraction();
|
PrevInteraction();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ namespace Vocaluxe.Menu
|
|||||||
int stepX = 0;
|
int stepX = 0;
|
||||||
int stepY = 0;
|
int stepY = 0;
|
||||||
|
|
||||||
if ((MouseEvent.Mod & Modifier.Ctrl) == Modifier.Ctrl)
|
if ((MouseEvent.Mod & EModifier.Ctrl) == EModifier.Ctrl)
|
||||||
{
|
{
|
||||||
_PrevMouseX = MouseEvent.X;
|
_PrevMouseX = MouseEvent.X;
|
||||||
_PrevMouseY = MouseEvent.Y;
|
_PrevMouseY = MouseEvent.Y;
|
||||||
@@ -281,16 +281,16 @@ namespace Vocaluxe.Menu
|
|||||||
{
|
{
|
||||||
//if (IsMouseOver(MouseEvent.X, _PrevMouseY))
|
//if (IsMouseOver(MouseEvent.X, _PrevMouseY))
|
||||||
//{
|
//{
|
||||||
if (MouseEvent.Mod == Modifier.None)
|
if (MouseEvent.Mod == EModifier.None)
|
||||||
MoveElement(stepX, stepY);
|
MoveElement(stepX, stepY);
|
||||||
|
|
||||||
if (MouseEvent.Mod == Modifier.Ctrl)
|
if (MouseEvent.Mod == EModifier.Ctrl)
|
||||||
MoveElement(_MouseDX, _MouseDY);
|
MoveElement(_MouseDX, _MouseDY);
|
||||||
|
|
||||||
if (MouseEvent.Mod == Modifier.Shift)
|
if (MouseEvent.Mod == EModifier.Shift)
|
||||||
ResizeElement(stepX, stepY);
|
ResizeElement(stepX, stepY);
|
||||||
|
|
||||||
if (MouseEvent.Mod == (Modifier.Shift | Modifier.Ctrl))
|
if (MouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl))
|
||||||
ResizeElement(_MouseDX, _MouseDY);
|
ResizeElement(_MouseDX, _MouseDY);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,6 +142,11 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
if (!value)
|
if (!value)
|
||||||
{
|
{
|
||||||
|
if (_EditMode == EEditMode.ChangeOrder && ChangeOrderSource != -1 && PlaylistElements.Count > ChangeOrderSource)
|
||||||
|
{
|
||||||
|
CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[ChangeOrderSource].Content);
|
||||||
|
UpdatePlaylist();
|
||||||
|
}
|
||||||
ChangeOrderSource = -1;
|
ChangeOrderSource = -1;
|
||||||
_EditMode = EEditMode.None;
|
_EditMode = EEditMode.None;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
class CSongMenuDreidel : CSongMenuFramework
|
class CSongMenuDreidel : CSongMenuFramework
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
private SRectF _ScrollRect;
|
private SRectF _ScrollRect;
|
||||||
private CStatic _CoverBig;
|
private CStatic _CoverBig;
|
||||||
private CStatic _TextBG;
|
private CStatic _TextBG;
|
||||||
@@ -29,7 +30,7 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
return _actualSelection;
|
return _actualSelection;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
bool sel = false;
|
bool sel = false;
|
||||||
|
int lastselection = _actualSelection;
|
||||||
foreach (CStatic tile in _Tiles)
|
foreach (CStatic tile in _Tiles)
|
||||||
{
|
{
|
||||||
if ((tile.Texture.index != _CoverTexture.index) && CHelper.IsInBounds(tile.Rect, MouseEvent) && !sel)
|
if ((tile.Texture.index != _CoverTexture.index) && CHelper.IsInBounds(tile.Rect, MouseEvent) && !sel)
|
||||||
@@ -345,6 +346,9 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MouseEvent.Sender == ESender.WiiMote && _actualSelection != lastselection && _actualSelection != -1)
|
||||||
|
CInput.SetRumble(0.050f);
|
||||||
|
|
||||||
if (!sel)
|
if (!sel)
|
||||||
_actualSelection = -1;
|
_actualSelection = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,11 @@ namespace Vocaluxe
|
|||||||
|
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
|
|
||||||
|
// Init Input
|
||||||
|
CLog.StartBenchmark(0, "Init Input");
|
||||||
|
CInput.Init();
|
||||||
|
CLog.StopBenchmark(0, "Init Input");
|
||||||
|
|
||||||
// Init Game;
|
// Init Game;
|
||||||
CLog.StartBenchmark(0, "Init Game");
|
CLog.StartBenchmark(0, "Init Game");
|
||||||
CGame.Init();
|
CGame.Init();
|
||||||
@@ -173,6 +178,7 @@ namespace Vocaluxe
|
|||||||
// Unloading
|
// Unloading
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
CInput.Close();
|
||||||
CSound.RecordCloseAll();
|
CSound.RecordCloseAll();
|
||||||
CSound.CloseAllStreams();
|
CSound.CloseAllStreams();
|
||||||
CVideo.VdCloseAll();
|
CVideo.VdCloseAll();
|
||||||
|
|||||||
@@ -206,11 +206,11 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
//TODO: Delete it! ??? Shouldn't we keep this as shortcut?
|
//TODO: Delete it! ??? Shouldn't we keep this as shortcut?
|
||||||
case Keys.A:
|
case Keys.A:
|
||||||
if (!_SearchActive && KeyEvent.Mod == Modifier.None)
|
if (!_SearchActive && KeyEvent.Mod == EModifier.None)
|
||||||
{
|
{
|
||||||
StartRandomAllSongs();
|
StartRandomAllSongs();
|
||||||
}
|
}
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
{
|
{
|
||||||
StartRandomVisibleSongs();
|
StartRandomVisibleSongs();
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
//TODO: Delete that from here and from wiki!
|
//TODO: Delete that from here and from wiki!
|
||||||
case Keys.F:
|
case Keys.F:
|
||||||
if (KeyEvent.Mod == Modifier.Ctrl)
|
if (KeyEvent.Mod == EModifier.Ctrl)
|
||||||
{
|
{
|
||||||
if (_SearchActive)
|
if (_SearchActive)
|
||||||
{
|
{
|
||||||
@@ -235,11 +235,11 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
//TODO: We need another key for random!
|
//TODO: We need another key for random!
|
||||||
case Keys.R:
|
case Keys.R:
|
||||||
if (!_SearchActive && CSongs.Category != -1 && KeyEvent.Mod == Modifier.Ctrl)
|
if (!_SearchActive && CSongs.Category != -1 && KeyEvent.Mod == EModifier.Ctrl)
|
||||||
{
|
{
|
||||||
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
|
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
|
||||||
}
|
}
|
||||||
else if (CSongs.Category == -1 && KeyEvent.Mod == Modifier.Ctrl)
|
else if (CSongs.Category == -1 && KeyEvent.Mod == EModifier.Ctrl)
|
||||||
{
|
{
|
||||||
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
|
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,6 @@
|
|||||||
<Reference Include="OpenTK.GLControl">
|
<Reference Include="OpenTK.GLControl">
|
||||||
<HintPath>..\Output\OpenTK.GLControl.dll</HintPath>
|
<HintPath>..\Output\OpenTK.GLControl.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Mono.Data.Sqlite" />
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@@ -167,6 +166,7 @@
|
|||||||
<Compile Include="Base\CDraw.cs" />
|
<Compile Include="Base\CDraw.cs" />
|
||||||
<Compile Include="Base\CFont.cs" />
|
<Compile Include="Base\CFont.cs" />
|
||||||
<Compile Include="Base\CGame.cs" />
|
<Compile Include="Base\CGame.cs" />
|
||||||
|
<Compile Include="Base\CInput.cs" />
|
||||||
<Compile Include="Base\CLanguage.cs" />
|
<Compile Include="Base\CLanguage.cs" />
|
||||||
<Compile Include="Base\CLog.cs" />
|
<Compile Include="Base\CLog.cs" />
|
||||||
<Compile Include="Base\CPlaylists.cs" />
|
<Compile Include="Base\CPlaylists.cs" />
|
||||||
@@ -189,6 +189,10 @@
|
|||||||
<Compile Include="Lib\Draw\COpenGL.cs">
|
<Compile Include="Lib\Draw\COpenGL.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Lib\Input\CHIDAPI.cs" />
|
||||||
|
<Compile Include="Lib\Input\IInput.cs" />
|
||||||
|
<Compile Include="Lib\Input\WiiMote\CWiiMote.cs" />
|
||||||
|
<Compile Include="Lib\Input\WiiMote\WiiMoteLib.cs" />
|
||||||
<Compile Include="Lib\Playlist\CPlaylistFile.cs" />
|
<Compile Include="Lib\Playlist\CPlaylistFile.cs" />
|
||||||
<Compile Include="Lib\Song\CNotes.cs" />
|
<Compile Include="Lib\Song\CNotes.cs" />
|
||||||
<Compile Include="Lib\Song\CSong.cs" />
|
<Compile Include="Lib\Song\CSong.cs" />
|
||||||
|
|||||||
Reference in new issue
Block a user