Merge branch 'develop' of github.com:flokuep/Vocaluxe into release-0.3

This commit is contained in:
Florian Küpper committed 2013-06-27 15:54:40 +02:00
commit b444438862
4 files changed
+53 -99

No files matched your search

+1
View File
@@ -92,6 +92,7 @@
<string name="TR_SCREENPARTY_AUTHOR">Author</string> <string name="TR_SCREENPARTY_AUTHOR">Author</string>
<string name="TR_SCREENPARTY_VERSION">Version</string> <string name="TR_SCREENPARTY_VERSION">Version</string>
<string name="TR_SCREENPARTY_ERROR">Can't load this party-mode.</string> <string name="TR_SCREENPARTY_ERROR">Can't load this party-mode.</string>
<string name="TR_SCREENPARTY_ERROR_MICS">There are no mics configured!</string>
<string name="TR_SCREENPARTY_TARGETAUDIENCE">Target audience</string> <string name="TR_SCREENPARTY_TARGETAUDIENCE">Target audience</string>
<string name="TR_SCREENPARTY_NOTEAMS">No teams</string> <string name="TR_SCREENPARTY_NOTEAMS">No teams</string>
<string name="TR_SCREENPARTY_NUMTEAMS">Number of teams</string> <string name="TR_SCREENPARTY_NUMTEAMS">Number of teams</string>
+5
View File
@@ -481,6 +481,11 @@ namespace Vocaluxe.Base
return _Profiles[profileID].Avatar.ID; return _Profiles[profileID].Avatar.ID;
} }
public static int GetProfileID(int num)
{
return _Profiles[num].ID;
}
#endregion profile properties #endregion profile properties
#region avatar texture #region avatar texture
+46 -98
View File
@@ -177,23 +177,12 @@ namespace Vocaluxe.Screens
//Check, if a player is selected //Check, if a player is selected
if (_NameSelections[_NameSelection].Selection > -1) if (_NameSelections[_NameSelection].Selection > -1)
{ {
CProfile[] profiles = CProfiles.GetProfiles();
_SelectedPlayerNr = _NameSelections[_NameSelection].Selection; _SelectedPlayerNr = _NameSelections[_NameSelection].Selection;
if (profiles.Length <= _SelectedPlayerNr) if (CProfiles.NumProfiles <= _SelectedPlayerNr)
return true; return true;
//Update Game-infos with new player _UpdateSelectedProfile(_SelectingFastPlayerNr - 1, _SelectedPlayerNr);
CGame.Players[_SelectingFastPlayerNr - 1].ProfileID = profiles[_SelectedPlayerNr].ID;
//Update config for default players.
CConfig.Players[_SelectingFastPlayerNr - 1] = profiles[_SelectedPlayerNr].FileName;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingFastPlayerNr - 1]].Texture = profiles[_SelectedPlayerNr].Avatar.Texture;
_Texts[_TextPlayer[_SelectingFastPlayerNr - 1]].Text = profiles[_SelectedPlayerNr].PlayerName;
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
_SetInteractionToButton(_Buttons[_ButtonStart]); _SetInteractionToButton(_Buttons[_ButtonStart]);
} }
//Started selecting with 'P' //Started selecting with 'P'
@@ -242,15 +231,7 @@ namespace Vocaluxe.Screens
case Keys.Delete: case Keys.Delete:
//Delete profile-selection //Delete profile-selection
CGame.Players[_SelectingFastPlayerNr - 1].ProfileID = -1; _ResetPlayerSelection(_SelectingFastPlayerNr - 1);
//Update config for default players.
CConfig.Players[_SelectingFastPlayerNr - 1] = String.Empty;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingFastPlayerNr - 1]].Texture = _OriginalPlayerAvatarTextures[_SelectingFastPlayerNr - 1];
_Texts[_TextPlayer[_SelectingFastPlayerNr - 1]].Text = CProfiles.GetPlayerName(-1, _SelectingFastPlayerNr);
//Update profile-warning
_CheckPlayers();
//Reset all values //Reset all values
_SelectingFastPlayerNr = 0; _SelectingFastPlayerNr = 0;
_SelectingKeyboardActive = false; _SelectingKeyboardActive = false;
@@ -430,54 +411,23 @@ namespace Vocaluxe.Screens
{ {
if (_SelectingSwitchNr > -1 && CGame.Players[i].ProfileID > -1) if (_SelectingSwitchNr > -1 && CGame.Players[i].ProfileID > -1)
{ {
//Update Game-infos with new player _UpdateSelectedProfile(_SelectingSwitchNr, CGame.Players[i].ProfileID);
CGame.Players[_SelectingSwitchNr].ProfileID = CGame.Players[i].ProfileID;
//Update config for default players.
CConfig.Players[_SelectingSwitchNr] = CProfiles.GetProfileFileName(CGame.Players[i].ProfileID);
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingSwitchNr]].Texture = CProfiles.GetAvatarTextureFromProfile(CGame.Players[i].ProfileID);
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.GetPlayerName(CGame.Players[i].ProfileID);
} }
else if (_SelectingSwitchNr > -1) else if (_SelectingSwitchNr > -1)
{ {
//Update Game-infos with new player _ResetPlayerSelection(_SelectingSwitchNr);
CGame.Players[_SelectingSwitchNr].ProfileID = -1;
//Update config for default players.
CConfig.Players[_SelectingSwitchNr] = string.Empty;
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingSwitchNr]].Texture = _OriginalPlayerAvatarTextures[_SelectingSwitchNr];
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.GetPlayerName(-1, (_SelectingSwitchNr + 1));
} }
CProfile[] profiles = CProfiles.GetProfiles(); if (CProfiles.NumProfiles <= _SelectedPlayerNr)
if (profiles.Length <= _SelectedPlayerNr)
return true; return true;
//Update Game-infos with new player _UpdateSelectedProfile(i, _SelectedPlayerNr);
CGame.Players[i].ProfileID = profiles[_SelectedPlayerNr].ID;
//Update config for default players.
CConfig.Players[i] = profiles[_SelectedPlayerNr].FileName;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[i]].Texture = _ChooseAvatarStatic.Texture;
_Texts[_TextPlayer[i]].Text = profiles[_SelectedPlayerNr].PlayerName;
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
break; break;
} }
//Selected player is dropped out of area //Selected player is dropped out of area
if (_SelectingSwitchNr > -1) if (_SelectingSwitchNr > -1)
{ {
//Update Game-infos with new player _ResetPlayerSelection(_SelectingSwitchNr);
CGame.Players[_SelectingSwitchNr].ProfileID = -1;
//Update config for default players.
CConfig.Players[_SelectingSwitchNr] = string.Empty;
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingSwitchNr]].Texture = _OriginalPlayerAvatarTextures[_SelectingSwitchNr];
_Texts[_TextPlayer[_SelectingSwitchNr]].Text = CProfiles.GetPlayerName(-1, (_SelectingSwitchNr + 1));
_NameSelections[_NameSelection].UpdateList();
} }
} }
_SelectingSwitchNr = -1; _SelectingSwitchNr = -1;
@@ -494,22 +444,11 @@ namespace Vocaluxe.Screens
_SelectedPlayerNr = _NameSelections[_NameSelection].TilePlayerNr(mouseEvent); _SelectedPlayerNr = _NameSelections[_NameSelection].TilePlayerNr(mouseEvent);
if (_SelectedPlayerNr != -1) if (_SelectedPlayerNr != -1)
{ {
CProfile[] profiles = CProfiles.GetProfiles(); if (CProfiles.NumProfiles <= _SelectedPlayerNr)
if (profiles.Length <= _SelectedPlayerNr)
return true; return true;
//Update Game-infos with new player _UpdateSelectedProfile(_SelectingFastPlayerNr - 1, _SelectedPlayerNr);
CGame.Players[_SelectingFastPlayerNr - 1].ProfileID = profiles[_SelectedPlayerNr].ID;
//Update config for default players.
CConfig.Players[_SelectingFastPlayerNr - 1] = profiles[_SelectedPlayerNr].FileName;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[_SelectingFastPlayerNr - 1]].Texture = profiles[_SelectedPlayerNr].Avatar.Texture;
_Texts[_TextPlayer[_SelectingFastPlayerNr - 1]].Text = profiles[_SelectedPlayerNr].PlayerName;
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
_SelectingFastPlayerNr++; _SelectingFastPlayerNr++;
if (_SelectingFastPlayerNr <= CGame.NumPlayer) if (_SelectingFastPlayerNr <= CGame.NumPlayer)
_NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr); _NameSelections[_NameSelection].FastSelection(true, _SelectingFastPlayerNr);
@@ -541,22 +480,10 @@ namespace Vocaluxe.Screens
{ {
if (CGame.Players[i].ProfileID == -1) if (CGame.Players[i].ProfileID == -1)
{ {
CProfile[] profiles = CProfiles.GetProfiles(); if (CProfiles.NumProfiles <= _SelectedPlayerNr)
if (profiles.Length <= _SelectedPlayerNr)
return true; return true;
//Update Game-infos with new player _UpdateSelectedProfile(i, _SelectedPlayerNr);
CGame.Players[i].ProfileID = profiles[_SelectedPlayerNr].ID;
//Update config for default players.
CConfig.Players[i] = profiles[_SelectedPlayerNr].FileName;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[i]].Texture = profiles[_SelectedPlayerNr].Avatar.Texture;
_Texts[_TextPlayer[i]].Text = profiles[_SelectedPlayerNr].PlayerName;
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
break; break;
} }
} }
@@ -573,17 +500,7 @@ namespace Vocaluxe.Screens
{ {
if (CHelper.IsInBounds(_Statics[_StaticPlayer[i]].Rect, mouseEvent)) if (CHelper.IsInBounds(_Statics[_StaticPlayer[i]].Rect, mouseEvent))
{ {
CGame.Players[i].ProfileID = -1; _ResetPlayerSelection(i);
//Update config for default players.
CConfig.Players[i] = String.Empty;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[i]].Texture = _OriginalPlayerAvatarTextures[i];
_Texts[_TextPlayer[i]].Text = CProfiles.GetPlayerName(-1, i + 1);
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
exit = false; exit = false;
} }
} }
@@ -760,6 +677,22 @@ namespace Vocaluxe.Screens
_CheckPlayers(); _CheckPlayers();
} }
private void _UpdateSelectedProfile(int playerNum, int profileId)
{
//Update Game-infos with new player
CGame.Players[playerNum].ProfileID = profileId;
//Update config for default players.
CConfig.Players[playerNum] = CProfiles.GetProfileFileName(profileId);
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[playerNum]].Texture = CProfiles.GetAvatarTextureFromProfile(profileId);
_Texts[_TextPlayer[playerNum]].Text = CProfiles.GetPlayerName(profileId);
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
}
private void _ResetPlayerSelections() private void _ResetPlayerSelections()
{ {
for (int i = 0; i < CGame.NumPlayer; i++) for (int i = 0; i < CGame.NumPlayer; i++)
@@ -775,6 +708,21 @@ namespace Vocaluxe.Screens
CConfig.SaveConfig(); CConfig.SaveConfig();
} }
private void _ResetPlayerSelection(int playerNum)
{
CGame.Players[playerNum].ProfileID = -1;
//Update config for default players.
CConfig.Players[playerNum] = String.Empty;
CConfig.SaveConfig();
//Update texture and name
_Statics[_StaticPlayerAvatar[playerNum]].Texture = _OriginalPlayerAvatarTextures[playerNum];
_Texts[_TextPlayer[playerNum]].Text = CProfiles.GetPlayerName(-1, playerNum + 1);
//Update profile-warning
_CheckPlayers();
//Update Tiles-List
_NameSelections[_NameSelection].UpdateList();
}
private void _CheckMics() private void _CheckMics()
{ {
List<int> playerWithoutMicro = new List<int>(); List<int> playerWithoutMicro = new List<int>();
+1 -1
View File
@@ -515,7 +515,7 @@ namespace VocaluxeLib.Menu
} }
} }
if (visible) if (visible)
_VisibleProfiles.Add(i); _VisibleProfiles.Add(profiles[i].ID);
} }
} }