On change of Tabs to on it will go out of any category
Auto reformat
This commit is contained in:
1 parent
cf0fd9dbed
commit
69c36362f5
15 files changed
+168
-39
No files matched your search
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
@@ -504,7 +505,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
List<int> ids = new List<int>();
|
List<int> ids = new List<int>();
|
||||||
|
|
||||||
var visibleSongs = CBase.Songs.GetVisibleSongs();
|
ReadOnlyCollection<CSong> visibleSongs = CBase.Songs.GetVisibleSongs();
|
||||||
if (visibleSongs.Count == 0)
|
if (visibleSongs.Count == 0)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("CPartyChallengeMedleyMode Error: There are no songs!");
|
CBase.Log.LogError("CPartyChallengeMedleyMode Error: There are no songs!");
|
||||||
|
|||||||
@@ -584,6 +584,11 @@ namespace Vocaluxe.Base
|
|||||||
return CSongs.NumSongsInCategory(categoryIndex);
|
return CSongs.NumSongsInCategory(categoryIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsInCategory()
|
||||||
|
{
|
||||||
|
return CSongs.IsInCategory;
|
||||||
|
}
|
||||||
|
|
||||||
public int GetCurrentCategoryIndex()
|
public int GetCurrentCategoryIndex()
|
||||||
{
|
{
|
||||||
return CSongs.Category;
|
return CSongs.Category;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Vocaluxe.Lib.Playlist;
|
using Vocaluxe.Lib.Playlist;
|
||||||
@@ -223,7 +224,7 @@ namespace Vocaluxe.Base
|
|||||||
private static CPlaylistFile _ConvertUSDXPlaylist(string file)
|
private static CPlaylistFile _ConvertUSDXPlaylist(string file)
|
||||||
{
|
{
|
||||||
CPlaylistFile pl = new CPlaylistFile();
|
CPlaylistFile pl = new CPlaylistFile();
|
||||||
var allSongs = CSongs.AllSongs;
|
ReadOnlyCollection<CSong> allSongs = CSongs.AllSongs;
|
||||||
|
|
||||||
if (!File.Exists(file))
|
if (!File.Exists(file))
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ namespace Vocaluxe.Base
|
|||||||
if (value == _Tabs)
|
if (value == _Tabs)
|
||||||
return;
|
return;
|
||||||
_Tabs = value;
|
_Tabs = value;
|
||||||
|
if (_Tabs == EOffOn.TR_CONFIG_ON)
|
||||||
|
CSongs.Category = -1;
|
||||||
_SetChanged();
|
_SetChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-10
@@ -76,20 +76,25 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static int Category
|
public static int Category
|
||||||
{
|
{
|
||||||
get { return _CatIndex; }
|
get
|
||||||
|
{
|
||||||
|
if (_CatIndex >= Categories.Count)
|
||||||
|
_CatIndex = -1;
|
||||||
|
return _CatIndex;
|
||||||
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value == -1 || IsCatIndexValid(value))
|
if (value == -1 || _IsCatIndexValid(value))
|
||||||
_CatIndex = value;
|
_CatIndex = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsInCategory
|
public static bool IsInCategory
|
||||||
{
|
{
|
||||||
get { return _CatIndex >= 0; }
|
get { return _IsCatIndexValid(_CatIndex); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsCatIndexValid(int catIndex)
|
private static bool _IsCatIndexValid(int catIndex)
|
||||||
{
|
{
|
||||||
return catIndex >= 0 && catIndex < Categories.Count;
|
return catIndex >= 0 && catIndex < Categories.Count;
|
||||||
}
|
}
|
||||||
@@ -101,7 +106,7 @@ namespace Vocaluxe.Base
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int NumSongsInCategory(int catIndex)
|
public static int NumSongsInCategory(int catIndex)
|
||||||
{
|
{
|
||||||
return IsCatIndexValid(catIndex) ? Categories[catIndex].Songs.Count(sp => !sp.IsSung) : 0;
|
return _IsCatIndexValid(catIndex) ? Categories[catIndex].Songs.Count(sp => !sp.IsSung) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void NextCategory()
|
public static void NextCategory()
|
||||||
@@ -139,7 +144,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static string GetCurrentCategoryName()
|
public static string GetCurrentCategoryName()
|
||||||
{
|
{
|
||||||
return IsCatIndexValid(_CatIndex) ? Categories[_CatIndex].Name : "";
|
return _IsCatIndexValid(_CatIndex) ? Categories[_CatIndex].Name : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CSong GetSong(int songID)
|
public static CSong GetSong(int songID)
|
||||||
@@ -170,7 +175,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void ResetPartySongSung(int catIndex)
|
public static void ResetPartySongSung(int catIndex)
|
||||||
{
|
{
|
||||||
if (IsCatIndexValid(catIndex))
|
if (_IsCatIndexValid(catIndex))
|
||||||
{
|
{
|
||||||
foreach (CSongPointer song in Categories[catIndex].Songs)
|
foreach (CSongPointer song in Categories[catIndex].Songs)
|
||||||
song.IsSung = false;
|
song.IsSung = false;
|
||||||
@@ -247,7 +252,7 @@ namespace Vocaluxe.Base
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
List<CSong> songs = new List<CSong>();
|
List<CSong> songs = new List<CSong>();
|
||||||
if (IsCatIndexValid(_CatIndex))
|
if (_IsCatIndexValid(_CatIndex))
|
||||||
{
|
{
|
||||||
foreach (CSongPointer sp in Categories[_CatIndex].Songs)
|
foreach (CSongPointer sp in Categories[_CatIndex].Songs)
|
||||||
{
|
{
|
||||||
@@ -268,14 +273,13 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
return null;
|
return null;
|
||||||
var visSongs = VisibleSongs;
|
ReadOnlyCollection<CSong> visSongs = VisibleSongs;
|
||||||
return (index < visSongs.Count) ? visSongs[index] : null;
|
return (index < visSongs.Count) ? visSongs[index] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void _HandleCategoriesChanged(object sender, EventArgs args)
|
private static void _HandleCategoriesChanged(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
_CategoriesForRandom.Clear();
|
_CategoriesForRandom.Clear();
|
||||||
Category = _CatIndex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Sort(ESongSorting sorting, EOffOn tabs, EOffOn ignoreArticles, String searchString, EDuetOptions duetOptions)
|
public static void Sort(ESongSorting sorting, EOffOn tabs, EOffOn ignoreArticles, String searchString, EDuetOptions duetOptions)
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
#region license
|
||||||
|
// /*
|
||||||
|
// This file is part of Vocaluxe.
|
||||||
|
//
|
||||||
|
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Vocaluxe is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// */
|
||||||
|
#endregion
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
#region license
|
||||||
|
// /*
|
||||||
|
// This file is part of Vocaluxe.
|
||||||
|
//
|
||||||
|
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Vocaluxe is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// */
|
||||||
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
#region license
|
||||||
|
// /*
|
||||||
|
// This file is part of Vocaluxe.
|
||||||
|
//
|
||||||
|
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Vocaluxe is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// */
|
||||||
|
#endregion
|
||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,23 @@
|
|||||||
using System;
|
#region license
|
||||||
|
// /*
|
||||||
|
// This file is part of Vocaluxe.
|
||||||
|
//
|
||||||
|
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Vocaluxe is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// */
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|||||||
@@ -1,4 +1,23 @@
|
|||||||
using VocaluxeLib.Menu.SongMenu;
|
#region license
|
||||||
|
// /*
|
||||||
|
// This file is part of Vocaluxe.
|
||||||
|
//
|
||||||
|
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Vocaluxe is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// */
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.GameModes
|
namespace Vocaluxe.GameModes
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
@@ -1007,7 +1008,7 @@ namespace Vocaluxe.Screens
|
|||||||
if (CSongs.IsInCategory)
|
if (CSongs.IsInCategory)
|
||||||
{
|
{
|
||||||
//TODO: Check and use sorting method
|
//TODO: Check and use sorting method
|
||||||
var songs = CSongs.VisibleSongs;
|
ReadOnlyCollection<CSong> songs = CSongs.VisibleSongs;
|
||||||
int ct = songs.Count;
|
int ct = songs.Count;
|
||||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||||
start = curSelected + 1;
|
start = curSelected + 1;
|
||||||
@@ -1017,7 +1018,7 @@ namespace Vocaluxe.Screens
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var categories = CSongs.Categories;
|
ReadOnlyCollection<CCategory> categories = CSongs.Categories;
|
||||||
int ct = categories.Count;
|
int ct = categories.Count;
|
||||||
if (curSelected >= 0 && curSelected < ct - 1 && categories[curSelected].Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
if (curSelected >= 0 && curSelected < ct - 1 && categories[curSelected].Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||||
start = curSelected + 1;
|
start = curSelected + 1;
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ namespace VocaluxeLib.Menu
|
|||||||
int GetNumSongsVisible();
|
int GetNumSongsVisible();
|
||||||
int GetNumCategories();
|
int GetNumCategories();
|
||||||
int NumSongsInCategory(int categoryIndex);
|
int NumSongsInCategory(int categoryIndex);
|
||||||
|
bool IsInCategory();
|
||||||
|
|
||||||
int GetCurrentCategoryIndex();
|
int GetCurrentCategoryIndex();
|
||||||
EOffOn GetTabs();
|
EOffOn GetTabs();
|
||||||
|
|||||||
@@ -1,4 +1,23 @@
|
|||||||
using System.Collections.Generic;
|
#region license
|
||||||
|
// /*
|
||||||
|
// This file is part of Vocaluxe.
|
||||||
|
//
|
||||||
|
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Vocaluxe is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// */
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu.SongMenu
|
namespace VocaluxeLib.Menu.SongMenu
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
if (!_Initialized)
|
if (!_Initialized)
|
||||||
return false;
|
return false;
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories())
|
if (CBase.Songs.IsInCategory() || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories())
|
||||||
return false;
|
return false;
|
||||||
_EnterCategory(_PreviewSelected);
|
_EnterCategory(_PreviewSelected);
|
||||||
return true;
|
return true;
|
||||||
@@ -582,7 +582,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
if (!_Initialized)
|
if (!_Initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() == -1)
|
if (!CBase.Songs.IsInCategory())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_Reset();
|
_Reset();
|
||||||
@@ -596,7 +596,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
protected void _SelectSong(int nr)
|
protected void _SelectSong(int nr)
|
||||||
{
|
{
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumSongsVisible() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
|
if (CBase.Songs.IsInCategory() && (CBase.Songs.GetNumSongsVisible() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
|
||||||
{
|
{
|
||||||
_Streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
|
_Streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
|
||||||
_Streams.Clear();
|
_Streams.Clear();
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
public override void OnShow()
|
public override void OnShow()
|
||||||
{
|
{
|
||||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Songs.GetNumCategories() > 0 && CBase.Songs.GetCurrentCategoryIndex() == -1)
|
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Songs.GetNumCategories() > 0 && !CBase.Songs.IsInCategory())
|
||||||
_EnterCategory(0);
|
_EnterCategory(0);
|
||||||
_ActualSelection = -1;
|
_ActualSelection = -1;
|
||||||
_Locked = -1;
|
_Locked = -1;
|
||||||
@@ -201,7 +201,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
switch (keyEvent.Key)
|
switch (keyEvent.Key)
|
||||||
{
|
{
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0)
|
if (!CBase.Songs.IsInCategory())
|
||||||
{
|
{
|
||||||
_EnterCategory(_PreviewSelected);
|
_EnterCategory(_PreviewSelected);
|
||||||
keyEvent.Handled = true;
|
keyEvent.Handled = true;
|
||||||
@@ -212,7 +212,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() > -1 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
if (CBase.Songs.IsInCategory() && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||||
{
|
{
|
||||||
_ShowCategories();
|
_ShowCategories();
|
||||||
keyEvent.Handled = true;
|
keyEvent.Handled = true;
|
||||||
@@ -234,7 +234,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Left:
|
case Keys.Left:
|
||||||
if (_Locked > 0 && (!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
if (_Locked > 0 && (!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && !CBase.Songs.IsInCategory()))
|
||||||
{
|
{
|
||||||
_Locked--;
|
_Locked--;
|
||||||
_UpdateList();
|
_UpdateList();
|
||||||
@@ -242,7 +242,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Right:
|
case Keys.Right:
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
if (!CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed)
|
||||||
{
|
{
|
||||||
if (_Locked < CBase.Songs.GetNumCategories() - 1)
|
if (_Locked < CBase.Songs.GetNumCategories() - 1)
|
||||||
{
|
{
|
||||||
@@ -252,7 +252,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumSongsVisible() - 1 && !songOptions.Selection.RandomOnly)
|
if (CBase.Songs.IsInCategory() && _Locked < CBase.Songs.GetNumSongsVisible() - 1 && !songOptions.Selection.RandomOnly)
|
||||||
{
|
{
|
||||||
_Locked++;
|
_Locked++;
|
||||||
_UpdateList();
|
_UpdateList();
|
||||||
@@ -268,7 +268,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_Locked > _NumW - 1 &&
|
if (_Locked > _NumW - 1 &&
|
||||||
(!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
(!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && !CBase.Songs.IsInCategory()))
|
||||||
{
|
{
|
||||||
_Locked -= _NumW;
|
_Locked -= _NumW;
|
||||||
_UpdateList();
|
_UpdateList();
|
||||||
@@ -282,7 +282,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
if (!CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed)
|
||||||
{
|
{
|
||||||
if (_Locked < CBase.Songs.GetNumCategories() - _NumW)
|
if (_Locked < CBase.Songs.GetNumCategories() - _NumW)
|
||||||
{
|
{
|
||||||
@@ -318,13 +318,13 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
bool sel = false;
|
bool sel = false;
|
||||||
int lastselection = _ActualSelection;
|
int lastselection = _ActualSelection;
|
||||||
|
|
||||||
if (!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
if (!songOptions.Selection.RandomOnly || !CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed)
|
||||||
{
|
{
|
||||||
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)
|
||||||
{
|
{
|
||||||
if (mouseEvent.LB || CBase.Songs.GetCurrentCategoryIndex() == -1)
|
if (mouseEvent.LB || !CBase.Songs.IsInCategory())
|
||||||
{
|
{
|
||||||
if (_PreviewSelected == i + _Offset)
|
if (_PreviewSelected == i + _Offset)
|
||||||
_Locked = _PreviewSelected;
|
_Locked = _PreviewSelected;
|
||||||
@@ -352,7 +352,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
if (!sel)
|
if (!sel)
|
||||||
_ActualSelection = -1;
|
_ActualSelection = -1;
|
||||||
|
|
||||||
if (mouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
|
if (mouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.IsInCategory() && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
|
||||||
songOptions.Selection.CategoryChangeAllowed)
|
songOptions.Selection.CategoryChangeAllowed)
|
||||||
{
|
{
|
||||||
_ShowCategories();
|
_ShowCategories();
|
||||||
@@ -366,7 +366,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
if (CHelper.IsInBounds(_CoverBig.Rect, mouseEvent) || CHelper.IsInBounds(_TextBG.Rect, mouseEvent))
|
if (CHelper.IsInBounds(_CoverBig.Rect, mouseEvent) || CHelper.IsInBounds(_TextBG.Rect, mouseEvent))
|
||||||
_Locked = _PreviewSelected;
|
_Locked = _PreviewSelected;
|
||||||
}
|
}
|
||||||
else if (mouseEvent.LB && (CBase.Songs.GetCurrentCategoryIndex() == -1))
|
else if (mouseEvent.LB && (!CBase.Songs.IsInCategory()))
|
||||||
{
|
{
|
||||||
foreach (CStatic tile in _Tiles)
|
foreach (CStatic tile in _Tiles)
|
||||||
{
|
{
|
||||||
@@ -380,7 +380,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, mouseEvent) &&
|
if (mouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, mouseEvent) &&
|
||||||
(!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed))
|
(!songOptions.Selection.RandomOnly || !CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed))
|
||||||
_UpdateList(_Offset + _NumW * mouseEvent.Wheel);
|
_UpdateList(_Offset + _NumW * mouseEvent.Wheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,17 +389,17 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
foreach (CStatic tile in _Tiles)
|
foreach (CStatic tile in _Tiles)
|
||||||
{
|
{
|
||||||
if (tile.Selected && _Active)
|
if (tile.Selected && _Active)
|
||||||
tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false);
|
tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (tile.Texture.Index != _CoverTexture.Index)
|
if (tile.Texture.Index != _CoverTexture.Index)
|
||||||
tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false);
|
tile.Draw(1f, tile.Rect.Z, EAspect.Crop);
|
||||||
else
|
else
|
||||||
tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false);
|
tile.Draw(1f, tile.Rect.Z, EAspect.Stretch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0)
|
if (CBase.Songs.IsInCategory())
|
||||||
{
|
{
|
||||||
int actsong = _PreviewSelected;
|
int actsong = _PreviewSelected;
|
||||||
if ((CBase.Songs.GetNumSongsVisible() > actsong) && (actsong >= 0))
|
if ((CBase.Songs.GetNumSongsVisible() > actsong) && (actsong >= 0))
|
||||||
@@ -490,7 +490,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
return new CStatic(_PartyModeID);
|
return new CStatic(_PartyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void _SetSelectedTile(int itemNr)
|
private void _SetSelectedTile(int itemNr)
|
||||||
{
|
{
|
||||||
bool sel = _Tiles.Any(tile => tile.Selected);
|
bool sel = _Tiles.Any(tile => tile.Selected);
|
||||||
|
|
||||||
@@ -607,7 +607,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
private void _UpdateList(int offset, bool force = false)
|
private void _UpdateList(int offset, bool force = false)
|
||||||
{
|
{
|
||||||
bool isInCategory = CBase.Songs.GetCurrentCategoryIndex() >= 0;
|
bool isInCategory = CBase.Songs.IsInCategory();
|
||||||
int itemCount = isInCategory ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories();
|
int itemCount = isInCategory ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories();
|
||||||
|
|
||||||
if (offset >= (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1)))
|
if (offset >= (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1)))
|
||||||
|
|||||||
Reference in new issue
Block a user