Ejemplo n.º 1
0
        public DeckScreenshotWindow(Deck deck, bool deckOnly = false)
        {
            InitializeComponent();
            _allTags = deck.TagList.ToLowerInvariant().Replace("-", "");
            ListViewPlayer.Update(deck.Cards.ToSortedCardList(), true);

            if (deckOnly)
            {
                DeckTitleContainer.Visibility = Collapsed;
                DeckFormatPanel.Visibility    = Collapsed;
                SetDustPanel.Visibility       = Collapsed;
                BrandContainer.Visibility     = Collapsed;
            }
            else
            {
                DeckTitlePanel.Background = DeckHeaderBackground(deck.Class);
                LblDeckTitle.Text         = deck.Name;
                LblDeckTag.Text           = GetTagText(deck);
                LblDeckFormat.Text        = GetFormatText(deck);
                LblDustCost.Text          = TotalDust(deck).ToString();
                ShowFormatIcon(deck);
                SetIcons.Update(deck);
            }

            Height = 35 * ListViewPlayer.Items.Count + (deckOnly ? 0 : EXTRAS_HEIGHT);
        }
        public PlayerWindow(GameV2 game, List <Card> forScreenshot = null)
        {
            InitializeComponent();
            _game  = game;
            Height = Config.Instance.PlayerWindowHeight;
            if (Config.Instance.PlayerWindowLeft.HasValue)
            {
                Left = Config.Instance.PlayerWindowLeft.Value;
            }
            if (Config.Instance.PlayerWindowTop.HasValue)
            {
                Top = Config.Instance.PlayerWindowTop.Value;
            }
            Topmost = Config.Instance.WindowsTopmost;

            var titleBarCorners = new[]
            {
                new Point((int)Left + 5, (int)Top + 5),
                new Point((int)(Left + Width) - 5, (int)Top + 5),
                new Point((int)Left + 5, (int)(Top + TitlebarHeight) - 5),
                new Point((int)(Left + Width) - 5, (int)(Top + TitlebarHeight) - 5)
            };

            if (!Screen.AllScreens.Any(s => titleBarCorners.Any(c => s.WorkingArea.Contains(c))))
            {
                Top  = 100;
                Left = 100;
            }


            if (forScreenshot != null)
            {
                CanvasPlayerChance.Visibility = Visibility.Collapsed;
                CanvasPlayerCount.Visibility  = Visibility.Collapsed;
                LblWins.Visibility            = Visibility.Collapsed;
                LblDeckTitle.Visibility       = Visibility.Collapsed;
                ListViewPlayer.Update(forScreenshot, true);

                Height = 34 * ListViewPlayer.Items.Count;
            }
        }
 public void UpdatePlayerCards(List <Card> cards, bool reset) => ListViewPlayer.Update(cards, reset);