SongMenu refactoring

New Shortcuts
Readme update
This commit is contained in:
Flamefire committed 2013-02-26 21:12:32 +01:00
1 parent 835af557d2
commit 30841c5758
4 files changed
+314 -437

No files matched your search

+19 -17
View File
@@ -109,39 +109,41 @@ Vocaluxe.exe -ConfigFile MyConfig.xml -ScoreFile C:\Vocaluxe\Highscores\MyHighsc
================================= =================================
= 4. Controls = = 4. Controls =
================================= =================================
[Mouse] to navigate through the screens: Left button: select/manipulate elements, [Mouse] to navigate through the screens: Left button: select/manipulate elements,
Right button: go to previous screen. Right button: go to previous screen.
[Cursor] to navigate through the screens. [Cursor] to navigate through the screens.
[Enter] to confirm [Enter] to confirm
[Escape] or [Back] to go to the previous screen. [Escape] or [Back] to go to the previous screen.
[ALT] + [P] to take a ScreenShot. Screenshots are saved in the directory "Screenshots". [ALT] + [P] to take a ScreenShot. Screenshots are saved in the directory "Screenshots".
[ALT] + [ENTER] to toggle full screen mode. [ALT] + [ENTER] to toggle full screen mode.
[SHIFT] + [F1] to toggle theme edit mode. The theme edit mode is experimental. It allows you [SHIFT] + [F1] to toggle theme edit mode. The theme edit mode is experimental. It allows you
to change the size and position of the element on the screens. You can save to change the size and position of the element on the screens. You can save
your changes with [S] before leaving the theme edit mode. your changes with [S] before leaving the theme edit mode.
[TAB] to open the background music controls (not on all screens). [TAB] to open the background music controls (not on all screens).
[SHIFT] + [+] to increase volume [SHIFT] + [+] to increase volume
[SHIFT] + [-] to decrease volume [SHIFT] + [-] to decrease volume
Song screen Song screen
[F3] to open/close the song search menu
[SPACE] to open/close the song menu
[CTRL] + [R] to select a random song [CTRL] + [R] to select a random song
[F3] to open/close the song search menu [CTRL] + [A] to sing all songs
[A] to sing all songs [CTRL] + [V] to sing all songs from a category
[SHIFT] + [A] to sing all songs from a category [NUM_1]..[NUM_6] to use a Joker for team 1..6
[SPACE] to open/close the song menu [A]..[Z] to jump to category/song title starting with that letter
Name selection screen Name selection screen
[1]..[6] to activate player selection. [1]..[6] to activate player selection.
[Cursor] to select a profile. [Cursor] to select a profile.
[Enter] to confirm a selection. [Enter] to confirm a selection.
Sing screen Sing screen
[P] to toggle pause. [P] to toggle pause.
[CTRL] + [S] to skip a song if there is another one in the playlist. [CTRL] + [S] to skip a song if there is another one in the playlist.
[T] to change the time format of the timer. [T] to change the time format of the timer.
[I] to change view of player information. [I] to change view of player information.
[W] to activate the configured webcam. [W] to activate the configured webcam.
================================= =================================
+180 -183
View File
@@ -187,12 +187,11 @@ namespace Vocaluxe.Screens
{ {
if (_SearchActive) if (_SearchActive)
ApplyNewSearchFilter(_SearchText + KeyEvent.Unicode); ApplyNewSearchFilter(_SearchText + KeyEvent.Unicode);
/* else
else if (!Char.IsControl(KeyEvent.Unicode))
{ {
JumpTo(KeyEvent.Unicode); JumpTo(KeyEvent.Unicode);
return true; return true;
} */ }
} }
else else
{ {
@@ -254,7 +253,7 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Back: case Keys.Back:
if (_SearchText.Length > 0) if (_SearchActive && _SearchText.Length > 0)
{ {
ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1)); ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1));
} }
@@ -266,11 +265,6 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Space:
if (!_SearchActive && !_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.General);
break;
case Keys.F3: case Keys.F3:
if (_SearchActive) if (_SearchActive)
{ {
@@ -279,78 +273,60 @@ namespace Vocaluxe.Screens
ApplyNewSearchFilter(_SearchText); ApplyNewSearchFilter(_SearchText);
} }
else if (!_sso.Selection.PartyMode) else if (!_sso.Selection.PartyMode)
{
_SearchActive = true; _SearchActive = true;
}
break; break;
}
if(!_SearchActive){
switch (KeyEvent.Key)
{
case Keys.Space:
if (!_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.General);
break;
//TODO: Delete it! ??? Shouldn't we keep this as shortcut? case Keys.A:
case Keys.A: if (KeyEvent.Mod == EModifier.Ctrl && !_sso.Selection.PartyMode)
if (!_SearchActive && KeyEvent.Mod == EModifier.None && !_sso.Selection.PartyMode) StartRandomAllSongs();
{ break;
StartRandomAllSongs(); case Keys.V:
} if (KeyEvent.Mod == EModifier.Ctrl && !_sso.Selection.PartyMode)
if (KeyEvent.Mod == EModifier.Ctrl && !_sso.Selection.PartyMode) StartRandomVisibleSongs();
{ break;
StartRandomVisibleSongs();
}
break;
//TODO: Delete that from here and from wiki! case Keys.R:
case Keys.F: if (KeyEvent.Mod == EModifier.Ctrl && !_sso.Selection.RandomOnly)
if (KeyEvent.Mod == EModifier.Ctrl) SelectNextRandom(-1);
{ break;
if (_SearchActive)
{
_SearchActive = false;
_SearchText = String.Empty;
ApplyNewSearchFilter(_SearchText);
}
else if (!_sso.Selection.PartyMode)
{
_SearchActive = true;
}
}
break;
//TODO: We need another key for random! case Keys.S:
case Keys.R: if (KeyEvent.Mod == EModifier.Ctrl && CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode)
if (KeyEvent.Mod == EModifier.Ctrl && !_sso.Selection.RandomOnly) StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
SelectNextRandom(-1); break;
break;
//TODO: Delete that! case Keys.D1:
case Keys.S: SelectNextRandom(0);
if (!_SearchActive && CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode) break;
{
StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
}
break;
case Keys.D1: case Keys.D2:
SelectNextRandom(0); SelectNextRandom(1);
break; break;
case Keys.D2: case Keys.D3:
SelectNextRandom(1); SelectNextRandom(2);
break; break;
case Keys.D3: case Keys.D4:
SelectNextRandom(2); SelectNextRandom(3);
break; break;
case Keys.D4: case Keys.D5:
SelectNextRandom(3); SelectNextRandom(4);
break; break;
case Keys.D5:
SelectNextRandom(4);
break;
case Keys.D6:
SelectNextRandom(5);
break;
case Keys.D6:
SelectNextRandom(5);
break;
}
} }
} }
} }
@@ -377,16 +353,9 @@ namespace Vocaluxe.Screens
else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) else if (Buttons[htButtons(ButtonOptionsRandom)].Selected)
{ {
if (CSongs.Category != -1) if (CSongs.Category != -1)
{
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
} else
}
else if (Buttons[htButtons(ButtonOptionsRandom)].Selected)
{
if (CSongs.Category == -1)
{
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
}
} }
else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected)
{ {
@@ -1075,19 +1044,39 @@ namespace Vocaluxe.Screens
private void JumpTo(char Letter) private void JumpTo(char Letter)
{ {
int song = SongMenus[htSongMenus(SongMenu)].GetSelectedSong(); int start = 0;
int id = -1; if (CSongs.Category < 0)
if (song > -1 && song < CSongs.NumVisibleSongs)
{ {
id = CSongs.VisibleSongs[song].ID; int curSelected = SongMenus[htSongMenus(SongMenu)].GetSelectedCategory();
CCategory[] Categories = CSongs.Categories;
int ct = Categories.Length;
if (curSelected >= 0 && curSelected < ct - 1 && Categories[curSelected].Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase))
start = curSelected + 1;
int visibleID = Array.FindIndex<CCategory>(Categories, start, ct - start, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID < 0 && start > 1)
visibleID = Array.FindIndex<CCategory>(Categories, 0, start - 1, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(visibleID);
}
else
{
//TODO: Check and use sorting method
int curSelected = SongMenus[htSongMenus(SongMenu)].GetSelectedSong();
CSong[] Songs = CSongs.VisibleSongs;
int ct = Songs.Length;
if (curSelected >= 0 && curSelected < ct - 1)
{
CSong CurrentSong = CSongs.GetVisibleSongByIndex(curSelected);
if (CurrentSong != null && CurrentSong.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase))
start = curSelected + 1;
}
int visibleID = Array.FindIndex<CSong>(Songs, start, ct - start, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if(visibleID < 0 && start > 1)
visibleID = Array.FindIndex<CSong>(Songs, 0, start - 1, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(visibleID);
} }
int visibleID = Array.FindIndex<CSong>(CSongs.VisibleSongs, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1)
{
id = visibleID;
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(id);
}
} }
private void ApplyNewSearchFilter(string NewFilterString) private void ApplyNewSearchFilter(string NewFilterString)
@@ -1119,7 +1108,7 @@ namespace Vocaluxe.Screens
CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, NewFilterString, _sso.Sorting.ShowDuetSongs); CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, NewFilterString, _sso.Sorting.ShowDuetSongs);
if (SongID == -1 || CSongs.NumVisibleSongs == 0 || CSongs.NumVisibleSongs <= SongIndex || CSongs.VisibleSongs[SongIndex].ID != SongID) if (SongID == -1 || CSongs.NumVisibleSongs == 0 || CSongs.NumVisibleSongs <= SongIndex || CSongs.GetVisibleSongByIndex(SongIndex).ID != SongID)
refresh = true; refresh = true;
if (refresh) if (refresh)
@@ -1130,8 +1119,6 @@ namespace Vocaluxe.Screens
private void ToggleSongOptions(ESongOptionsView view) private void ToggleSongOptions(ESongOptionsView view)
{ {
_SongOptionsActive = view != ESongOptionsView.None;
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false; SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
@@ -1150,107 +1137,117 @@ namespace Vocaluxe.Screens
Statics[htStatics(StaticOptionsBG)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false;
Buttons[htButtons(ButtonOpenOptions)].Visible = true; Buttons[htButtons(ButtonOpenOptions)].Visible = true;
_SongOptionsActive = view != ESongOptionsView.None;
if (_SongOptionsActive) if (_SongOptionsActive)
{ {
if (view == ESongOptionsView.Song)
{
EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL;
if (_AvailableGameModes.Count > 0)
LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection];
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]);
_AvailableGameModes.Clear();
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear();
if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_NORMAL));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_NORMAL);
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_SHORTSONG));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_SHORTSONG);
}
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_DUET));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_DUET);
}
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_MEDLEY));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_MEDLEY);
}
//Set SelectSlide-Selection to last selected game-mode if possible
for (int i = 0; i < _AvailableGameModes.Count; i++)
{
if (_AvailableGameModes[i] == LastMode)
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i);
}
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = true;
Buttons[htButtons(ButtonOptionsSing)].Visible = true;
Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]);
}
else if (view == ESongOptionsView.General)
{
Buttons[htButtons(ButtonOptionsRandom)].Visible = CSongs.Category != -1;
Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = CSongs.Category == -1;
Buttons[htButtons(ButtonOptionsSingAll)].Visible = true;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = CSongs.Category != -1;
if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues > 0)
{
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonOptionsOpenPlaylist)]);
}
else
{
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
if (Buttons[htButtons(ButtonOptionsRandom)].Visible)
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]);
else
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSingAll)]);
}
Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = true;
if(Buttons[htButtons(ButtonOptionsRandom)].Visible)
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]);
else
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandomCategory)]);
}
else if (view == ESongOptionsView.Medley)
{
Buttons[htButtons(ButtonOptionsStartMedley)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Clear();
if (CSongs.Category != -1)
{
for (int i = 1; i <= CSongs.VisibleSongs.Length; i++)
{
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].AddValue(i.ToString());
}
}
else
{
for (int i = 1; i <= CSongs.AllSongs.Length; i++)
{
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].AddValue(i.ToString());
}
}
if (SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].NumValues >= 5)
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(4);
else
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].NumValues - 1);
SetInteractionToButton(Buttons[htButtons(ButtonOptionsStartMedley)]);
}
Texts[htTexts(TextOptionsTitle)].Visible = true; Texts[htTexts(TextOptionsTitle)].Visible = true;
Buttons[htButtons(ButtonOptionsClose)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true;
Statics[htStatics(StaticOptionsBG)].Visible = true; Statics[htStatics(StaticOptionsBG)].Visible = true;
Buttons[htButtons(ButtonOpenOptions)].Visible = false; Buttons[htButtons(ButtonOpenOptions)].Visible = false;
if (view == ESongOptionsView.Song)
_ShowSongOptionsSong();
else if (view == ESongOptionsView.General)
_ShowSongOptionsGeneral();
else if (view == ESongOptionsView.Medley)
_ShowSongOptionsMedley();
} }
} }
private void _ShowSongOptionsSong()
{
EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL;
if (_AvailableGameModes.Count > 0)
LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection];
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]);
_AvailableGameModes.Clear();
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear();
if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_NORMAL));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_NORMAL);
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_SHORTSONG));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_SHORTSONG);
}
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_DUET));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_DUET);
}
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_MEDLEY));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_MEDLEY);
}
//Set SelectSlide-Selection to last selected game-mode if possible
for (int i = 0; i < _AvailableGameModes.Count; i++)
{
if (_AvailableGameModes[i] == LastMode)
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i);
}
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = true;
Buttons[htButtons(ButtonOptionsSing)].Visible = true;
Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]);
}
private void _ShowSongOptionsGeneral()
{
Buttons[htButtons(ButtonOptionsRandom)].Visible = CSongs.Category != -1;
Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = CSongs.Category == -1;
Buttons[htButtons(ButtonOptionsSingAll)].Visible = true;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = CSongs.Category != -1;
if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues > 0)
{
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonOptionsOpenPlaylist)]);
}
else
{
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
if (Buttons[htButtons(ButtonOptionsRandom)].Visible)
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]);
else
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSingAll)]);
}
Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = true;
if (Buttons[htButtons(ButtonOptionsRandom)].Visible)
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]);
else
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandomCategory)]);
}
private void _ShowSongOptionsMedley()
{
Buttons[htButtons(ButtonOptionsStartMedley)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Clear();
if (CSongs.Category != -1)
{
for (int i = 1; i <= CSongs.VisibleSongs.Length; i++)
{
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].AddValue(i.ToString());
}
}
else
{
for (int i = 1; i <= CSongs.AllSongs.Length; i++)
{
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].AddValue(i.ToString());
}
}
if (SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].NumValues >= 5)
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(4);
else
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].NumValues - 1);
SetInteractionToButton(Buttons[htButtons(ButtonOptionsStartMedley)]);
}
#region Playlist Actions #region Playlist Actions
public void CheckPlaylist() public void CheckPlaylist()
{ {
+8 -17
View File
@@ -324,10 +324,10 @@ namespace Vocaluxe.Menu
[Flags] [Flags]
public enum EModifier public enum EModifier
{ {
None, None = 0,
Shift, Shift = 1,
Alt, Alt = 2,
Ctrl Ctrl = 4
} }
public enum ESender public enum ESender
@@ -361,23 +361,14 @@ namespace Vocaluxe.Menu
Key = key; Key = key;
Handled = false; Handled = false;
EModifier mALT = EModifier.None; Mod = EModifier.None;
EModifier mSHIFT = EModifier.None;
EModifier mCTRL = EModifier.None;
if (alt) if (alt)
mALT = EModifier.Alt; Mod |= EModifier.Alt;
if (shift) if (shift)
mSHIFT = EModifier.Shift; Mod |= EModifier.Shift;
if (ctrl) if (ctrl)
mCTRL = EModifier.Ctrl; Mod |= EModifier.Ctrl;
if (!alt && !shift && !ctrl)
Mod = EModifier.None;
else
Mod = mALT | mSHIFT | mCTRL;
} }
} }
+107 -220
View File
@@ -36,7 +36,7 @@ namespace Vocaluxe.Menu.SongMenu
private int _TileW; private int _TileW;
private int _TileH; private int _TileH;
private int _Offset = 0; private int _Offset = -1;
private int _actualSelection = -1; private int _actualSelection = -1;
private bool _SmallView = false; private bool _SmallView = false;
@@ -123,7 +123,7 @@ namespace Vocaluxe.Menu.SongMenu
_actualSelection = -1; _actualSelection = -1;
_Locked = -1; _Locked = -1;
_PreviewSelected = -1; _PreviewSelected = -1;
UpdateList(0); UpdateList(0, true);
//AfterCategoryChange(); //AfterCategoryChange();
SetSelectedSong(_ActSong); SetSelectedSong(_ActSong);
AfterCategoryChange(); AfterCategoryChange();
@@ -197,7 +197,7 @@ namespace Vocaluxe.Menu.SongMenu
_actualSelection = 0; _actualSelection = 0;
_PreviewSelected = 0; _PreviewSelected = 0;
SetSelectedNow(); SetSelectedNow();
UpdateList(0); UpdateList(0, true);
} }
} }
else else
@@ -247,9 +247,7 @@ namespace Vocaluxe.Menu.SongMenu
if (_Locked > 0 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0)) if (_Locked > 0 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
{ {
_Locked--; _Locked--;
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && _Locked < CBase.Songs.GetNumCategories() - _NumW || UpdateList();
CBase.Songs.GetCurrentCategoryIndex() >= 0 && _Locked < CBase.Songs.GetNumVisibleSongs() - _NumW)
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
} }
break; break;
@@ -259,8 +257,7 @@ namespace Vocaluxe.Menu.SongMenu
if (_Locked < CBase.Songs.GetNumCategories() - 1) if (_Locked < CBase.Songs.GetNumCategories() - 1)
{ {
_Locked++; _Locked++;
if (_Locked < CBase.Songs.GetNumCategories() - _NumW) UpdateList();
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
} }
} }
@@ -269,8 +266,7 @@ namespace Vocaluxe.Menu.SongMenu
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !SongOptions.Selection.RandomOnly) if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !SongOptions.Selection.RandomOnly)
{ {
_Locked++; _Locked++;
if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW) UpdateList();
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
} }
} }
break; break;
@@ -285,7 +281,7 @@ namespace Vocaluxe.Menu.SongMenu
if (_Locked > _NumW - 1 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0)) if (_Locked > _NumW - 1 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
{ {
_Locked -= _NumW; _Locked -= _NumW;
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); UpdateList();
} }
break; break;
@@ -301,19 +297,14 @@ namespace Vocaluxe.Menu.SongMenu
if (_Locked < CBase.Songs.GetNumCategories() - _NumW) if (_Locked < CBase.Songs.GetNumCategories() - _NumW)
{ {
_Locked += _NumW; _Locked += _NumW;
if (_Locked < CBase.Songs.GetNumCategories() - _NumW) UpdateList();
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
} }
} }
else else if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly)
{ {
if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly) _Locked += _NumW;
{ UpdateList();
_Locked += _NumW;
if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW)
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)));
}
} }
break; break;
@@ -407,30 +398,9 @@ namespace Vocaluxe.Menu.SongMenu
} }
} }
if (MouseEvent.Wheel > 0) if (MouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
{ {
if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)) UpdateList(_Offset + _NumW * MouseEvent.Wheel);
{
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetNumVisibleSongs() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1) ||
CBase.Songs.GetCurrentCategoryIndex() < 0 && CBase.Songs.GetNumCategories() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1))
{
_Offset += _NumW * MouseEvent.Wheel;
UpdateList(_Offset);
}
}
}
if (MouseEvent.Wheel < 0)
{
if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed))
{
_Offset += _NumW * MouseEvent.Wheel;
if (_Offset < 0)
{
_Offset = 0;
}
UpdateList(_Offset);
}
} }
} }
@@ -511,7 +481,8 @@ namespace Vocaluxe.Menu.SongMenu
CBase.Drawing.DrawTexture(_vidtex, vidRect, _vidtex.color, vidRectBounds, false); CBase.Drawing.DrawTexture(_vidtex, vidRect, _vidtex.color, vidRectBounds, false);
CBase.Drawing.DrawTextureReflection(_vidtex, vidRect, _vidtex.color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight); CBase.Drawing.DrawTextureReflection(_vidtex, vidRect, _vidtex.color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
}else }
else
_CoverBig.Draw(1f, EAspect.Crop); _CoverBig.Draw(1f, EAspect.Crop);
@@ -541,117 +512,66 @@ namespace Vocaluxe.Menu.SongMenu
return new CStatic(_PartyModeID); return new CStatic(_PartyModeID);
} }
protected void SetSelectedTile(int itemNr)
{
bool sel = false;
foreach (CStatic tile in _Tiles)
{
if (tile.Selected)
{
sel = true;
break;
}
}
if (_Locked == -1 || !sel)
{
if (_PreviewSelected > -1)
{
_Locked = _PreviewSelected;
}
else
{
_Locked = 0;
_actualSelection = 0;
_PreviewSelected = 0;
SetSelectedNow();
UpdateList(0, true);
}
}
foreach (CStatic tile in _Tiles)
{
tile.Selected = false;
}
_PreviewSelected = itemNr;
SetSelectedNow();
_Locked = itemNr;
UpdateList(true);
_PreviewSelected = _Locked;
_actualSelection = _Locked;
if (_Locked - _Offset >= 0)
_Tiles[_Locked - _Offset].Selected = true;
}
public override void SetSelectedSong(int VisibleSongNr) public override void SetSelectedSong(int VisibleSongNr)
{ {
base.SetSelectedSong(VisibleSongNr); base.SetSelectedSong(VisibleSongNr);
if (VisibleSongNr < 0) if (VisibleSongNr >= 0 && VisibleSongNr < CBase.Songs.GetNumVisibleSongs())
return; SetSelectedTile(VisibleSongNr);
if (CBase.Songs.GetNumVisibleSongs() > VisibleSongNr)
{
bool sel = false;
foreach (CStatic tile in _Tiles)
{
if (tile.Selected)
{
sel = true;
break;
}
}
if (_Locked == -1 || !sel)
{
if (_PreviewSelected > -1)
{
_Locked = _PreviewSelected;
}
else
{
_Locked = 0;
_actualSelection = 0;
_PreviewSelected = 0;
SetSelectedNow();
UpdateList(0);
}
}
foreach (CStatic tile in _Tiles)
{
tile.Selected = false;
}
_PreviewSelected = VisibleSongNr;
SetSelectedNow();
_Locked = VisibleSongNr;
UpdateList((VisibleSongNr / _NumW) * _NumW - (_NumW * (_NumH - 2)));
_PreviewSelected = _Locked;
_actualSelection = _Locked;
for (int i = 0; i < _Tiles.Count; i++)
{
_Tiles[i].Selected = _Locked == i + _Offset;
}
}
} }
public override void SetSelectedCategory(int CategoryNr) public override void SetSelectedCategory(int CategoryNr)
{ {
base.SetSelectedCategory(CategoryNr); base.SetSelectedCategory(CategoryNr);
if (CategoryNr < 0) if (CategoryNr >= 0 && CategoryNr < CBase.Songs.GetNumCategories())
return; SetSelectedTile(CategoryNr);
if (CBase.Songs.GetNumCategories() > CategoryNr)
{
bool sel = false;
foreach (CStatic tile in _Tiles)
{
if (tile.Selected)
{
sel = true;
break;
}
}
if (_Locked == -1 || !sel)
{
if (_PreviewSelected > -1)
{
_Locked = _PreviewSelected;
}
else
{
_Locked = 0;
_actualSelection = 0;
_PreviewSelected = 0;
SetSelectedNow();
UpdateList(0);
}
}
foreach (CStatic tile in _Tiles)
{
tile.Selected = false;
}
_PreviewSelected = CategoryNr;
SetSelectedNow();
_Locked = CategoryNr;
UpdateList((CategoryNr / _NumW) * _NumW - (_NumW * (_NumH - 2)));
_PreviewSelected = _Locked;
_actualSelection = _Locked;
for (int i = 0; i < _Tiles.Count; i++)
{
_Tiles[i].Selected = _Locked == i + _Offset;
}
}
} }
protected override void EnterCategory(int cat) protected override void EnterCategory(int cat)
@@ -712,54 +632,43 @@ namespace Vocaluxe.Menu.SongMenu
_LastKnownCategory = CBase.Songs.GetCurrentCategoryIndex(); _LastKnownCategory = CBase.Songs.GetCurrentCategoryIndex();
_LastKnownNumSongs = CBase.Songs.GetNumVisibleSongs(); _LastKnownNumSongs = CBase.Songs.GetNumVisibleSongs();
UpdateList(0); UpdateList(0, true);
CBase.Songs.UpdateRandomSongList(); CBase.Songs.UpdateRandomSongList();
} }
private void UpdateList(int offset) private void UpdateList(bool force = false)
{ {
if (CBase.Songs.GetCurrentCategoryIndex() > -1) UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)), force);
{ }
if (offset >= (CBase.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1)))
offset = (CBase.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1)); private void UpdateList(int offset, bool force = false)
} {
else bool isInCategory = CBase.Songs.GetCurrentCategoryIndex() >= 0;
{ int itemCount = (isInCategory) ? CBase.Songs.GetNumVisibleSongs() : CBase.Songs.GetNumCategories();
if (offset >= (CBase.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1)))
offset = (CBase.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1)); if (offset >= (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1)))
} offset = (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1));
if (offset < 0) if (offset < 0)
offset = 0; offset = 0;
if (offset == _Offset && !force)
return;
for (int i = 0; i < _Tiles.Count; i++) for (int i = 0; i < _Tiles.Count; i++)
{ {
if (CBase.Songs.GetCurrentCategoryIndex() >= 0) if (itemCount > i + offset)
{ {
if (CBase.Songs.GetNumVisibleSongs() > i + offset) if (isInCategory)
{
_Tiles[i].Texture = CBase.Songs.GetVisibleSong(i + offset).CoverTextureSmall; _Tiles[i].Texture = CBase.Songs.GetVisibleSong(i + offset).CoverTextureSmall;
_Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f);
}
else else
{
_Tiles[i].Texture = _CoverTexture;
_Tiles[i].Color = _Color;
}
}
if (CBase.Songs.GetCurrentCategoryIndex() == -1)
{
if (CBase.Songs.GetNumCategories() > i + offset)
{
_Tiles[i].Texture = CBase.Songs.GetCategory(i + offset).CoverTextureSmall; _Tiles[i].Texture = CBase.Songs.GetCategory(i + offset).CoverTextureSmall;
_Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f); _Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f);
} }
else else
{ {
_Tiles[i].Texture = _CoverTexture; _Tiles[i].Texture = _CoverTexture;
_Tiles[i].Color = _Color; _Tiles[i].Color = _Color;
}
} }
} }
_Offset = offset; _Offset = offset;
@@ -775,56 +684,34 @@ namespace Vocaluxe.Menu.SongMenu
{ {
_NumH = _Theme.songMenuTileBoard.numHsmall; _NumH = _Theme.songMenuTileBoard.numHsmall;
_NumW = _Theme.songMenuTileBoard.numWsmall; _NumW = _Theme.songMenuTileBoard.numWsmall;
_TileW = (int)((_Theme.songMenuTileBoard.TileRectSmall.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Theme.songMenuTileBoard.TileRectSmall.H - _SpaceH * (_NumH - 1)) / _NumH);
_CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_Tiles = new List<CStatic>();
for (int i = 0; i < _NumH; i++)
{
for (int j = 0; j < _NumW; j++)
{
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRectSmall.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRectSmall.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect);
_Tiles.Add(tile);
}
}
_Rect = _Theme.songMenuTileBoard.TileRectSmall; _Rect = _Theme.songMenuTileBoard.TileRectSmall;
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRectSmall.Z);
} }
else else
{ {
_NumH = _Theme.songMenuTileBoard.numH; _NumH = _Theme.songMenuTileBoard.numH;
_NumW = _Theme.songMenuTileBoard.numW; _NumW = _Theme.songMenuTileBoard.numW;
_TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH);
_CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_Tiles = new List<CStatic>();
for (int i = 0; i < _NumH; i++)
{
for (int j = 0; j < _NumW; j++)
{
SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW),
_Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect);
_Tiles.Add(tile);
}
}
_Rect = _Theme.songMenuTileBoard.TileRect; _Rect = _Theme.songMenuTileBoard.TileRect;
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z);
} }
UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); _TileW = (int)((_Rect.W - _SpaceW * (_NumW - 1)) / _NumW);
_TileH = (int)((_Rect.H - _SpaceH * (_NumH - 1)) / _NumH);
_CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID);
_CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID);
_Tiles = new List<CStatic>();
for (int i = 0; i < _NumH; i++)
{
for (int j = 0; j < _NumW; j++)
{
SRectF rect = new SRectF(_Rect.X + j * (_TileW + _SpaceW), _Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z);
CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect);
_Tiles.Add(tile);
}
}
_ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Rect.Z);
UpdateList(true);
} }
public override bool IsSmallView() public override bool IsSmallView()