예제 #1
0
        private void _LoadProfiles(bool keep)
        {
            string name = String.Empty;

            if (_EditMode == EEditMode.PlayerName)
            {
                name = CProfiles.GetPlayerName(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag));
            }

            Guid selectedProfileID = _GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag);

            _SelectSlides[_SelectSlideProfiles].Clear();
            _SelectSlideGuids.Clear();

            CProfile[] profiles = CProfiles.GetProfiles();
            int        i        = 0;

            foreach (CProfile profile in profiles)
            {
                _SelectSlides[_SelectSlideProfiles].AddValue(profile.PlayerName, null, i);
                _SelectSlideGuids.Add(i, profile.ID);
                i++;
            }

            if (CProfiles.NumProfiles > 0 && CProfiles.NumAvatars > 0)
            {
                if (selectedProfileID != Guid.Empty)
                {
                    _SelectSlides[_SelectSlideProfiles].SelectedTag = _SelectSlideGuids.FirstOrDefault(x => x.Value.Equals(selectedProfileID)).Key;
                }
                else
                {
                    _SelectSlides[_SelectSlideProfiles].Selection = 0;
                    selectedProfileID = _GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag);
                }

                if (!keep)
                {
                    _SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(selectedProfileID);
                    _SelectSlides[_SelectSlideUserRole].Selection   = (int)CProfiles.GetUserRoleProfile(selectedProfileID);
                    _SelectSlides[_SelectSlideActive].Selection     = (int)CProfiles.GetActive(selectedProfileID);
                    _SelectSlides[_SelectSlideAvatars].SelectedTag  = CProfiles.GetAvatarID(selectedProfileID);
                }

                if (_EditMode == EEditMode.PlayerName)
                {
                    CProfiles.SetPlayerName(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag), name);
                }
            }
            _ProfilesChanged = false;
        }
예제 #2
0
        private void _LoadProfiles(bool keep)
        {
            string name = String.Empty;

            if (_EditMode == EEditMode.PlayerName)
            {
                name = CProfiles.GetPlayerName(_SelectSlides[_SelectSlideProfiles].SelectedTag);
            }

            int selectedProfileID = _SelectSlides[_SelectSlideProfiles].SelectedTag;

            _SelectSlides[_SelectSlideProfiles].Clear();

            CProfile[] profiles = CProfiles.GetProfiles();
            foreach (CProfile profile in profiles)
            {
                _SelectSlides[_SelectSlideProfiles].AddValue(profile.PlayerName, null, profile.ID);
            }

            if (CProfiles.NumProfiles > 0 && CProfiles.NumAvatars > 0)
            {
                if (selectedProfileID != -1)
                {
                    _SelectSlides[_SelectSlideProfiles].SelectedTag = selectedProfileID;
                }
                else
                {
                    _SelectSlides[_SelectSlideProfiles].Selection = 0;
                    selectedProfileID = _SelectSlides[_SelectSlideProfiles].SelectedTag;
                }

                if (!keep)
                {
                    _SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(selectedProfileID);
                    _SelectSlides[_SelectSlideUserRole].Selection   = (int)CProfiles.GetUserRoleProfile(selectedProfileID);
                    _SelectSlides[_SelectSlideActive].Selection     = (int)CProfiles.GetActive(selectedProfileID);
                    _SelectSlides[_SelectSlideAvatars].SelectedTag  = CProfiles.GetAvatarID(selectedProfileID);
                }

                if (_EditMode == EEditMode.PlayerName)
                {
                    CProfiles.SetPlayerName(_SelectSlides[_SelectSlideProfiles].SelectedTag, name);
                }
            }
            _ProfilesChanged = false;
        }
예제 #3
0
        public override bool UpdateGame()
        {
            if (_AvatarsChanged)
            {
                _LoadAvatars(true);
            }

            if (_ProfilesChanged)
            {
                _LoadProfiles(true);
            }

            if (_SelectSlides[_SelectSlideProfiles].Selection > -1)
            {
                _Buttons[_ButtonPlayerName].Text.Text = CProfiles.GetPlayerName(_SelectSlides[_SelectSlideProfiles].SelectedTag);
                if (_EditMode == EEditMode.PlayerName)
                {
                    _Buttons[_ButtonPlayerName].Text.Text += "|";
                }

                _SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(_SelectSlides[_SelectSlideProfiles].SelectedTag);
                _SelectSlides[_SelectSlideUserRole].Selection   = (int)CProfiles.GetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].SelectedTag);
                _SelectSlides[_SelectSlideActive].Selection     = (int)CProfiles.GetActive(_SelectSlides[_SelectSlideProfiles].SelectedTag);

                int avatarID = CProfiles.GetAvatarID(_SelectSlides[_SelectSlideProfiles].SelectedTag);
                _SelectSlides[_SelectSlideAvatars].SelectedTag = avatarID;
                if (_Snapshot == null)
                {
                    if (CWebcam.IsCapturing())
                    {
                        if (CWebcam.GetFrame(ref _WebcamTexture))
                        {
                            _Statics[_StaticAvatar].Texture = _WebcamTexture;
                        }
                    }
                    else
                    {
                        _Statics[_StaticAvatar].Texture = CProfiles.GetAvatarTexture(avatarID);
                    }
                }
            }

            return(true);
        }
예제 #4
0
        public int AddScore(SPlayer player)
        {
            using (var connection = new SQLiteConnection())
            {
                connection.ConnectionString = "Data Source=" + _FilePath;

                try
                {
                    connection.Open();
                }
                catch (Exception)
                {
                    return(-1);
                }

                int medley    = 0;
                int duet      = 0;
                int shortSong = 0;
                switch (player.GameMode)
                {
                case EGameMode.TR_GAMEMODE_MEDLEY:
                    medley = 1;
                    break;

                case EGameMode.TR_GAMEMODE_DUET:
                    duet = 1;
                    break;

                case EGameMode.TR_GAMEMODE_SHORTSONG:
                    shortSong = 1;
                    break;
                }

                using (var command = new SQLiteCommand(connection))
                {
                    int dataBaseSongID = CSongs.GetSong(player.SongID).DataBaseSongID;
                    return(_AddScore(CProfiles.GetPlayerName(player.ProfileID), (int)Math.Round(player.Points), player.VoiceNr, player.DateTicks, medley,
                                     duet, shortSong, (int)CProfiles.GetDifficulty(player.ProfileID), dataBaseSongID, command));
                }
            }
        }
예제 #5
0
        private void _LoadProfiles(bool keep)
        {
            /*string name = String.Empty;
             * if (_EditMode == EEditMode.PlayerName)
             *  name = CProfiles.GetPlayerName(_NewProfileID);
             *  //name = CProfiles.GetPlayerName(_SelectSlides[_SelectSlideProfiles].SelectedTag);*/

            Guid selectedProfileID = _NewProfileID;

            //_SelectSlides[_SelectSlideProfiles].Clear();

            CProfile[] profiles = CProfiles.GetProfiles();

            /*foreach (CProfile profile in profiles)
             *  _SelectSlides[_SelectSlideProfiles].AddValue(profile.PlayerName, null, profile.ID);*/

            if (CProfiles.NumProfiles > 0 && CProfiles.NumAvatars > 0)
            {
                /*if (selectedProfileID != -1)
                 *  _SelectSlides[_SelectSlideProfiles].SelectedTag = selectedProfileID;
                 * else
                 * {
                 *  _SelectSlides[_SelectSlideProfiles].Selection = 0;
                 *  selectedProfileID = _SelectSlides[_SelectSlideProfiles].SelectedTag;
                 * }*/

                if (!keep)
                {
                    _SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(selectedProfileID);
                    //_SelectSlides[_SelectSlideUserRole].Selection = (int)CProfiles.GetUserRoleProfile(selectedProfileID);
                    //_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(selectedProfileID);
                    _SelectSlides[_SelectSlideAvatars].SelectedTag = CProfiles.GetAvatarID(selectedProfileID);
                }

                /*if (_EditMode == EEditMode.PlayerName)
                 *  CProfiles.SetPlayerName(_SelectSlides[_SelectSlideProfiles].SelectedTag, name);*/
            }
            _ProfilesChanged = false;
        }
예제 #6
0
        public override bool UpdateGame()
        {
            if (_Buttons[_ButtonPlayerName].Selected)
            {
                _EditMode = EEditMode.PlayerName;
            }
            //BODGE!
            for (int i = 0; i < 3; i++)
            {
                _Texts["TextSelectSlideDifficulty" + i].Text         = _SelectSlides[_SelectSlideDifficulty].SelectedValue;
                _Statics["StaticSelectSlideDifficultyL" + i].Visible = true;
                _Statics["StaticSelectSlideDifficultyR" + i].Visible = true;
                if (_SelectSlides[_SelectSlideDifficulty].Selection == 0)
                {
                    _Statics["StaticSelectSlideDifficultyL" + i].Visible = false;
                }
                if (_SelectSlides[_SelectSlideDifficulty].Selection == _SelectSlides[_SelectSlideDifficulty].NumValues - 1)
                {
                    _Statics["StaticSelectSlideDifficultyR" + i].Visible = false;
                }

                _Texts["TextSelectSlideAvatars" + i].Text         = _SelectSlides[_SelectSlideAvatars].SelectedValue;
                _Statics["StaticSelectSlideAvatarsL" + i].Visible = true;
                _Statics["StaticSelectSlideAvatarsR" + i].Visible = true;
                if (_SelectSlides[_SelectSlideAvatars].Selection == 0)
                {
                    _Statics["StaticSelectSlideAvatarsL" + i].Visible = false;
                }
                if (_SelectSlides[_SelectSlideAvatars].Selection == _SelectSlides[_SelectSlideAvatars].NumValues - 1)
                {
                    _Statics["StaticSelectSlideAvatarsR" + i].Visible = false;
                }

                _Statics["StaticAvatar" + i].Aspect  = _Statics["StaticAvatar"].Aspect;
                _Statics["StaticAvatar" + i].Texture = _Statics["StaticAvatar"].Texture;
                _Texts["TextPlayerName" + i].Text    = _Buttons[_ButtonPlayerName].Text.Text;
                if (_Buttons[_ButtonPlayerName].Selected)
                {
                    _Statics[_StaticButtonPlayerName[i]].Visible = true;
                    _Statics[_StaticButtonPlayerName[i]].Texture = _Buttons[_ButtonPlayerName].SelTexture;
                    _Statics[_StaticButtonPlayerName[i]].Color   = _Buttons[_ButtonPlayerName].SelColor;
                }
                else
                {
                    _Statics[_StaticButtonPlayerName[i]].Visible = false;
                }
                if (_Buttons[_ButtonCancel].Selected)
                {
                    _Statics["StaticButtonCancel" + i].Color = _Buttons[_ButtonCancel].SelColor;
                    _Texts["TextButtonCancel" + i].Selected  = true;
                }
                else
                {
                    _Statics["StaticButtonCancel" + i].Color = _Buttons[_ButtonCancel].Color;
                    _Texts["TextButtonCancel" + i].Selected  = false;
                }
                if (_Buttons[_ButtonSave].Selected)
                {
                    _Statics["StaticButtonSave" + i].Color = _Buttons[_ButtonSave].SelColor;
                    _Texts["TextButtonSave" + i].Selected  = true;
                }
                else
                {
                    _Statics["StaticButtonSave" + i].Color = _Buttons[_ButtonSave].Color;
                    _Texts["TextButtonSave" + i].Selected  = false;
                }

                if (_SelectSlides[_SelectSlideDifficulty].Selected)
                {
                    _Statics["StaticSelectSlideDifficulty" + i].Visible = true;
                    _Texts["TextSelectSlideDifficulty" + i].Selected    = true;
                }
                else
                {
                    _Statics["StaticSelectSlideDifficulty" + i].Visible = false;
                    _Texts["TextSelectSlideDifficulty" + i].Selected    = false;
                }

                if (_SelectSlides[_SelectSlideAvatars].Selected)
                {
                    _Statics["StaticSelectSlideAvatars" + i].Visible = true;
                    _Texts["TextSelectSlideAvatars" + i].Selected    = true;
                }
                else
                {
                    _Statics["StaticSelectSlideAvatars" + i].Visible = false;
                    _Texts["TextSelectSlideAvatars" + i].Selected    = false;
                }
            }

            if (_AvatarsChanged)
            {
                _LoadAvatars(true);
            }

            if (_ProfilesChanged)
            {
                _LoadProfiles(true);
            }

            //if (_SelectSlides[_SelectSlideProfiles].Selection > -1)
            //{
            _Buttons[_ButtonPlayerName].Text.Text = CProfiles.GetPlayerName(_NewProfileID);
            if (_EditMode == EEditMode.PlayerName && _CursorBlink)
            {
                _Buttons[_ButtonPlayerName].Text.Text = " " + _Buttons[_ButtonPlayerName].Text.Text + "_";
            }
            else
            {
                _Buttons[_ButtonPlayerName].Text.Text = " " + _Buttons[_ButtonPlayerName].Text.Text + " ";
            }

            _SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(_NewProfileID);
            //_SelectSlides[_SelectSlideUserRole].Selection = (int)CProfiles.GetUserRoleProfile(_NewProfileID);
            //_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(_NewProfileID);

            int avatarID = CProfiles.GetAvatarID(_NewProfileID);

            _SelectSlides[_SelectSlideAvatars].SelectedTag = avatarID;
            _Statics[_StaticAvatar].Texture = CProfiles.GetAvatarTexture(avatarID);
            //}

            return(true);
        }
예제 #7
0
        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);
                }
            }
        }
예제 #8
0
        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();
        }
예제 #9
0
        private void LoadProfiles()
        {
            _EditMode = EEditMode.None;
            SelectSlides[htSelectSlides(SelectSlideProfiles)].Clear();

            for (int i = 0; i < CProfiles.NumProfiles; i++)
            {
                SelectSlides[htSelectSlides(SelectSlideProfiles)].AddValue(CProfiles.GetPlayerName(i));
            }

            if (CProfiles.NumProfiles > 0 && CProfiles.NumAvatars > 0)
            {
                SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection   = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideActive)].Selection       = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection      = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
            }
        }
예제 #10
0
        public override bool UpdateGame()
        {
            if (SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection > -1)
            {
                Buttons[htButtons(ButtonPlayerName)].Text.Text = CProfiles.GetPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                if (_EditMode == EEditMode.PlayerName)
                {
                    Buttons[htButtons(ButtonPlayerName)].Text.Text += "|";
                }

                SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection   = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideActive)].Selection       = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);

                int avatarNr = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection = avatarNr;
                Statics[htStatics(StaticAvatar)].Texture = CProfiles.Avatars[avatarNr].Texture;
            }

            return(true);
        }
예제 #11
0
        public override bool UpdateGame()
        {
            if (SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection > -1)
            {
                Buttons[htButtons(ButtonPlayerName)].Text.Text = CProfiles.GetPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                if (_EditMode == EEditMode.PlayerName)
                {
                    Buttons[htButtons(ButtonPlayerName)].Text.Text += "|";
                }

                SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection   = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideActive)].Selection       = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);

                int avatarNr = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection);
                SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection = avatarNr;
                if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0)
                {
                    if (_Snapshot == null)
                    {
                        CWebcam.GetFrame(ref _WebcamTexture);
                    }
                    Statics[htStatics(StaticAvatar)].Texture = _WebcamTexture;

                    RectangleF bounds = new RectangleF(_WebcamTexture.rect.X, _WebcamTexture.rect.Y, _WebcamTexture.rect.W, _WebcamTexture.rect.H);
                    RectangleF rect   = new RectangleF(0f, 0f, _WebcamTexture.rect.W, _WebcamTexture.rect.H);
                    CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
                }
                else
                {
                    Statics[htStatics(StaticAvatar)].Texture = CProfiles.Avatars[avatarNr].Texture;
                }
            }

            return(true);
        }