コード例 #1
0
        private void Chat_Loaded(object sender, RoutedEventArgs e)
        {
            LoadStyle();

            cb_defaultdeck.PreviewMouseLeftButtonDown += cb_defaultdeck_click;
            RefreshDeck();
            cb_defaultdeck.Text = YgoproConfig.GetDefaultDeck();

            tb_version.Text = FormExecution.Username + " - " + Main.VERSION + "c" + FormExecution.ClientConfig.CardsStuffVersion;
            this.Title      = FormExecution.Username + " - " + Main.VERSION + "c" + FormExecution.ClientConfig.CardsStuffVersion;

            foreach (var groups in FormExecution.AssetsManager.Smileys)
            {
                TextBlock tb = new TextBlock();
                tb.Text            = groups.Key;
                tb.FontStyle       = FontStyles.Italic;
                tb.FontWeight      = FontWeights.Bold;
                tb.TextDecorations = TextDecorations.Underline;
                tb.Width           = smiley_popup.Width;
                tb.Margin          = new Thickness(0, 5, 0, 5);
                wp_smileys.Children.Add(tb);
                foreach (Smiley s in groups.Value)
                {
                    BCA_Smiley uismiley = new BCA_Smiley(s.Pic);
                    uismiley.Clicked += () => AddSmiley(s.Name);
                    wp_smileys.Children.Add(uismiley);
                }
            }

            logger.Trace("Style loaded.");


            if (FormExecution.ClientConfig.DoTutoChat)
            {
                BCA_TutoPopup tutopopup = new BCA_TutoPopup();
                maingrid.Children.Add(tutopopup);
                tutopopup.HorizontalAlignment        = HorizontalAlignment.Center;
                tutopopup.VerticalAlignment          = VerticalAlignment.Center;
                tutopopup.tuto_popup.IsOpen          = true;
                tutopopup.tuto_popup.Placement       = System.Windows.Controls.Primitives.PlacementMode.Center;
                tutopopup.tuto_popup.PlacementTarget = maingrid;
                tutopopup.SetText(StartDisclaimer.ChatTutorial[_tutoIndex]);
                tutopopup.tuto_popup.MaxWidth = this.Width - 200;

                tutopopup.SkipTuto += SkipTutorial;
                tutopopup.NextStep += Tutopopup_NextStep;
            }
        }
コード例 #2
0
        private void btn_playranked_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (FormExecution.ClientConfig.FirstTimeRanked)
            {
                FormExecution.Client_PopMessageBoxShowDialog(StartDisclaimer.RankedText, "Premièr duel classé !");
                FormExecution.ClientConfig.FirstTimeRanked = false;
                FormExecution.ClientConfig.Save();
            }

            if (RankedTimer.IsEnabled)
            {
                _admin.SendStopPlayRanked();
                StopTimer();
            }
            else
            {
                ChoicePopBox cpb = new ChoicePopBox(FormExecution.PlayerInfos, new RoomConfig(), ChoiceBoxType.DeckChoiceRanked, "", YgoproConfig.GetDefaultDeck());
                cpb.Choice += Cpb_Choice;
                cpb.Show();
                Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() => cpb.Activate()));
            }
        }