Beispiel #1
0
 private void PlayerListCmbbx_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         IHPlayerData player = _loadedPlayers[(string)PlayerListCmbbx.SelectedItem];
         CurPlayer       = player;
         PlayerImg.Image = SKore.GetPlayerAvatar(CurPlayer.PlayerName, CurHotel);
         //GetPlayerAvatarAsync(CurPlayer.PlayerName, CurHotel)
         //.ContinueWith(x => PlayerImg.Image = x.Result, TaskScheduler.FromCurrentSynchronizationContext());
         CurPlayer = player;
         if (MMottoChckbx.Checked)
         {
             E.ChangeMotto(player);
         }
         if (MClothesChckbx.Checked)
         {
             E.ChangeClothes(player);
         }
         if (MMottoChckbx.Checked)
         {
             E.ChangeMotto(player);
         }
         if (MClothesChckbx.Checked)
         {
             E.ChangeClothes(player);
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.ToString());
     }
 }
Beispiel #2
0
        private void AccountTxt_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!LoggingIn && !ConnectingBot)
            {
                string AN = AccountTxt.Text;
                if (!AN.Contains("@"))
                {
                    UpdateAccountUI(false);
                    UpdateConnectionFeats(false);
                    AnimationDisplay = string.Format("Grabbing Avatar% | {0}", AN);
                    AnimationTmr.Start();

                    Task.Factory.StartNew(new Action(() =>
                    {
                        bool isLoggedIn  = Program.Accounts[AN].IsLoggedIn;
                        bool isConnected = Program.Accounts[AN].IsConnected;
                        if (!isLoggedIn)
                        {
                            Invoke(new Action(() =>
                            {
                                AvatarPctbx.Image = Resources.Avatar;
                                AccountTxt.Items.Remove(Program.Accounts[AN].PlayerName);
                                AccountTxt.Items.Add(Program.Accounts[AN].Email);
                                AccountTxt.SelectedIndex = AccountTxt.Items.IndexOf(Program.Accounts[AN].Email);
                            }));

                            Program.Accounts.Remove(AN);
                            UpdateAccountUI(false);
                            UpdateConnectionFeats(true);
                            DisplayFinish(string.Format("You've been signed out! | {0}", AN), false);
                        }
                        else
                        {
                            ConnectedLbl.Invoke(new Action(() =>
                            {
                                ConnectedLbl.Text      = isConnected.ToString();
                                ConnectedLbl.ForeColor = isConnected ? Color.DarkGreen : Color.DarkRed;
                            }));

                            Image Avatar = SKore.GetPlayerAvatar(AN, Program.Accounts[AN].Hotel);
                            AvatarPctbx.Invoke(new Action(() => { AvatarPctbx.Image = Avatar; }));
                            UpdateAccountUI(true);
                            UpdateConnectionFeats(true);
                            DisplayFinish(string.Format("Avatar Grabbed! | {0}", AN), false);
                        }
                    }));
                }
                else
                {
                    ConnectedLbl.Text      = "False";
                    ConnectedLbl.ForeColor = Color.DarkRed;
                    AvatarPctbx.Image      = Resources.Avatar;
                    UpdateAccountUI(false);
                    UpdateConnectionFeats(true);
                }
            }
        }