From 85b16e5f32677b2587b5c5e3145a11fc6d9a5606 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Mon, 9 Apr 2012 14:01:22 +0200 Subject: [PATCH] Added warning if not all players has a profile... --- Output/Languages/Deutsch.xml | 6 +- Output/Languages/English.xml | 6 +- Output/Languages/French.xml | 6 +- Output/Languages/Spanish.xml | 6 +- Output/Themes/Ambient/Screens/ScreenNames.xml | 52 ++++++++++- .../Changelog/Changelog_ScreenNames.txt | 9 +- Vocaluxe/Base/CConfig.cs | 4 + Vocaluxe/Screens/CScreenNames.cs | 86 ++++++++++++++++--- 8 files changed, 149 insertions(+), 26 deletions(-) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 1593fd3b..3a43f076 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -108,8 +108,10 @@ 4 Spieler 5 Spieler 6 Spieler - Warnung: Dem Spieler %v ist kein Mikrofon zugeordnet! - Warnung: Den Spielern %v sind keine Mikrofone zugeordnet! + Warnung: Dem Spieler %v ist kein Mikrofon zugeordnet! + Warnung: Den Spielern %v sind keine Mikrofone zugeordnet! + Warnung: Dem Spieler %v ist kein Profil zugeordnet! + Warnung: Den Spielern %v sind keine Profile zugeordnet! Songauswahl Suche: diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 59a81e1e..8c614755 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -108,8 +108,10 @@ 4 Player 5 Player 6 Player - Warning: There is no mic assigned to player %v! - Warning: There are no mics assigned to players %v! + Warning: There is no mic assigned to player %v! + Warning: There are no mics assigned to players %v! + Warning: There is no profile assigned to player %v! + Warning: There are no profiles assigned to players %v! Song Selection Search: diff --git a/Output/Languages/French.xml b/Output/Languages/French.xml index 8021012d..fd2c6fac 100644 --- a/Output/Languages/French.xml +++ b/Output/Languages/French.xml @@ -108,8 +108,10 @@ 4 joueurs 5 joueurs 6 joueurs - Attention: Aucun micro n'est assigné au joueur %v! - Attention: Aucun micro n'est assigné aux joueurs %v! + Attention: Aucun micro n'est assigné au joueur %v! + Attention: Aucun micro n'est assigné aux joueurs %v! + Attention: Aucun profil n'est assigné au joueur %v! + Attention: Aucun profils n'est assigné aux joueurs %v! Choix de la chanson Rechercher: diff --git a/Output/Languages/Spanish.xml b/Output/Languages/Spanish.xml index a0600e84..6e06dc0b 100644 --- a/Output/Languages/Spanish.xml +++ b/Output/Languages/Spanish.xml @@ -108,8 +108,10 @@ Jugador 4 Jugador 5 Jugador 6 - Advertencia: ¡No hay micrófonos asignados al jugador %v! - Advertencia: ¡No hay micrófonos asignados a los jugadores %v! + Advertencia: ¡No hay micrófonos asignados al jugador %v! + Advertencia: ¡No hay micrófonos asignados a los jugadores %v! + Advertencia: ¡No hay perfil asignados al jugador %v! + Advertencia: ¡No hay perfiles asignados a los jugadores %v! Selección de Canciones Buscar: diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index 8b8ae42a..9b9cd572 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -221,7 +221,7 @@ - + Invisible @@ -236,7 +236,23 @@ - + + + + Invisible + + 145 + 715 + 0,00 + 990 + 50 + + + StaticWarningColor + + + + 640 @@ -426,7 +442,7 @@ - + 640 615 @@ -453,7 +469,35 @@ - + + + + 640 + 650 + + 0,00 + + 32 + + 970 + + + TextWarningColor + + + TextWarningColor + + Center + + + + Outline + + + + + + Button diff --git a/Output/Themes/Changelog/Changelog_ScreenNames.txt b/Output/Themes/Changelog/Changelog_ScreenNames.txt index e4613ca9..47d04016 100644 --- a/Output/Themes/Changelog/Changelog_ScreenNames.txt +++ b/Output/Themes/Changelog/Changelog_ScreenNames.txt @@ -5,13 +5,18 @@ Version 2: Add: - A new Theme-element for name-selecting. (One Static for each player): Static wich is used as drop-area (One Static for each player): Static wich shows the avatar of selected player (One Text for each player): Text wich shows name of selected player + + + +Rename: + to + to Remove: -, , , , , \ No newline at end of file +, , , , , diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 152d4cb3..a1d83a61 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -979,6 +979,10 @@ namespace Vocaluxe.Base CGame.Player[j].ProfileID = i; } } + else + { + CGame.Player[j].ProfileID = -1; + } } } } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 8be6c2f9..0e0a0e93 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -22,8 +22,10 @@ namespace Vocaluxe.Screens private const string NameSelection = "NameSelection"; private const string ButtonBack = "ButtonBack"; private const string ButtonStart = "ButtonStart"; - private const string TextWarning = "TextWarning"; - private const string StaticWarning = "StaticWarning"; + private const string TextWarningMics = "TextWarningMics"; + private const string StaticWarningMics = "StaticWarningMics"; + private const string TextWarningProfiles = "TextWarningProfiles"; + private const string StaticWarningProfiles = "StaticWarningProfiles"; private readonly string[] StaticPlayer = new string[] { "StaticPlayer1", "StaticPlayer2", "StaticPlayer3", "StaticPlayer4", "StaticPlayer5", "StaticPlayer6" }; private readonly string[] StaticPlayerAvatar = new string[] { "StaticPlayerAvatar1", "StaticPlayerAvatar2", "StaticPlayerAvatar3", "StaticPlayerAvatar4", "StaticPlayerAvatar5", "StaticPlayerAvatar6" }; private readonly string[] TextPlayer = new string[] { "TextPlayer1", "TextPlayer2", "TextPlayer3", "TextPlayer4", "TextPlayer5", "TextPlayer6" }; @@ -56,7 +58,8 @@ namespace Vocaluxe.Screens { statics.Add(text); } - statics.Add(StaticWarning); + statics.Add(StaticWarningMics); + statics.Add(StaticWarningProfiles); _ThemeStatics = statics.ToArray(); List texts = new List(); @@ -64,7 +67,8 @@ namespace Vocaluxe.Screens _ThemeSelectSlides = new string[] { SelectSlidePlayerNumber }; texts.Clear(); - texts.Add(TextWarning); + texts.Add(TextWarningMics); + texts.Add(TextWarningProfiles); foreach(string text in TextPlayer){ texts.Add(text); } @@ -139,6 +143,8 @@ namespace Vocaluxe.Screens //Update texture and name Statics[htStatics(StaticPlayerAvatar[selectingKeyboardPlayerNr-1])].Texture = NameSelections[htNameSelections(NameSelection)].TilePlayerAvatar(SelectedPlayerNr).Texture; Texts[htTexts(TextPlayer[selectingKeyboardPlayerNr-1])].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; + //Update profile-warning + CheckPlayers(); } //Reset all values selectingKeyboardPlayerNr = 0; @@ -381,6 +387,8 @@ namespace Vocaluxe.Screens //Update texture and name Statics[htStatics(StaticPlayerAvatar[i])].Texture = chooseAvatarStatic.Texture; Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; + //Update profile-warning + CheckPlayers(); } } } @@ -448,12 +456,16 @@ namespace Vocaluxe.Screens UpdateSlides(); UpdatePlayerNumber(); CheckMics(); + CheckPlayers(); for (int i = 0; i < CSettings.MaxNumPlayer; i++) { //Update texture and name - Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; - Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; + if (CConfig.Players[i] != String.Empty) + { + Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; + Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; + } } } @@ -527,6 +539,7 @@ namespace Vocaluxe.Screens } CConfig.SaveConfig(); CheckMics(); + CheckPlayers(); } private void CheckMics() @@ -541,8 +554,8 @@ namespace Vocaluxe.Screens } if (_PlayerWithoutMicro.Count > 0) { - Statics[htStatics(StaticWarning)].Visible = true; - Texts[htTexts(TextWarning)].Visible = true; + Statics[htStatics(StaticWarningMics)].Visible = true; + Texts[htTexts(TextWarningMics)].Visible = true; if (_PlayerWithoutMicro.Count > 1) { @@ -563,17 +576,66 @@ namespace Vocaluxe.Screens } } - Texts[htTexts(TextWarning)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_PL").Replace("%v", PlayerNums); + Texts[htTexts(TextWarningMics)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_MICS_PL").Replace("%v", PlayerNums); } else { - Texts[htTexts(TextWarning)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_SG").Replace("%v", _PlayerWithoutMicro[0].ToString()); + Texts[htTexts(TextWarningMics)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_MICS_SG").Replace("%v", _PlayerWithoutMicro[0].ToString()); } } else { - Statics[htStatics(StaticWarning)].Visible = false; - Texts[htTexts(TextWarning)].Visible = false; + Statics[htStatics(StaticWarningMics)].Visible = false; + Texts[htTexts(TextWarningMics)].Visible = false; + } + } + + private void CheckPlayers() + { + List _PlayerWithoutProfile = new List(); + for (int player = 0; player < CConfig.NumPlayer; player++) + { + if (CGame.Player[player].ProfileID < 0) + { + _PlayerWithoutProfile.Add(player + 1); + } + } + + if (_PlayerWithoutProfile.Count > 0) + { + Statics[htStatics(StaticWarningProfiles)].Visible = true; + Texts[htTexts(TextWarningProfiles)].Visible = true; + + if (_PlayerWithoutProfile.Count > 1) + { + string PlayerNums = string.Empty; + for (int i = 0; i < _PlayerWithoutProfile.Count; i++) + { + if (_PlayerWithoutProfile.Count - 1 == i) + { + PlayerNums += _PlayerWithoutProfile[i].ToString(); + } + else if (_PlayerWithoutProfile.Count - 2 == i) + { + PlayerNums += _PlayerWithoutProfile[i].ToString() + " " + CLanguage.Translate("TR_GENERAL_AND") + " "; + } + else + { + PlayerNums += _PlayerWithoutProfile[i].ToString() + ", "; + } + } + + Texts[htTexts(TextWarningProfiles)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_PROFILES_PL").Replace("%v", PlayerNums); + } + else + { + Texts[htTexts(TextWarningProfiles)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_PROFILES_SG").Replace("%v", _PlayerWithoutProfile[0].ToString()); + } + } + else + { + Statics[htStatics(StaticWarningProfiles)].Visible = false; + Texts[htTexts(TextWarningProfiles)].Visible = false; } } }