Merge pull request #465 from Vocaluxe/ChangeSortOptions

Change sort options on the song screen (key shortcuts)
This commit is contained in:
Stefan authored and GitHub committed 2020-01-26 18:37:35 +01:00
commit 3a85cca60c
4 files changed
+114 -3

No files matched your search

+2 -1
View File
@@ -152,9 +152,10 @@
<string name="TR_SCREENSONG_NUMSONGS">(%v songs)</string>
<string name="TR_SCREENSONG_NUMSONG">(%v song)</string>
<string name="TR_SCREENSONG_ARTIST_TITLE">%a - %t</string>
<string name="TR_SCREENSONG_HELPMESSAGE">A-Z = Jump to the letter • F3 = Search • CTRL+R = Random selection • CTRL+S = Start medley • CTRL+A = Start all random • CTRL+V = Start visible random • Space = Open song options • ESC = Back to main menu</string>
<string name="TR_SCREENSONG_HELPMESSAGE">A-Z = Jump to the letter • F3 = Search • CTRL+R = Random selection • CTRL+S = Start medley • CTRL+# = Change song sorting • CTRL+T = Enable/Disable category view • Space = Open song options • ESC = Back to main menu</string>
<string name="TR_SCREENSONG_HELPMESSAGESEARCH">A-Z = Search artist and title, prefixes for the search → a: = artist • t: = title • c: = creator • e: = edition • g: = genre • y: = year (e.g. 1999 or 1980-1989) • l: = language • al: = album • fi: = file name • fo: = folder name</string>
<string name="TR_SCREENSONG_HELPMESSAGEPARTY">1-6 = Press your team number to use a random song joker</string>
<string name="TR_SCREENSONG_SORTING">Sorting: %s</string>
<string name="TR_SCREENSING_PAUSE">Pause</string>
<string name="TR_SCREENSING_BUTTON_CANCEL">Stop singing</string>
<string name="TR_SCREENSING_BUTTON_CONTINUE">Continue</string>
+2 -1
View File
@@ -147,9 +147,10 @@
<string name="TR_SCREENSONG_NUMSONGS">(%v Lieder)</string>
<string name="TR_SCREENSONG_NUMSONG">(%v Lied)</string>
<string name="TR_SCREENSONG_ARTIST_TITLE">%a -%t</string>
<string name="TR_SCREENSONG_HELPMESSAGE">A-Z = Zum Buchstaben springen • F3 = Suchen • STRG+R = Zufällige Auswahl • STRG+S = Starte Medley • STRG+A = Alle zufällig starten • STRG+V = Sichtbare zufällig starten • Leertaste = Lied-Optionen öffnen • ESC = Zurück zum Hauptmenü</string>
<string name="TR_SCREENSONG_HELPMESSAGE">A-Z = Zum Buchstaben springen • F3 = Suchen • STRG+R = Zufällige Auswahl • STRG+S = Starte Medley • STRG+# = Song Sortierung ändern • STRG+T = Kategorieansicht ein-/ausschalten • Leertaste = Lied-Optionen öffnen • ESC = Zurück zum Hauptmenü</string>
<string name="TR_SCREENSONG_HELPMESSAGESEARCH">A-Z = Interpreten und Titel durchsuchen, Präfixe für die Suche → a: = Interpret • t: = Titel • c: = Ersteller • e: = Edition • g: = Genre • y: = Jahr (z.B. 1999 oder 1980-1989) • l: = Sprache • al: = Album • fi: = Dateiname • fo: = Ordnername</string>
<string name="TR_SCREENSONG_HELPMESSAGEPARTY">1-6 = Drücke die Teamnummer um einen Zufallssong Joker zu verwenden</string>
<string name="TR_SCREENSONG_SORTING">Sortierung: %s</string>
<string name="TR_SCREENSING_PAUSE">Pause</string>
<string name="TR_SCREENSING_BUTTON_CANCEL">Lied beenden</string>
<string name="TR_SCREENSING_BUTTON_CONTINUE">Fortfahren</string>
@@ -70,8 +70,33 @@
<Z>-2.1</Z>
</Rect>
</Static>
<Static Name="StaticShortInfoTop">
<Skin />
<Color Name="BackgroundColorAlpha" />
<Rect>
<X>490</X>
<Y>0</Y>
<W>300</W>
<H>30</H>
<Z>-0.75</Z>
</Rect>
</Static>
</Statics>
<Texts>
<Text Name="TextShortInfoTop">
<X>640</X>
<Y>2</Y>
<Z>-1</Z>
<H>25</H>
<MaxW>280</MaxW>
<Color Name="TextColor" />
<SelColor Name="TextSelColor" />
<Align>Center</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Normal</Style>
<Font>Outline</Font>
<Text>TR_SCREENSONG_SORTING</Text>
</Text>
<Text Name="TextPlayer1">
<X>950</X>
<Y>65</Y>
+85 -1
View File
@@ -19,6 +19,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Timers;
using System.Windows.Forms;
using Vocaluxe.Base;
using VocaluxeLib;
@@ -53,6 +54,7 @@ namespace Vocaluxe.Screens
private const string _TextHelpBarSearch = "TextHelpBarSearch";
private const string _TextHelpBarParty = "TextHelpBarParty";
private const string _TextOptionsTitle = "TextOptionsTitle";
private const string _TextShortInfoTop = "TextShortInfoTop";
private const string _ButtonOpenOptions = "ButtonOpenOptions";
private const string _ButtonOptionsSing = "ButtonOptionsSing";
@@ -75,6 +77,7 @@ namespace Vocaluxe.Screens
private const string _StaticSearchBar = "StaticSearchBar";
private const string _StaticOptionsBG = "StaticOptionsBG";
private const string _StaticShortInfoTop = "StaticShortInfoTop";
private const string _SongMenuName = "SongMenu";
private const string _PlaylistName = "Playlist";
@@ -100,6 +103,8 @@ namespace Vocaluxe.Screens
private ISongMenu _SongMenu;
private CPlaylist _Playlist;
private System.Timers.Timer _TimerShortInfoText;
private static int _StaticSelectedSongID;
private static void setStaticSelectedSongID(int songID)
@@ -158,8 +163,9 @@ namespace Vocaluxe.Screens
tlist.Add(_TextHelpBarSearch);
tlist.Add(_TextHelpBarParty);
tlist.Add(_TextOptionsTitle);
tlist.Add(_TextShortInfoTop);
_ThemeStatics = new string[] {_StaticSearchBar, _StaticOptionsBG};
_ThemeStatics = new string[] {_StaticSearchBar, _StaticOptionsBG, _StaticShortInfoTop};
_ThemeTexts = tlist.ToArray();
_ThemeButtons = blist.ToArray();
_ThemeSelectSlides = new string[] {_SelectSlideOptionsMode, _SelectSlideOptionsPlaylistAdd, _SelectSlideOptionsPlaylistOpen, _SelectSlideOptionsNumMedleySongs};
@@ -167,6 +173,10 @@ namespace Vocaluxe.Screens
_ThemePlaylists = new string[] {_PlaylistName};
_DragAndDropCover = GetNewStatic();
_TimerShortInfoText = new System.Timers.Timer(5000);
_TimerShortInfoText.AutoReset = false;
_TimerShortInfoText.Elapsed += OnTimedEventShortInfoText;
}
protected override void _OnSongMenuChanged()
@@ -318,6 +328,35 @@ namespace Vocaluxe.Screens
_StartMedleySong(_SongMenu.GetPreviewSongNr());
break;
case Keys.T:
if (keyEvent.Mod == EModifier.Ctrl && !_Sso.Selection.PartyMode)
{
_ToggleTabs();
}
break;
case Keys.D0:
case Keys.D1:
case Keys.D2:
case Keys.D3:
case Keys.D4:
case Keys.D5:
case Keys.D6:
case Keys.D7:
case Keys.D8:
case Keys.D9:
if (keyEvent.Mod == EModifier.Ctrl && !_Sso.Selection.PartyMode)
{
int tempSortNr = -1;
int.TryParse(keyEvent.Key.ToString().Substring(1), out tempSortNr);
if (tempSortNr == 0)
tempSortNr = 10;
_ToggleSort(tempSortNr);
}
break;
case Keys.H:
if (keyEvent.Mod == EModifier.Ctrl && CSongs.NumSongsVisible > 0 && !_Sso.Selection.PartyMode)
{
@@ -718,6 +757,9 @@ namespace Vocaluxe.Screens
_DragAndDropCover.Visible = false;
_Playlist.DragAndDropSongID = -1;
_Statics[_StaticShortInfoTop].Visible = false;
_Texts[_TextShortInfoTop].Visible = false;
UpdateGame();
}
@@ -893,6 +935,48 @@ namespace Vocaluxe.Screens
}
}
private void _ToggleSort(int sortNr)
{
if (CBase.Songs.IsInCategory() && _Sso.Selection.CategoryChangeAllowed)
{
CBase.Songs.SetCategory(-1);
}
CSongs.Sorter.SongSorting = (ESongSorting)sortNr;
CConfig.Config.Game.SongSorting = CSongs.Sorter.SongSorting;
_Sso.Sorting.SongSorting = CSongs.Sorter.SongSorting;
_SongMenu.Update(_Sso);
_SongMenu.OnShow();
_Texts[_TextShortInfoTop].Text = CBase.Language.Translate("TR_SCREENSONG_SORTING").Replace("%s", CBase.Language.Translate(_Sso.Sorting.SongSorting.ToString()));
_Statics[_StaticShortInfoTop].Visible = true;
_Texts[_TextShortInfoTop].Visible = true;
_TimerShortInfoText.Stop();
_TimerShortInfoText.Enabled = true;
}
private void OnTimedEventShortInfoText(Object source, ElapsedEventArgs e)
{
_Statics[_StaticShortInfoTop].Visible = false;
_Texts[_TextShortInfoTop].Visible = false;
}
private void _ToggleTabs()
{
EOffOn tmpStatus = CSongs.Categorizer.Tabs;
if (tmpStatus == EOffOn.TR_CONFIG_ON)
CSongs.Categorizer.Tabs = EOffOn.TR_CONFIG_OFF;
else
CSongs.Categorizer.Tabs = EOffOn.TR_CONFIG_ON;
CConfig.Config.Game.Tabs = CSongs.Categorizer.Tabs;
_Sso.Sorting.Tabs = CSongs.Categorizer.Tabs;
_SongMenu.Update(_Sso);
_SongMenu.OnShow();
}
private void _ShowHighscore()
{
CGame.ClearSongs();