private void _LoadPlayerPanels() { for (int i = 0; i < CGame.NumPlayers; i++) { _NameSelections[_NameSelection].UseProfile(CGame.Players[i].ProfileID); _Statics[_PlayerStaticAvatar[i]].Texture = CProfiles.IsProfileIDValid(CGame.Players[i].ProfileID) ? CProfiles.GetAvatarTextureFromProfile(CGame.Players[i].ProfileID) : _OriginalPlayerAvatarTextures[i]; _Texts[_PlayerText[i]].Text = CProfiles.GetPlayerName(CGame.Players[i].ProfileID, i + 1); } _PopulateVoiceSelection(); }
private void _UpdateSelectedProfile(int playerNum, Guid profileId) { _NameSelections[_NameSelection].RemoveUsedProfile(CGame.Players[playerNum].ProfileID); _NameSelections[_NameSelection].UseProfile(profileId); //Update Game-infos with new player CGame.Players[playerNum].ProfileID = profileId; //Update config for default players. CConfig.Config.Game.Players[playerNum] = CProfiles.GetProfileFileName(profileId); CConfig.SaveConfig(); //Update texture and name _Statics[_PlayerStaticAvatar[playerNum]].Texture = CProfiles.GetAvatarTextureFromProfile(profileId); _Texts[_PlayerText[playerNum]].Text = CProfiles.GetPlayerName(profileId); //Update profile-warning //_CheckPlayers(); //Update Tiles-List _NameSelections[_NameSelection].UpdateList(); }
private void _LoadProfiles() { _NameSelections[_NameSelection].UpdateList(); _UpdateSlides(); _UpdatePlayerNumber(); _CheckMics(); _CheckPlayers(); CSong firstSong = CGame.GetSong(0); for (int i = 0; i < CSettings.MaxNumPlayer; i++) { _NameSelections[_NameSelection].UseProfile(CGame.Players[i].ProfileID); _Statics[_StaticPlayerAvatar[i]].Texture = CProfiles.IsProfileIDValid(CGame.Players[i].ProfileID) ? CProfiles.GetAvatarTextureFromProfile(CGame.Players[i].ProfileID) : _OriginalPlayerAvatarTextures[i]; _Texts[_TextPlayer[i]].Text = CProfiles.GetPlayerName(CGame.Players[i].ProfileID, i + 1); if (CGame.GetNumSongs() == 1 && firstSong.IsDuet) { _SelectSlides[_SelectSlideDuetPlayer[i]].Clear(); _SelectSlides[_SelectSlideDuetPlayer[i]].Visible = i + 1 <= CGame.NumPlayers; for (int j = 0; j < firstSong.Notes.VoiceCount; j++) { _SelectSlides[_SelectSlideDuetPlayer[i]].AddValue(firstSong.Notes.VoiceNames[j]); } _SelectSlides[_SelectSlideDuetPlayer[i]].Selection = i % 2; } else { _SelectSlides[_SelectSlideDuetPlayer[i]].Visible = false; } } _NameSelections[_NameSelection].UpdateList(); _ProfilesChanged = false; _AvatarsChanged = false; }
private void _UpdateRatings() { CSong song = null; var players = new SPlayer[CGame.NumPlayers]; if (_Round >= 0) { song = CGame.GetSong(_Round); if (song == null) { return; } _Texts[_TextSong].Text = song.Artist + " - " + song.Title; if (_Points.NumRounds > 1) { _Texts[_TextSong].Text += " (" + (_Round + 1) + "/" + _Points.NumRounds + ")"; } players = _Points.GetPlayer(_Round, CGame.NumPlayers); } else { _Texts[_TextSong].Text = "TR_SCREENSCORE_OVERALLSCORE"; for (int i = 0; i < CGame.NumRounds; i++) { SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayers); for (int p = 0; p < players.Length; p++) { if (i < 1) { players[p].ProfileID = points[p].ProfileID; } players[p].Points += points[p].Points; } } for (int p = 0; p < players.Length; p++) { players[p].Points = (int)Math.Round(players[p].Points / CGame.NumRounds); } } for (int p = 0; p < players.Length; p++) { string name = CProfiles.GetPlayerName(players[p].ProfileID, p); if (song != null && song.IsDuet) { if (song.Notes.VoiceNames.IsSet(players[p].VoiceNr)) { name += " (" + song.Notes.VoiceNames[players[p].VoiceNr] + ")"; } } _Texts[_TextNames[p, CGame.NumPlayers - 1]].Text = name; if (CGame.NumPlayers < (int)_ScreenSettings[_ScreenSettingShortScore].GetValue()) { _Texts[_TextScores[p, CGame.NumPlayers - 1]].Text = ((int)Math.Round(players[p].Points)).ToString("0000") + " " + CLanguage.Translate("TR_SCREENSCORE_POINTS"); } else { _Texts[_TextScores[p, CGame.NumPlayers - 1]].Text = ((int)Math.Round(players[p].Points)).ToString("0000"); } if (CGame.NumPlayers < (int)_ScreenSettings[_ScreenSettingShortDifficulty].GetValue()) { _Texts[_TextDifficulty[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_GAMEDIFFICULTY") + ": " + CLanguage.Translate(CProfiles.GetDifficulty(players[p].ProfileID).ToString()); } else { _Texts[_TextDifficulty[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate(CProfiles.GetDifficulty(players[p].ProfileID).ToString()); } if (CGame.NumPlayers < (int)_ScreenSettings[_ScreenSettingShortRating].GetValue()) { _Texts[_TextRatings[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_RATING") + ": " + CLanguage.Translate(_GetRating((int)Math.Round(players[p].Points))); } else { _Texts[_TextRatings[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate(_GetRating((int)Math.Round(players[p].Points))); } _ProgressBars[_ProgressBarPoints[p, CGame.NumPlayers - 1]].Progress = (float)players[p].Points / CSettings.MaxScore; if (CProfiles.IsProfileIDValid(players[p].ProfileID)) { _Statics[_StaticAvatar[p, CGame.NumPlayers - 1]].Texture = CProfiles.GetAvatarTextureFromProfile(players[p].ProfileID); } } }
private void _UpdateRatings() { CSong song = null; var players = new SPlayer[CGame.NumPlayers]; if (_Round >= 0) { song = CGame.GetSong(_Round); if (song == null) { return; } _Texts[_TextSong].Text = song.Artist + " - " + song.Title; if (_Points.NumRounds > 1) { _Texts[_TextSong].Text += " (" + (_Round + 1) + "/" + _Points.NumRounds + ")"; } players = _Points.GetPlayer(_Round, CGame.NumPlayers); } else { _Texts[_TextSong].Text = "TR_SCREENSCORE_OVERALLSCORE"; for (int i = 0; i < CGame.NumRounds; i++) { SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayers); for (int p = 0; p < players.Length; p++) { if (i < 1) { players[p].ProfileID = points[p].ProfileID; } players[p].Points += points[p].Points; } } for (int p = 0; p < players.Length; p++) { players[p].Points = (int)Math.Round(players[p].Points / CGame.NumRounds); } } var pointAnimDirection = (string)_ScreenSettings[_ScreenSettingAnimationDirection].GetValue(); for (int p = 0; p < players.Length; p++) { string name = CProfiles.GetPlayerName(players[p].ProfileID, p); if (song != null && song.IsDuet) { if (song.Notes.VoiceNames.IsSet(players[p].VoiceNr)) { name += " (" + song.Notes.VoiceNames[players[p].VoiceNr] + ")"; } } _Texts[_TextNames[p, CGame.NumPlayers - 1]].Text = name; if (CGame.NumPlayers < (int)_ScreenSettings[_ScreenSettingShortScore].GetValue()) { _Texts[_TextScores[p, CGame.NumPlayers - 1]].Text = ((int)Math.Round(players[p].Points)).ToString("0000") + " " + CLanguage.Translate("TR_SCREENSCORE_POINTS"); } else { _Texts[_TextScores[p, CGame.NumPlayers - 1]].Text = ((int)Math.Round(players[p].Points)).ToString("0000"); } if (CGame.NumPlayers < (int)_ScreenSettings[_ScreenSettingShortDifficulty].GetValue()) { _Texts[_TextDifficulty[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_GAMEDIFFICULTY") + ": " + CLanguage.Translate(CProfiles.GetDifficulty(players[p].ProfileID).ToString()); } else { _Texts[_TextDifficulty[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate(CProfiles.GetDifficulty(players[p].ProfileID).ToString()); } if (CGame.NumPlayers < (int)_ScreenSettings[_ScreenSettingShortRating].GetValue()) { _Texts[_TextRatings[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_RATING") + ": " + CLanguage.Translate(_GetRating((int)Math.Round(players[p].Points))); } else { _Texts[_TextRatings[p, CGame.NumPlayers - 1]].Text = CLanguage.Translate(_GetRating((int)Math.Round(players[p].Points))); } _StaticPointsBarDrawnPoints[p] = 0.0; if (pointAnimDirection.ToLower() == "vertical") { _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].W = 0; } else { _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H = 0; _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H + _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].Y - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H; } if (CProfiles.IsProfileIDValid(players[p].ProfileID)) { _Statics[_StaticAvatar[p, CGame.NumPlayers - 1]].Texture = CProfiles.GetAvatarTextureFromProfile(players[p].ProfileID); } } if (CConfig.Config.Game.ScoreAnimationTime < 1) { for (int p = 0; p < CGame.NumPlayers; p++) { if (pointAnimDirection.ToLower() == "vertical") { _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].W = ((float)players[p].Points) * (_Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].W / CSettings.MaxScore); } else { _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H = ((float)players[p].Points) * (_Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H / CSettings.MaxScore); _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].Y = _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].H + _Statics[_StaticPointsBarBG[p, CGame.NumPlayers - 1]].Y - _Statics[_StaticPointsBar[p, CGame.NumPlayers - 1]].H; } _StaticPointsBarDrawnPoints[p] = players[p].Points; } } _Timer = new Stopwatch(); _Timer.Start(); }