private void logToolStripMenuItem_Click(object sender, EventArgs e) { if (ActiveLogWindow != null) { if (ActiveLogWindow.Visible) { ActiveLogWindow.Hide(); logToolStripMenuItem.Checked = false; } else { ActiveLogWindow.Show(); logToolStripMenuItem.Checked = true; } } }
/// <summary> /// Runs after all sets are downloaded and processed. /// Initializes the StaticDeck windows and deck tracking objects. /// </summary> public async void OnAllSetsDownloaded() { await Task.Run(() => CardLibrary.LoadAllCards(MyProgressDisplay)); await Task.Run(() => GameHistory.LoadAllGames(MyProgressDisplay)); DeckControl.DeckScale deckScale = DeckControl.DeckScale.Medium; if (Properties.Settings.Default.DeckDrawSize == 0) { deckScale = DeckControl.DeckScale.Small; } if (Properties.Settings.Default.DeckDrawSize == 2) { deckScale = DeckControl.DeckScale.Large; } double deckOpacity = Properties.Settings.Default.DeckTransparency / 100.0; PlayerActiveDeckWindow = CreateDeckWindow("No Active Deck", deckScale, deckOpacity, Properties.Settings.Default.ShowPlayerDeck, Properties.Settings.Default.PlayerDeckLocation.X, Properties.Settings.Default.PlayerDeckLocation.Y); PlayerDrawnCardsWindow = CreateDeckWindow("Drawn Cards", deckScale, deckOpacity, Properties.Settings.Default.ShowPlayerDrawnCards, Properties.Settings.Default.PlayerDrawnCardsLocation.X, Properties.Settings.Default.PlayerDrawnCardsLocation.Y); PlayerGraveyardWindow = CreateDeckWindow("Graveyard", deckScale, deckOpacity, Properties.Settings.Default.ShowPlayerGraveyard, Properties.Settings.Default.PlayerPlayedCardsLocation.X, Properties.Settings.Default.PlayerPlayedCardsLocation.Y); OpponentGraveyardWindow = CreateDeckWindow("Opponent Graveyard", deckScale, deckOpacity, Properties.Settings.Default.ShowOpponentGraveyard, Properties.Settings.Default.OpponentPlayedCardsLocation.X, Properties.Settings.Default.OpponentPlayedCardsLocation.Y); PlayerActiveDeckWindow.HideZeroCountCards = Properties.Settings.Default.HideZeroCountInDeck; ActiveLogWindow = new LogWindow(); ActiveLogWindow.CreateControl(); if (Properties.Settings.Default.ActiveLogWindowBounds.Width > 0 && Properties.Settings.Default.ActiveLogWindowBounds.Left > 0) { ActiveLogWindow.StartPosition = FormStartPosition.Manual; ActiveLogWindow.SetBounds( Properties.Settings.Default.ActiveLogWindowBounds.X, Properties.Settings.Default.ActiveLogWindowBounds.Y, Properties.Settings.Default.ActiveLogWindowBounds.Width, Properties.Settings.Default.ActiveLogWindowBounds.Height, BoundsSpecified.All); } { // Show and hide active log window to make sure it's loaded ahead of time ActiveLogWindow.Show(); ActiveLogWindow.Hide(); } Log.SetLogWindow(ActiveLogWindow); // Special debigging window is shown if D key is held during load if (!string.IsNullOrEmpty(Constants.PlayBackDeckPath) || Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) { OverlayWindow = new GameBoardWatchWindow(); OverlayWindow.Show(); } CurrentPlayState = new CardsInPlayWorker(this); if (string.IsNullOrEmpty(Constants.PlayBackDeckPath)) { CurrentExpedition = new Expedition(this); } // Hide the progress display and make all the other UI elements visible MyProgressDisplay.Visible = false; DecksListCtrl.Visible = true; HighlightedGameLogControl.Visible = true; TheMenuBar.Visible = true; // Load all games. We do this in reverse as AddDeckToList expects them // in chronological order for (int i = GameHistory.Games.Count - 1; i >= 0; i--) { DecksListCtrl.AddToDeckList(GameHistory.Games[i]); } Utilities.CallActionSafelyAndWait(DecksListCtrl, new Action(() => { DecksListCtrl.SwitchDeckView(false); })); CurrentPlayState.Start(string.IsNullOrEmpty(Constants.PlayBackDeckPath) ? null : Constants.GetLocalGamesPath() + "\\" + Constants.PlayBackDeckPath); }