Fixed double-click-bug on screen-song.
This commit is contained in:
1 parent
81a9486091
commit
6bdfb49cbb
5 files changed
+19
-3
No files matched your search
@@ -449,9 +449,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
if (mouseEvent.LD && !_Sso.Selection.PartyMode)
|
||||
{
|
||||
//TODO: Causes Bug if you select a song (e.g. with Select random song) and double click a normal button.
|
||||
//E.g. clicking to fast on Select random song starts the next random song. is this OK?
|
||||
if (CSongs.NumSongsVisible > 0 && _SongMenus[_SongMenu].GetActualSelection() != -1)
|
||||
if (CSongs.NumSongsVisible > 0 && _SongMenus[_SongMenu].GetActualSelection() != -1 && _SongMenus[_SongMenu].IsMouseOverActualSelection(mouseEvent))
|
||||
{
|
||||
_ToggleSongOptions(ESongOptionsView.None);
|
||||
_StartVisibleSong(_SongMenus[_SongMenu].GetActualSelection());
|
||||
|
||||
@@ -98,6 +98,11 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_SongMenu.SetActive(active);
|
||||
}
|
||||
|
||||
public bool IsMouseOverActualSelection(SMouseEvent mEvent)
|
||||
{
|
||||
return _SongMenu.IsMouseOverActualSelection(mEvent);
|
||||
}
|
||||
|
||||
public int GetSelectedSong()
|
||||
{
|
||||
return _SongMenu.GetSelectedSong();
|
||||
|
||||
@@ -518,6 +518,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
_Active = active;
|
||||
}
|
||||
|
||||
public virtual bool IsMouseOverActualSelection(SMouseEvent mEvent) { return false; }
|
||||
|
||||
public virtual int GetSelectedSong()
|
||||
{
|
||||
return -1;
|
||||
|
||||
@@ -485,6 +485,15 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return _Locked;
|
||||
}
|
||||
|
||||
public override bool IsMouseOverActualSelection(SMouseEvent mEvent)
|
||||
{
|
||||
CStatic selCov = GetSelectedSongCover();
|
||||
if (selCov.Texture == null)
|
||||
return false;
|
||||
SRectF rect = new SRectF(selCov.Rect.X - selCov.Rect.W*0.2f, selCov.Rect.Y - selCov.Rect.H*0.2f, selCov.Rect.W*1.2f, selCov.Rect.H*1.2f, selCov.Rect.Z);
|
||||
return CHelper.IsInBounds(rect, mEvent);
|
||||
}
|
||||
|
||||
public override CStatic GetSelectedSongCover()
|
||||
{
|
||||
foreach (CStatic tile in _Tiles)
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
bool IsActive();
|
||||
void SetActive(bool active);
|
||||
|
||||
bool IsMouseOverActualSelection(SMouseEvent mEvent);
|
||||
|
||||
int GetSelectedCategory();
|
||||
void SetSelectedCategory(int categoryNr);
|
||||
int GetActualSelection();
|
||||
|
||||
Reference in new issue
Block a user