예제 #1
0
        private DeckWindow CreateDeckWindow(string title, DeckControl.DeckScale deckScale, double opacity,
                                            bool showWindow, int posX, int posY)
        {
            DeckWindow deckWindow = new DeckWindow();

            deckWindow.CreateControl();
            deckWindow.Title               = title;
            deckWindow.CustomDeckScale     = deckScale;
            deckWindow.ShouldShowDeckStats = Properties.Settings.Default.ShowDeckStats;
            deckWindow.Show();
            deckWindow.IsNonEmptyDeckVisible = showWindow;
            deckWindow.SetBounds(posX, posY, 0, 0, BoundsSpecified.Location);
            deckWindow.Opacity = opacity;
            deckWindow.UpdateDeck(null, null);
            return(deckWindow);
        }
예제 #2
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();
                        }
                    }
                }
            }
        }