diff --git a/PartyModeChallenge/ChallengeRounds.cs b/PartyModes/PartyModeChallenge/ChallengeRounds.cs similarity index 100% rename from PartyModeChallenge/ChallengeRounds.cs rename to PartyModes/PartyModeChallenge/ChallengeRounds.cs diff --git a/PartyModeChallenge/PartyModeChallenge.cs b/PartyModes/PartyModeChallenge/PartyModeChallenge.cs similarity index 97% rename from PartyModeChallenge/PartyModeChallenge.cs rename to PartyModes/PartyModeChallenge/PartyModeChallenge.cs index af6f6f22..26f09eeb 100644 --- a/PartyModeChallenge/PartyModeChallenge.cs +++ b/PartyModes/PartyModeChallenge/PartyModeChallenge.cs @@ -38,7 +38,7 @@ namespace Vocaluxe.PartyModes public int NumPlayed; public int NumRounds; public int NumWon; - public int SumSingPoints; + public int NumSingPoints; public int NumGamePoints; public int CompareTo(object obj) @@ -50,7 +50,7 @@ namespace Vocaluxe.PartyModes int res = row.NumGamePoints.CompareTo(NumGamePoints); if (res == 0) { - res = row.SumSingPoints.CompareTo(SumSingPoints); + res = row.NumSingPoints.CompareTo(NumSingPoints); if (res == 0) { res = row.NumWon.CompareTo(NumWon); @@ -152,7 +152,7 @@ namespace Vocaluxe.PartyModes _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" }; _ScreenSongOptions.Sorting.SearchString = String.Empty; - _ScreenSongOptions.Sorting.SearchStringVisible = false; + _ScreenSongOptions.Sorting.SearchActive = false; _ScreenSongOptions.Sorting.ShowDuetSongs = false; _Stage = EStage.NotStarted; @@ -398,7 +398,7 @@ namespace Vocaluxe.PartyModes public override void SetSearchString(string SearchString, bool Visible) { _ScreenSongOptions.Sorting.SearchString = SearchString; - _ScreenSongOptions.Sorting.SearchStringVisible = Visible; + _ScreenSongOptions.Sorting.SearchActive = Visible; } public override int GetMaxPlayer() @@ -575,7 +575,7 @@ namespace Vocaluxe.PartyModes row.NumPlayed = 0; row.NumRounds = 0; row.NumWon = 0; - row.SumSingPoints = 0; + row.NumSingPoints = 0; row.NumGamePoints = 0; GameData.ResultTable.Add(row); } @@ -624,7 +624,7 @@ namespace Vocaluxe.PartyModes row.NumPlayed++; row.NumWon += points[i].Won; row.NumRounds += 1; - row.SumSingPoints += points[i].SingPoints; + row.NumSingPoints += points[i].SingPoints; row.NumGamePoints += points[i].GamePoints; GameData.ResultTable[index] = row; @@ -636,13 +636,15 @@ namespace Vocaluxe.PartyModes //Update position-number int pos = 1; - int last_points = 0; + int lastPoints = 0; + int lastSingPoints = 0; for (int i = 0; i < GameData.ResultTable.Count; i++ ) { - if (last_points > GameData.ResultTable[i].NumGamePoints) + if (lastPoints > GameData.ResultTable[i].NumGamePoints || lastSingPoints > GameData.ResultTable[i].NumSingPoints) pos++; GameData.ResultTable[i].Position = pos; - last_points = GameData.ResultTable[i].NumGamePoints; + lastPoints = GameData.ResultTable[i].NumGamePoints; + lastSingPoints = GameData.ResultTable[i].NumSingPoints; } } diff --git a/PartyModeChallenge/PartyModeChallenge.csproj b/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj similarity index 89% rename from PartyModeChallenge/PartyModeChallenge.csproj rename to PartyModes/PartyModeChallenge/PartyModeChallenge.csproj index 3155de6c..37fb7251 100644 --- a/PartyModeChallenge/PartyModeChallenge.csproj +++ b/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj @@ -5,7 +5,7 @@ x86 8.0.30703 2.0 - {6F3E1874-F28A-40E9-AFBD-31934D593679} + {5A4053F1-5AD5-441F-B254-D97A088127B6} Library Properties PartyModeChallenge @@ -20,7 +20,7 @@ true full false - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code TRACE;DEBUG;WIN prompt 4 @@ -30,7 +30,7 @@ AnyCPU none true - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code prompt 4 false @@ -42,7 +42,7 @@ true full false - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code TRACE;DEBUG;WIN prompt 4 @@ -52,7 +52,7 @@ AnyCPU none true - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code prompt 4 false @@ -64,7 +64,7 @@ true full false - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code TRACE;DEBUG;LINUX prompt 4 @@ -74,7 +74,7 @@ AnyCPU none true - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code prompt 4 false @@ -86,7 +86,7 @@ true full false - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code TRACE;DEBUG;LINUX prompt 4 @@ -96,7 +96,7 @@ AnyCPU none true - ..\Output\PartyModes\Challenge\Code + ..\..\Output\PartyModes\Challenge\Code prompt 4 false @@ -124,7 +124,7 @@ - + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC} VocaluxeLib False diff --git a/PartyModeChallenge/PartyScreenChallengeConfig.cs b/PartyModes/PartyModeChallenge/PartyScreenChallengeConfig.cs similarity index 100% rename from PartyModeChallenge/PartyScreenChallengeConfig.cs rename to PartyModes/PartyModeChallenge/PartyScreenChallengeConfig.cs diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs similarity index 98% rename from PartyModeChallenge/PartyScreenChallengeMain.cs rename to PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs index 717bc7de..072b82a6 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -421,6 +421,9 @@ namespace Vocaluxe.PartyModes int NumPlayerInOneRow = 3; if (GameState.NumPlayerAtOnce <= NumPlayerInOneRow) NumRoundsVisible = 5; + else + NumRoundsVisible = 3; + if (NumRoundsVisible > GameState.Combs.Count) NumRoundsVisible = GameState.Combs.Count; @@ -496,9 +499,14 @@ namespace Vocaluxe.PartyModes RoundsTable[i].TextScores[p].Visible = false; } } - if (GameState.Combs.Count < i + RoundsTableOffset) + if (GameState.Combs.Count < i + RoundsTableOffset || i + 1 > NumRoundsVisible) { RoundsTable[i].Number.Visible = false; + for (int p = 0; p < RoundsTable[i].TextPlayer.Count; p++) + { + RoundsTable[i].TextPlayer[p].Visible = false; + RoundsTable[i].TextScores[p].Visible = false; + } } } @@ -580,7 +588,7 @@ namespace Vocaluxe.PartyModes row.Name.Text = profiles[GameState.ResultTable[i+PlayerTableOffset].PlayerID].PlayerName; row.Rounds.Text = GameState.ResultTable[i+PlayerTableOffset].NumRounds.ToString(); row.Won.Text = GameState.ResultTable[i+PlayerTableOffset].NumWon.ToString(); - row.SingPoints.Text = GameState.ResultTable[i+PlayerTableOffset].SumSingPoints.ToString(); + row.SingPoints.Text = GameState.ResultTable[i+PlayerTableOffset].NumSingPoints.ToString(); row.GamePoints.Text = GameState.ResultTable[i+PlayerTableOffset].NumGamePoints.ToString(); } else diff --git a/PartyModeChallenge/PartyScreenChallengeNames.cs b/PartyModes/PartyModeChallenge/PartyScreenChallengeNames.cs similarity index 100% rename from PartyModeChallenge/PartyScreenChallengeNames.cs rename to PartyModes/PartyModeChallenge/PartyScreenChallengeNames.cs diff --git a/PartyModeTicTacToe/PartyModeTicTacToe.cs b/PartyModes/PartyModeTicTacToe/PartyModeTicTacToe.cs similarity index 99% rename from PartyModeTicTacToe/PartyModeTicTacToe.cs rename to PartyModes/PartyModeTicTacToe/PartyModeTicTacToe.cs index 5945dafc..a00fb8db 100644 --- a/PartyModeTicTacToe/PartyModeTicTacToe.cs +++ b/PartyModes/PartyModeTicTacToe/PartyModeTicTacToe.cs @@ -137,7 +137,7 @@ namespace Vocaluxe.PartyModes _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" }; _ScreenSongOptions.Sorting.SearchString = String.Empty; - _ScreenSongOptions.Sorting.SearchStringVisible = false; + _ScreenSongOptions.Sorting.SearchActive = false; _ScreenSongOptions.Sorting.ShowDuetSongs = false; _Stage = EStage.NotStarted; @@ -394,7 +394,7 @@ namespace Vocaluxe.PartyModes public override void SetSearchString(string SearchString, bool Visible) { _ScreenSongOptions.Sorting.SearchString = SearchString; - _ScreenSongOptions.Sorting.SearchStringVisible = Visible; + _ScreenSongOptions.Sorting.SearchActive = Visible; } public override int GetMaxPlayer() diff --git a/PartyModeTicTacToe/PartyModeTicTacToe.csproj b/PartyModes/PartyModeTicTacToe/PartyModeTicTacToe.csproj similarity index 90% rename from PartyModeTicTacToe/PartyModeTicTacToe.csproj rename to PartyModes/PartyModeTicTacToe/PartyModeTicTacToe.csproj index ff09b7c4..c5121e47 100644 --- a/PartyModeTicTacToe/PartyModeTicTacToe.csproj +++ b/PartyModes/PartyModeTicTacToe/PartyModeTicTacToe.csproj @@ -20,7 +20,7 @@ true full false - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code TRACE;DEBUG;WIN prompt 4 @@ -30,7 +30,7 @@ AnyCPU none true - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code prompt 4 false @@ -42,7 +42,7 @@ true full false - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code TRACE;DEBUG;WIN prompt 4 @@ -52,7 +52,7 @@ AnyCPU none true - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code prompt 4 false @@ -64,7 +64,7 @@ true full false - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code TRACE;DEBUG;LINUX prompt 4 @@ -74,7 +74,7 @@ AnyCPU none true - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code prompt 4 false @@ -86,7 +86,7 @@ true full false - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code TRACE;DEBUG;LINUX prompt 4 @@ -96,7 +96,7 @@ AnyCPU none true - ..\Output\PartyModes\TicTacToe\Code + ..\..\Output\PartyModes\TicTacToe\Code prompt 4 false @@ -121,7 +121,7 @@ - + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC} VocaluxeLib False @@ -142,4 +142,4 @@ --> - + \ No newline at end of file diff --git a/PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs similarity index 100% rename from PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs rename to PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs diff --git a/PartyModeTicTacToe/PartyScreenTicTacToeMain.cs b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeMain.cs similarity index 100% rename from PartyModeTicTacToe/PartyScreenTicTacToeMain.cs rename to PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeMain.cs diff --git a/PartyModeTicTacToe/PartyScreenTicTacToeNames.cs b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeNames.cs similarity index 100% rename from PartyModeTicTacToe/PartyScreenTicTacToeNames.cs rename to PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeNames.cs diff --git a/Vocaluxe.sln b/Vocaluxe.sln index 3c53f336..e8b0335b 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -9,9 +9,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vocaluxe", "Vocaluxe\Vocalu EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VocaluxeLib", "VocaluxeLib\VocaluxeLib.csproj", "{D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PartyModeTicTacToe", "PartyModeTicTacToe\PartyModeTicTacToe.csproj", "{6F3E1874-F28A-40E9-AFBD-31934D593679}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PartyModeTicTacToe", "PartyModes\PartyModeTicTacToe\PartyModeTicTacToe.csproj", "{6F3E1874-F28A-40E9-AFBD-31934D593679}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PartyModeChallenge", "PartyModeChallenge\PartyModeChallenge.csproj", "{162341B8-965F-46BC-9826-86B9A1E7F984}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PartyModeChallenge", "PartyModes\PartyModeChallenge\PartyModeChallenge.csproj", "{5A4053F1-5AD5-441F-B254-D97A088127B6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -44,37 +44,51 @@ Global {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.ActiveCfg = DebugLinux|x64 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.Build.0 = DebugLinux|x64 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x86.ActiveCfg = DebugLinux|x86 + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x86.Build.0 = DebugLinux|x86 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.ActiveCfg = DebugWin|x64 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.Build.0 = DebugWin|x64 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x86.ActiveCfg = DebugWin|x86 + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x86.Build.0 = DebugWin|x86 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64 + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x64.Build.0 = ReleaseLinux|x64 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86 + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 + {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x64.ActiveCfg = DebugLinux|x64 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x64.Build.0 = DebugLinux|x64 {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x86.ActiveCfg = DebugLinux|x86 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x86.Build.0 = DebugLinux|x86 {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x64.ActiveCfg = DebugWin|x64 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x64.Build.0 = DebugWin|x64 {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x86.ActiveCfg = DebugWin|x86 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x86.Build.0 = DebugWin|x86 {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x64.Build.0 = ReleaseLinux|x64 {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86 {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugLinux|x64.ActiveCfg = DebugLinux|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugLinux|x64.Build.0 = DebugLinux|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugLinux|x86.ActiveCfg = DebugLinux|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugLinux|x86.Build.0 = DebugLinux|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugWin|x64.ActiveCfg = DebugWin|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugWin|x64.Build.0 = DebugWin|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugWin|x86.ActiveCfg = DebugWin|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.DebugWin|x86.Build.0 = DebugWin|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseLinux|x64.Build.0 = ReleaseLinux|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 - {162341B8-965F-46BC-9826-86B9A1E7F984}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 + {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x64.ActiveCfg = DebugLinux|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x64.Build.0 = DebugLinux|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x86.ActiveCfg = DebugLinux|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugLinux|x86.Build.0 = DebugLinux|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x64.ActiveCfg = DebugWin|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x64.Build.0 = DebugWin|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x86.ActiveCfg = DebugWin|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.DebugWin|x86.Build.0 = DebugWin|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x64.Build.0 = ReleaseLinux|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 + {5A4053F1-5AD5-441F-B254-D97A088127B6}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs index 481d6913..fc878e72 100644 --- a/Vocaluxe/Base/CDataBase.cs +++ b/Vocaluxe/Base/CDataBase.cs @@ -716,7 +716,15 @@ namespace Vocaluxe.Base SData data = new SData(); data.id = reader.GetInt32(0); data.str1 = reader.GetString(1); - data.ticks = UnixTimeToTicks((int)reader.GetInt64(2)); + Int64 ticks = 0; + + try + { + ticks = reader.GetInt64(2); + } + catch { } + + data.ticks = UnixTimeToTicks((int)ticks); scores.Add(data); } diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 77a3098b..b64d1366 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -42,7 +42,7 @@ namespace Vocaluxe.Base public const int iVersionSub = 0; // patches public const ERevision VersionRevision = ERevision.Alpha; - public const int iBuild = 74; // Increase on every published version! Never Reset! + public const int iBuild = 75; // Increase on every published version! Never Reset! public const int iDatabaseHighscoreVersion = 2; public const int iDatabaseCoverVersion = 1; diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index 4c2ec4a0..a265098b 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -62,7 +62,7 @@ namespace Vocaluxe.Base get { return _SearchFilter; } set { - if (value.Length > 0) + if (value != String.Empty) { _Sort(_SongSorting, EOffOn.TR_CONFIG_OFF, _IgnoreArticles, value, false, _ShowDuetSongs); } @@ -406,7 +406,15 @@ namespace Vocaluxe.Base _SongList.Add(song); else { - if (song.Title.ToUpper().Contains(_SearchFilter.ToUpper()) || song.Artist.ToUpper().Contains(_SearchFilter.ToUpper())) + string search = song.Title.ToUpper() + " " + song.Artist.ToUpper() + " " + song.FolderName.ToUpper() + " " + song.FileName.ToUpper(); + string[] searchStrings = _SearchFilter.ToUpper().Split(new char[]{' '}); + bool contains = searchStrings != null; + + foreach (string str in searchStrings) + { + contains &= search.Contains(str); + } + if (contains) _SongList.Add(song); } } diff --git a/Vocaluxe/Doc/Roadmap.txt b/Vocaluxe/Doc/Roadmap.txt index ccd85b0b..6af47fe7 100644 --- a/Vocaluxe/Doc/Roadmap.txt +++ b/Vocaluxe/Doc/Roadmap.txt @@ -77,7 +77,7 @@ - Theme System Update - A nicer Theme! -+ v0.2.0: ++ v0.2.0 (reached: 21.12.2012): - Medley - Sing Short Version Mode - Show Avatars and Player Name in Sing Screen diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index fac4cc92..dfebbfd5 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -659,7 +659,7 @@ namespace Vocaluxe.Screens _sso = CParty.GetSongSelectionOptions(); CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString, _sso.Sorting.ShowDuetSongs); - _SearchActive = _sso.Sorting.SearchStringVisible; + _SearchActive = _sso.Sorting.SearchActive; _SearchText = _sso.Sorting.SearchString; CGame.EnterNormalGame(); @@ -744,8 +744,6 @@ namespace Vocaluxe.Screens base.OnClose(); CBackgroundMusic.Disabled = false; SongMenus[htSongMenus(SongMenu)].OnHide(); - - CParty.SetSearchString(_SearchText, _SearchActive); } public override void ApplyVolume() @@ -794,10 +792,10 @@ namespace Vocaluxe.Screens if (_sso.Selection.PartyMode) { CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString, _sso.Sorting.ShowDuetSongs); - _SearchActive = _sso.Sorting.SearchStringVisible; + _SearchActive = _sso.Sorting.SearchActive; _SearchText = _sso.Sorting.SearchString; + ClosePlaylist(); - Playlists[htPlaylists(Playlist)].ClosePlaylist(); ToggleSongOptions(ESongOptionsView.None); } @@ -1078,31 +1076,37 @@ namespace Vocaluxe.Screens private void ApplyNewSearchFilter(string NewFilterString) { - int song = SongMenus[htSongMenus(SongMenu)].GetSelectedSong(); - int id = -1; - if (song > -1 && song < CSongs.NumVisibleSongs) - { - id = CSongs.VisibleSongs[song].ID; - } - + CParty.SetSearchString(NewFilterString, _SearchActive); + _sso = CParty.GetSongSelectionOptions(); + + bool refresh = false; _SearchText = NewFilterString; - CSongs.SearchFilter = _SearchText; - if (NewFilterString != String.Empty) - CSongs.Category = 0; - else - CSongs.Category = -1; - - if (id > -1) + int SongIndex = SongMenus[htSongMenus(SongMenu)].GetSelectedSong(); + int SongID = -1; + if (SongIndex != -1 && CSongs.NumVisibleSongs > 0 && CSongs.NumVisibleSongs > SongIndex) { - if (CSongs.NumVisibleSongs > 0) - { - if (id != CSongs.VisibleSongs[0].ID) - SongMenus[htSongMenus(SongMenu)].OnHide(); - } + SongID = CSongs.VisibleSongs[SongIndex].ID; } - if (CSongs.NumVisibleSongs == 0) + if (NewFilterString == String.Empty && _sso.Sorting.Tabs == EOffOn.TR_CONFIG_ON) + { + CSongs.Category = -1; + refresh = true; + } + + if (NewFilterString != String.Empty && CSongs.Category != 0) + { + CSongs.Category = 0; + refresh = true; + } + + CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, NewFilterString, _sso.Sorting.ShowDuetSongs); + + if (SongID == -1 || CSongs.NumVisibleSongs == 0 || CSongs.NumVisibleSongs <= SongIndex || CSongs.VisibleSongs[SongIndex].ID != SongID) + refresh = true; + + if (refresh) SongMenus[htSongMenus(SongMenu)].OnHide(); SongMenus[htSongMenus(SongMenu)].OnShow(); @@ -1250,10 +1254,14 @@ namespace Vocaluxe.Screens private void ClosePlaylist() { - SongMenus[htSongMenus(SongMenu)].SetSmallView(false); - _PlaylistActive = false; - Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; - SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + if (Playlists[htPlaylists(Playlist)].Visible || _PlaylistActive) + { + SongMenus[htSongMenus(SongMenu)].SetSmallView(false); + _PlaylistActive = false; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + Playlists[htPlaylists(Playlist)].ClosePlaylist(); + } } private void UpdatePlaylistNames() diff --git a/VocaluxeLib/PartyModes/CPartyModeNone.cs b/VocaluxeLib/PartyModes/CPartyModeNone.cs index 623ac0f8..27436373 100644 --- a/VocaluxeLib/PartyModes/CPartyModeNone.cs +++ b/VocaluxeLib/PartyModes/CPartyModeNone.cs @@ -19,7 +19,7 @@ namespace Vocaluxe.PartyModes _ScreenSongOptions.Selection.SongIndex = -1; _ScreenSongOptions.Sorting.SearchString = String.Empty; - _ScreenSongOptions.Sorting.SearchStringVisible = false; + _ScreenSongOptions.Sorting.SearchActive = false; _ScreenSongOptions.Sorting.ShowDuetSongs = true; } @@ -27,6 +27,10 @@ namespace Vocaluxe.PartyModes { _ScreenSongOptions.Sorting.SongSorting = _Base.Config.GetSongSorting(); _ScreenSongOptions.Sorting.Tabs = _Base.Config.GetTabs(); + + if (_ScreenSongOptions.Sorting.SearchActive) + _ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_OFF; + _ScreenSongOptions.Sorting.IgnoreArticles = _Base.Config.GetIgnoreArticles(); return _ScreenSongOptions; @@ -35,7 +39,7 @@ namespace Vocaluxe.PartyModes public override void SetSearchString(string SearchString, bool Visible) { _ScreenSongOptions.Sorting.SearchString = SearchString; - _ScreenSongOptions.Sorting.SearchStringVisible = Visible; + _ScreenSongOptions.Sorting.SearchActive = Visible; } } } diff --git a/VocaluxeLib/PartyModes/IPartyMode.cs b/VocaluxeLib/PartyModes/IPartyMode.cs index 4ef1a7f2..3248db10 100644 --- a/VocaluxeLib/PartyModes/IPartyMode.cs +++ b/VocaluxeLib/PartyModes/IPartyMode.cs @@ -19,7 +19,7 @@ namespace Vocaluxe.PartyModes public EOffOn Tabs; public EOffOn IgnoreArticles; public string SearchString; - public bool SearchStringVisible; + public bool SearchActive; public bool ShowDuetSongs; }