예제 #1
0
        private void _LoadAvatars(bool keep)
        {
            int selectedAvatarID = _SelectSlides[_SelectSlideAvatars].SelectedTag;

            _SelectSlides[_SelectSlideAvatars].Clear();
            IEnumerable <CAvatar> avatars = CProfiles.GetAvatars();

            if (avatars != null)
            {
                foreach (CAvatar avatar in avatars)
                {
                    _SelectSlides[_SelectSlideAvatars].AddValue(avatar.GetDisplayName(), null, avatar.ID);
                }
            }

            if (keep)
            {
                _SelectSlides[_SelectSlideAvatars].SelectedTag = selectedAvatarID;
                CProfiles.SetAvatar(_NewProfileID, selectedAvatarID);
            }
            else
            {
                _SelectSlides[_SelectSlideAvatars].SelectedTag = CProfiles.GetAvatarID(_NewProfileID);
            }

            _AvatarsChanged = false;
        }
예제 #2
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;
        }
예제 #3
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;
        }
예제 #4
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);
        }
예제 #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 _UpdatePlayerNumber()
        {
            CConfig.Config.Game.NumPlayers = _SelectSlides[_SelectSlidePlayerNumber].Selection + 1;
            CGame.NumPlayers = _SelectSlides[_SelectSlidePlayerNumber].Selection + 1;
            _AssignPlayerElements();
            //_LoadPlayerPanels();
            _ResetPlayerElements();

            for (int i = 0; i < CSettings.MaxNumPlayer; i++)
            {
                if (i < CGame.NumPlayers)
                {
                    _Buttons[_PlayerButton[i]].Visible       = true;
                    _Statics[_PlayerStatic[i]].Visible       = true;
                    _Statics[_PlayerStaticAvatar[i]].Visible = true;
                    _Texts[_PlayerText[i]].Visible           = true;
                    if (CGame.Players[i].ProfileID != Guid.Empty)
                    {
                        _Statics[_PlayerStaticAvatar[i]].Texture = CProfiles.GetAvatarTexture(CProfiles.GetAvatarID(CGame.Players[i].ProfileID));
                        _Texts[_PlayerText[i]].Text = CProfiles.GetPlayerName(CGame.Players[i].ProfileID, i + 1);
                    }
                    else
                    {
                        _Texts[_PlayerText[i]].Text = CProfiles.GetPlayerName(Guid.Empty, i + 1);
                        _Statics[_PlayerStaticAvatar[i]].Texture = _OriginalPlayerAvatarTextures[i];
                    }
                    _Texts[_PlayerText[i]].Color                = CBase.Themes.GetPlayerColor(i + 1);
                    _Equalizers[_PlayerEqualizer[i]].Color.R    = CBase.Themes.GetPlayerColor(i + 1).R;
                    _Equalizers[_PlayerEqualizer[i]].Color.G    = CBase.Themes.GetPlayerColor(i + 1).G;
                    _Equalizers[_PlayerEqualizer[i]].Color.B    = CBase.Themes.GetPlayerColor(i + 1).B;
                    _Equalizers[_PlayerEqualizer[i]].MaxColor.R = CBase.Themes.GetPlayerColor(i + 1).R;
                    _Equalizers[_PlayerEqualizer[i]].MaxColor.G = CBase.Themes.GetPlayerColor(i + 1).G;
                    _Equalizers[_PlayerEqualizer[i]].MaxColor.B = CBase.Themes.GetPlayerColor(i + 1).B;
                    _Equalizers[_PlayerEqualizer[i]].Visible    = true;
                    if (CGame.GetNumSongs() == 1 && CGame.GetSong(0).IsDuet)
                    {
                        _SelectSlides[_PlayerSelectSlideDuet[i]].Visible = true;
                    }
                }
                else
                {
                    _ResetPlayerSelection(i);
                }
            }
            CConfig.SaveConfig();
            _CheckMics();
            //_CheckPlayers();
        }