- Clened the list menu code a tiny bit

- Added song number and total song count to the bottom text (instead of a scroll bar)
This commit is contained in:
mephasor committed 2014-12-13 12:34:11 -04:00
1 parent 3b775e7bc6
commit 42d98070f9
2 files changed
+3 -5

No files matched your search

+1 -1
View File
@@ -680,7 +680,7 @@ namespace Vocaluxe.Screens
{
int song = _SongMenu.GetSelectedSongNr();
if (song >= 0 && song < CSongs.VisibleSongs.Count)
selectionText = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title;
selectionText = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title + " ( "+(song+1)+" / "+CSongs.NumAllSongs+" )";
}
else
{
+2 -4
View File
@@ -50,7 +50,6 @@ namespace VocaluxeLib.Menu.SongMenu
private int _TileW;
private int _TileH;
//TODO: remove all 1* from the code (artifacts from translation from tile board)
//TODO: make variable list length
private int _ListLength = 15;
private float _CoverTileWidth;
@@ -183,7 +182,6 @@ namespace VocaluxeLib.Menu.SongMenu
//Create text
var textRect = new SRectF(Rect.X + 2 * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _ListTextWidth, _TileH, Rect.Z);
//string textString = _Artist.Text + " - " + _Title.Text;
CText text = new CText(textRect.X, textRect.Y, textRect.Z,
textRect.H, textRect.W, EAlignment.Left, EStyle.Normal,
"Normal", _Artist.Color, "");
@@ -421,7 +419,7 @@ namespace VocaluxeLib.Menu.SongMenu
if (!songOptions.Selection.RandomOnly || (!CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed))
{
if (mouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, mouseEvent))
_UpdateList(_Offset + 1 * mouseEvent.Wheel);
_UpdateList(_Offset + mouseEvent.Wheel);
int lastSelection = _SelectionNr;
int i = 0;
@@ -508,7 +506,6 @@ namespace VocaluxeLib.Menu.SongMenu
text.Draw();
i++;
}
_TextBG.Draw();
CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
@@ -595,6 +592,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
bool isInCategory = CBase.Songs.IsInCategory();
int itemCount = isInCategory ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories();
int totalSongNumber = CBase.Songs.GetNumSongs();
offset = offset.Clamp(0, itemCount - _ListLength, true);