From d2516d4ad013c22669c398ae511b8fc7360a4229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sat, 27 Apr 2013 16:38:22 +0200 Subject: [PATCH] Double click on profile to use it for next free player. --- Vocaluxe/Screens/CScreenNames.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 16440de2..16642327 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -452,6 +452,33 @@ namespace Vocaluxe.Screens _NameSelections[_NameSelection].UpdateList(); } + if (mouseEvent.LD && _NameSelections[_NameSelection].IsOverTile(mouseEvent) && !_SelectingFast) + { + _SelectedPlayerNr = _NameSelections[_NameSelection].TilePlayerNr(mouseEvent); + if (_SelectedPlayerNr > -1) + { + for (int i = 0; i < CGame.NumPlayer; i++) + { + if (CGame.Players[i].ProfileID == -1) + { + //Update Game-infos with new player + CGame.Players[i].ProfileID = _SelectedPlayerNr; + //Update config for default players. + CConfig.Players[i] = CProfiles.Profiles[_SelectedPlayerNr].ProfileFile; + CConfig.SaveConfig(); + //Update texture and name + _Statics[_StaticPlayerAvatar[i]].Texture = CProfiles.Profiles[_SelectedPlayerNr].Avatar.Texture; + _Texts[_TextPlayer[i]].Text = CProfiles.Profiles[_SelectedPlayerNr].PlayerName; + //Update profile-warning + _CheckPlayers(); + //Update Tiles-List + _NameSelections[_NameSelection].UpdateList(); + break; + } + } + } + } + if (mouseEvent.RB && _SelectingFast) stopSelectingFast = true; else if (mouseEvent.RB)