Example #1
0
        private void HighlightCell(Point cellIndex)
        {
            if (HighlightedCell != cellIndex)
            {
                if (HighlightedCell.Y != cellIndex.Y)
                {
                    // Invalidate old row
                    if (HighlightedCell.Y >= 0)
                    {
                        Invalidate(GetCellRectangle(-1, HighlightedCell.Y));
                    }
                    // Invalidate new row
                    if (cellIndex.Y >= 0)
                    {
                        Invalidate(GetCellRectangle(-1, cellIndex.Y));
                    }
                }
                if (PopupDeckWindow.Visible && !PopupDeckWindow.DesktopBounds.Contains(PointToScreen(MousePosition)))
                {
                    PopupDeckWindow.Hide();
                }
                HighlightedCell = cellIndex;
                if (HighlightedCell.X != -1)
                {
                    Rectangle cellRectangle = GameTextRectangles[HighlightedCell.Y + 1][HighlightedCell.X];

                    if (Columns[HighlightedCell.X].Title == "My Deck" || Columns[HighlightedCell.X].Title == "Opponent")
                    {
                        List <CardWithCount> deck = (Columns[HighlightedCell.X].Title == "Opponent") ? Games[HighlightedCell.Y].OpponentDeck : Games[HighlightedCell.Y].MyDeck;

                        if (deck.Count > 0)
                        {
                            PopupDeckWindow.SetFullDeck(deck);
                            Point pos = PointToScreen(new Point(cellRectangle.Right, cellRectangle.Top));
                            PopupDeckWindow.SetBounds(pos.X, pos.Y, 0, 0);
                            Utilities.ShowInactiveTopmost(PopupDeckWindow);
                            PopupDeckWindow.UpdateSize();
                        }
                    }
                }
            }
        }
Example #2
0
 private void DeckStatsCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     if (PlayerActiveDeckWindow != null)
     {
         PlayerActiveDeckWindow.ShouldShowDeckStats = DeckStatsCheckBox.Checked;
         PlayerActiveDeckWindow.UpdateSize();
     }
     if (PlayerDrawnCardsWindow != null)
     {
         PlayerDrawnCardsWindow.ShouldShowDeckStats = DeckStatsCheckBox.Checked;
         PlayerDrawnCardsWindow.UpdateSize();
     }
     if (PlayerPlayedCardsWindow != null)
     {
         PlayerPlayedCardsWindow.ShouldShowDeckStats = DeckStatsCheckBox.Checked;
         PlayerPlayedCardsWindow.UpdateSize();
     }
     if (OpponentPlayedCardsWindow != null)
     {
         OpponentPlayedCardsWindow.ShouldShowDeckStats = DeckStatsCheckBox.Checked;
         OpponentPlayedCardsWindow.UpdateSize();
     }
 }