activating and deactivating popup player control by mouse
This commit is contained in:
1 parent
917c81a6ae
commit
82fd878975
3 files changed
+29
-3
No files matched your search
@@ -443,6 +443,9 @@ namespace Vocaluxe.Menu
|
|||||||
KeyEvent KeyEvent = new KeyEvent();
|
KeyEvent KeyEvent = new KeyEvent();
|
||||||
MouseEvent MouseEvent = new MouseEvent();
|
MouseEvent MouseEvent = new MouseEvent();
|
||||||
|
|
||||||
|
bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && _CurrentScreen != EScreens.ScreenNames
|
||||||
|
&& _CurrentScreen != EScreens.ScreenSong;
|
||||||
|
|
||||||
bool Resume = true;
|
bool Resume = true;
|
||||||
while (keys.PollEvent(ref KeyEvent))
|
while (keys.PollEvent(ref KeyEvent))
|
||||||
{
|
{
|
||||||
@@ -452,9 +455,7 @@ namespace Vocaluxe.Menu
|
|||||||
_Cursor.FadeOut();
|
_Cursor.FadeOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && _CurrentScreen != EScreens.ScreenNames
|
if (PopupPlayerControlAllowed && KeyEvent.Key == Keys.Tab)
|
||||||
&& _CurrentScreen != EScreens.ScreenSong &&
|
|
||||||
KeyEvent.Key == Keys.Tab)
|
|
||||||
{
|
{
|
||||||
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
|
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
|
||||||
ShowPopup(EPopupScreens.PopupPlayerControl);
|
ShowPopup(EPopupScreens.PopupPlayerControl);
|
||||||
@@ -498,6 +499,16 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
|
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
|
||||||
|
|
||||||
|
bool isOverPopupPlayerControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupPlayerControl].ScreenArea, MouseEvent);
|
||||||
|
if (PopupPlayerControlAllowed && isOverPopupPlayerControl)
|
||||||
|
{
|
||||||
|
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
|
||||||
|
ShowPopup(EPopupScreens.PopupPlayerControl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isOverPopupPlayerControl && _CurrentPopupScreen == EPopupScreens.PopupPlayerControl)
|
||||||
|
HidePopup(EPopupScreens.PopupPlayerControl);
|
||||||
|
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
|
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
|
||||||
handled = !_PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
|
handled = !_PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
|
||||||
|
|||||||
@@ -59,6 +59,13 @@ namespace Vocaluxe.Menu
|
|||||||
protected string[] _ThemeSelectSlides;
|
protected string[] _ThemeSelectSlides;
|
||||||
protected string[] _ThemeSingNotes;
|
protected string[] _ThemeSingNotes;
|
||||||
|
|
||||||
|
protected SRectF _ScreenArea;
|
||||||
|
|
||||||
|
public SRectF ScreenArea
|
||||||
|
{
|
||||||
|
get { return _ScreenArea; }
|
||||||
|
}
|
||||||
|
|
||||||
public int ThemeScreenVersion
|
public int ThemeScreenVersion
|
||||||
{
|
{
|
||||||
get { return _ScreenVersion; }
|
get { return _ScreenVersion; }
|
||||||
@@ -99,6 +106,7 @@ namespace Vocaluxe.Menu
|
|||||||
_MouseDY = 0;
|
_MouseDY = 0;
|
||||||
|
|
||||||
_Active = false;
|
_Active = false;
|
||||||
|
_ScreenArea = new SRectF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH, 0f);
|
||||||
|
|
||||||
_ThemeName = String.Empty;
|
_ThemeName = String.Empty;
|
||||||
_ThemeBackgrounds = null;
|
_ThemeBackgrounds = null;
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ namespace Vocaluxe.Screens
|
|||||||
_ThemeButtons = buttons.ToArray();
|
_ThemeButtons = buttons.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void LoadTheme()
|
||||||
|
{
|
||||||
|
base.LoadTheme();
|
||||||
|
|
||||||
|
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
|
||||||
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))
|
if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))
|
||||||
|
|||||||
Reference in new issue
Block a user