Merge pull request #345 from flokuep/release-0.4.1

Minor fixes.
This commit is contained in:
Florian Küpper authored and GitHub committed 2017-12-05 17:11:51 +01:00
commit 533a7e64d2
2 files changed
+26 -8

No files matched your search

+14 -5
View File
@@ -613,7 +613,7 @@ namespace Vocaluxe.Lib.Database
{ {
//Check for USDX 1.1 DB //Check for USDX 1.1 DB
_CreateHighscoreDBV1(filePath); _CreateHighscoreDBV1(filePath);
result &= !_ConvertFrom110(filePath); result &= _ConvertFrom110(filePath);
result &= _UpdateDatabase(1, connection); result &= _UpdateDatabase(1, connection);
result &= _UpdateDatabase(2, connection); result &= _UpdateDatabase(2, connection);
} }
@@ -742,13 +742,22 @@ namespace Vocaluxe.Lib.Database
transaction.Commit(); transaction.Commit();
//Delete old tables after conversion //Delete old tables after conversion
command.CommandText = "DROP TABLE US_Scores;"; command.CommandText = "DROP TABLE IF EXISTS us_scores;";
command.ExecuteNonQuery(); command.ExecuteNonQuery();
command.CommandText = "DROP TABLE US_Songs;"; command.CommandText = "DROP TABLE IF EXISTS us_songs;";
command.ExecuteNonQuery(); 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(); command.ExecuteNonQuery();
//This versioning is not used in Vocaluxe so reset it to 0 //This versioning is not used in Vocaluxe so reset it to 0
@@ -927,7 +936,7 @@ namespace Vocaluxe.Lib.Database
if (currentVersion < 2) if (currentVersion < 2)
updated &= _ConvertV1toV2(connection); updated &= _ConvertV1toV2(connection);
if (currentVersion < 3) else if (currentVersion < 3)
updated &= _ConvertV2toV3(connection); updated &= _ConvertV2toV3(connection);
return updated; return updated;
+12 -3
View File
@@ -15,6 +15,7 @@
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>. // along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using VocaluxeLib.Draw; using VocaluxeLib.Draw;
@@ -587,12 +588,15 @@ namespace VocaluxeLib.Menu
} }
else 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<int>(); _TeamList[i] = new List<int>();
} }
} }
} }
_UpdateButtonState(); _UpdateButtonState();
_UpdateTeamSlide();
} }
public void DecreaseTeamNum() public void DecreaseTeamNum()
@@ -603,6 +607,7 @@ namespace VocaluxeLib.Menu
if (_NumTeams - 1 >= _PartyMode.MinTeams) if (_NumTeams - 1 >= _PartyMode.MinTeams)
_NumTeams--; _NumTeams--;
_UpdateButtonState(); _UpdateButtonState();
_UpdateTeamSlide();
} }
public void IncreasePlayerNum(int team) public void IncreasePlayerNum(int team)
@@ -691,16 +696,20 @@ namespace VocaluxeLib.Menu
private void _UpdateTeamSlide() private void _UpdateTeamSlide()
{ {
int sel = _SelectSlides[_SelectSlideTeams].Selection;
_SelectSlides[_SelectSlideTeams].Visible = _Teams; _SelectSlides[_SelectSlideTeams].Visible = _Teams;
_SelectSlides[_SelectSlideTeams].Clear(); _SelectSlides[_SelectSlideTeams].Clear();
for (int i = 1; i <= _NumTeams; i++) for (int i = 1; i <= _NumTeams; i++)
_SelectSlides[_SelectSlideTeams].AddValue("Team " + i, null, i); _SelectSlides[_SelectSlideTeams].AddValue("Team " + i, null, i);
_SelectSlides[_SelectSlideTeams].Selection = Math.Min(sel, _SelectSlides[_SelectSlideTeams].NumValues - 1);
} }
private void _UpdateButtonVisibility() private void _UpdateButtonVisibility()
{ {
_Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; _Buttons[_ButtonIncreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams;
_Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; _Buttons[_ButtonDecreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams;
_Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum; _Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum;
_Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum; _Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum;
} }