public LoginWindow() { InitializeComponent(); Logger.Initialzie(); Config.Load(); if (HearthStatsAPI.LoadCredentials() || !Config.Instance.ShowLoginDialog) { StartMainApp(); } CheckBoxRememberLogin.IsChecked = Config.Instance.RememberHearthStatsLogin; _initialized = true; }
public LoginWindow() { Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); Logger.Initialzie(); Config.Load(); _game = new GameV2(); Card.SetGame(_game); API.Core.Game = _game; InitializeComponent(); if (HearthStatsAPI.LoadCredentials() || !Config.Instance.ShowLoginDialog) { StartMainApp(); } CheckBoxRememberLogin.IsChecked = Config.Instance.RememberHearthStatsLogin; _initialized = true; }
public static void Initialize() { Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); Config.Load(); ConfigManager.Run(); Logger.Initialzie(); Helper.UpdateAppTheme(); var splashScreenWindow = new SplashScreenWindow(); splashScreenWindow.Show(); Game = new GameV2(); if (!HearthStatsAPI.LoadCredentials() && Config.Instance.ShowLoginDialog) { var loginWindow = new LoginWindow(); splashScreenWindow.Close(); loginWindow.ShowDialog(); if (!loginWindow.LoginResult) { Application.Current.Shutdown(); return; } splashScreenWindow = new SplashScreenWindow(); splashScreenWindow.Show(); } MainWindow = new MainWindow(); MainWindow.LoadConfigSettings(); MainWindow.Show(); splashScreenWindow.Close(); if (ConfigManager.UpdatedVersion != null) { Updater.Cleanup(); MainWindow.FlyoutUpdateNotes.IsOpen = true; MainWindow.UpdateNotesControl.LoadUpdateNotes(); } NetDeck.CheckForChromeExtention(); DataIssueResolver.Run(); if (Helper.HearthstoneDirExists) { if (Helper.UpdateLogConfig && Game.IsRunning) { MainWindow.ShowMessageAsync("Restart Hearthstone", "This is either your first time starting HDT or the log.config file has been updated. Please restart Hearthstone, for HDT to work properly."); } LogReaderManager.Start(Game); } else { MainWindow.ShowHsNotInstalledMessage(); } Helper.CopyReplayFiles(); BackupManager.Run(); if (Config.Instance.PlayerWindowOnStart) { Windows.PlayerWindow.Show(); } if (Config.Instance.OpponentWindowOnStart) { Windows.OpponentWindow.Show(); } if (Config.Instance.TimerWindowOnStartup) { Windows.TimerWindow.Show(); } if (Config.Instance.HearthStatsSyncOnStart && HearthStatsAPI.IsLoggedIn) { HearthStatsManager.SyncAsync(background: true); } PluginManager.Instance.LoadPlugins(); MainWindow.Options.OptionsTrackerPlugins.Load(); PluginManager.Instance.StartUpdateAsync(); UpdateOverlayAsync(); NewsUpdater.UpdateAsync(); Initialized = true; }
public static void Initialize() { Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); var newUser = !Directory.Exists(Config.AppDataPath); Config.Load(); ConfigManager.Run(); Logger.Initialzie(); Helper.UpdateAppTheme(); var splashScreenWindow = new SplashScreenWindow(); splashScreenWindow.ShowConditional(); Game = new GameV2(); LoginType loginType; var loggedIn = HearthStatsAPI.LoadCredentials(); if (!loggedIn && Config.Instance.ShowLoginDialog) { var loginWindow = new LoginWindow(); splashScreenWindow.Close(); loginWindow.ShowDialog(); if (loginWindow.LoginResult == LoginType.None) { Application.Current.Shutdown(); return; } loginType = loginWindow.LoginResult; splashScreenWindow = new SplashScreenWindow(); splashScreenWindow.ShowConditional(); } else { loginType = loggedIn ? LoginType.AutoLogin : LoginType.AutoGuest; } MainWindow = new MainWindow(); MainWindow.LoadConfigSettings(); MainWindow.Show(); splashScreenWindow.Close(); if (ConfigManager.UpdatedVersion != null) { Updater.Cleanup(); MainWindow.FlyoutUpdateNotes.IsOpen = true; MainWindow.UpdateNotesControl.LoadUpdateNotes(); } NetDeck.CheckForChromeExtention(); DataIssueResolver.Run(); if (Helper.HearthstoneDirExists) { if (Helper.UpdateLogConfig && Game.IsRunning) { MainWindow.ShowMessageAsync("Restart Hearthstone", "This is either your first time starting HDT or the log.config file has been updated. Please restart Hearthstone, for HDT to work properly."); } LogReaderManager.Start(Game); } else { MainWindow.ShowHsNotInstalledMessage(); } Helper.CopyReplayFiles(); BackupManager.Run(); if (Config.Instance.PlayerWindowOnStart) { Windows.PlayerWindow.Show(); } if (Config.Instance.OpponentWindowOnStart) { Windows.OpponentWindow.Show(); } if (Config.Instance.TimerWindowOnStartup) { Windows.TimerWindow.Show(); } if (Config.Instance.HearthStatsSyncOnStart && HearthStatsAPI.IsLoggedIn) { HearthStatsManager.SyncAsync(background: true); } PluginManager.Instance.LoadPlugins(); MainWindow.Options.OptionsTrackerPlugins.Load(); PluginManager.Instance.StartUpdateAsync(); UpdateOverlayAsync(); NewsUpdater.UpdateAsync(); HotKeyManager.Load(); Initialized = true; Analytics.Analytics.TrackPageView( string.Format("/app/v{0}/{1}{2}", Helper.GetCurrentVersion().ToVersionString(), loginType.ToString().ToLower(), newUser ? "/new" : ""), ""); }