From feb5c1eaed39d5c0c8414fbad1028e170f0a3380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Fri, 1 Dec 2017 16:41:21 +0100 Subject: [PATCH 1/5] Fix: PartyNameSelection visibility of team increase/decrease button --- VocaluxeLib/Menu/CMenuPartyNameSelection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index cc01f135..b4953cde 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -699,8 +699,8 @@ namespace VocaluxeLib.Menu private void _UpdateButtonVisibility() { - _Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; - _Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; + _Buttons[_ButtonIncreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; + _Buttons[_ButtonDecreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; _Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum; _Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum; } From 7fdbd8780bb0d9670add94a4ece1079cd54b5ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Fri, 1 Dec 2017 17:14:28 +0100 Subject: [PATCH 2/5] Fixed updating team-slide in PartyNameSelection --- VocaluxeLib/Menu/CMenuPartyNameSelection.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index b4953cde..2fb514ef 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -593,6 +593,7 @@ namespace VocaluxeLib.Menu } } _UpdateButtonState(); + _UpdateTeamSlide(); } public void DecreaseTeamNum() @@ -603,6 +604,7 @@ namespace VocaluxeLib.Menu if (_NumTeams - 1 >= _PartyMode.MinTeams) _NumTeams--; _UpdateButtonState(); + _UpdateTeamSlide(); } public void IncreasePlayerNum(int team) From 5296627f8dab6da96cfb4d3908605e904e476e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sat, 2 Dec 2017 16:45:41 +0100 Subject: [PATCH 3/5] Fixed converting Ultrastar.db --- Vocaluxe/Lib/Database/CHighscoreDB.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Lib/Database/CHighscoreDB.cs b/Vocaluxe/Lib/Database/CHighscoreDB.cs index 1e0026b5..981bce4b 100644 --- a/Vocaluxe/Lib/Database/CHighscoreDB.cs +++ b/Vocaluxe/Lib/Database/CHighscoreDB.cs @@ -613,7 +613,7 @@ namespace Vocaluxe.Lib.Database { //Check for USDX 1.1 DB _CreateHighscoreDBV1(filePath); - result &= !_ConvertFrom110(filePath); + result &= _ConvertFrom110(filePath); result &= _UpdateDatabase(1, connection); result &= _UpdateDatabase(2, connection); } @@ -927,7 +927,7 @@ namespace Vocaluxe.Lib.Database if (currentVersion < 2) updated &= _ConvertV1toV2(connection); - if (currentVersion < 3) + else if (currentVersion < 3) updated &= _ConvertV2toV3(connection); return updated; From e9abec565d8f171ad4b32776d864946c4ca87dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sat, 2 Dec 2017 21:57:22 +0100 Subject: [PATCH 4/5] Removed unused tables after converting Ultrastar.db --- Vocaluxe/Lib/Database/CHighscoreDB.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Lib/Database/CHighscoreDB.cs b/Vocaluxe/Lib/Database/CHighscoreDB.cs index 981bce4b..c6683788 100644 --- a/Vocaluxe/Lib/Database/CHighscoreDB.cs +++ b/Vocaluxe/Lib/Database/CHighscoreDB.cs @@ -742,13 +742,22 @@ namespace Vocaluxe.Lib.Database transaction.Commit(); //Delete old tables after conversion - command.CommandText = "DROP TABLE US_Scores;"; + command.CommandText = "DROP TABLE IF EXISTS us_scores;"; command.ExecuteNonQuery(); - command.CommandText = "DROP TABLE US_Songs;"; + command.CommandText = "DROP TABLE IF EXISTS us_songs;"; command.ExecuteNonQuery(); - command.CommandText = "DROP TABLE us_statistics_info;"; + command.CommandText = "DROP TABLE IF EXISTS us_statistics_info;"; + command.ExecuteNonQuery(); + + command.CommandText = "DROP TABLE IF EXISTS us_users_info;"; + command.ExecuteNonQuery(); + + command.CommandText = "DROP TABLE IF EXISTS us_webs;"; + command.ExecuteNonQuery(); + + command.CommandText = "DROP TABLE IF EXISTS us_webs_stats;"; command.ExecuteNonQuery(); //This versioning is not used in Vocaluxe so reset it to 0 From 064b5412a6fc0c750bfff970772c7353b8f392ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 3 Dec 2017 12:38:50 +0100 Subject: [PATCH 5/5] Fix: Increase team number in PartyNameSelction --- VocaluxeLib/Menu/CMenuPartyNameSelection.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index 2fb514ef..063d3b12 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -15,6 +15,7 @@ // along with Vocaluxe. If not, see . #endregion +using System; using System.Collections.Generic; using System.Windows.Forms; using VocaluxeLib.Draw; @@ -587,7 +588,9 @@ namespace VocaluxeLib.Menu } else { - _NumPlayerTeams[i] = _NumPlayer; + //Get average num players per teams as default player number + _NumPlayerTeams[i] = _NumPlayer/(_NumTeams - 1); + _NumPlayer += _NumPlayerTeams[i]; _TeamList[i] = new List(); } } @@ -693,10 +696,14 @@ namespace VocaluxeLib.Menu private void _UpdateTeamSlide() { + int sel = _SelectSlides[_SelectSlideTeams].Selection; + _SelectSlides[_SelectSlideTeams].Visible = _Teams; _SelectSlides[_SelectSlideTeams].Clear(); for (int i = 1; i <= _NumTeams; i++) _SelectSlides[_SelectSlideTeams].AddValue("Team " + i, null, i); + + _SelectSlides[_SelectSlideTeams].Selection = Math.Min(sel, _SelectSlides[_SelectSlideTeams].NumValues - 1); } private void _UpdateButtonVisibility()