Exemplo n.º 1
0
        private async void mapleIdBox_DropDownClosed(object sender, EventArgs e)
        {
            // in case
            if (mapleIdBox.Text == Maple.MainCharName)
            {
                return;
            }

            charImage.Source     = null;
            mapleIdBox.IsEnabled = false;
            mapleIdLabel.Content = "Switching...";

            try
            {
                await Maple.SwitchMapleId(mapleIdBox.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error swiching IDs...\n\n" + ex.ToString());
            }

            mapleIdLabel.Content = "Web Main Character (대표 캐릭터): " + Maple.MainCharName;
            if (Maple.CharacterImageUrl != null)
            {
                charImage.Source = Tools.UrlToXamlImage(Maple.CharacterImageUrl);
            }
            mapleIdBox.IsEnabled = true;
        }
Exemplo n.º 2
0
        private async Task switchMapleId()
        {
            if (String.IsNullOrEmpty(mapleIdBox.Text) || !Maple.MapleIds.Contains(mapleIdBox.Text))
            {
                return;
            }

            charImage.Source = null;
            toggleUi(false);
            mapleIdLabel.Content = "Switching...";

            try
            {
                await Maple.SwitchMapleId(mapleIdBox.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error swiching IDs...\n\n" + ex.ToString());
            }

            mapleIdLabel.Content = "Web Main Character (대표 캐릭터): " + Maple.MainCharName;
            if (Maple.CharacterImageUrl != null)
            {
                charImage.Source = Tools.UrlToXamlImage(Maple.CharacterImageUrl);
            }
            tespiaCheckBox.IsChecked = false;

            if (noAuth)
            {
                Account.SaveCookies();
                await startGame();

                return;
            }

            toggleUi(true);
        }