private static void GetSpringZK(object sender, EventArgs e) { if (sender is PlasmaDownloader.Packages.PackageDownloader) { Downloader.PackageDownloader.MasterManifestDownloaded -= GetSpringZK; } if (sender is PlasmaDownloader.Packages.PackageDownloader) { MainWindow.Paint -= GetSpringZK; } getSpringZKCount++; if (getSpringZKCount < 2) { return; } // download primary game after rapid list have been downloaded and MainWindow is visible Downloader.GetAndSwitchEngine(GlobalConst.DefaultEngineOverride ?? TasClient.ServerSpringVersion); var defaultTag = KnownGames.GetDefaultGame().RapidTag; if (!Downloader.PackageDownloader.SelectedPackages.Contains(defaultTag)) { Downloader.PackageDownloader.SelectPackage(defaultTag); if (Downloader.PackageDownloader.GetByTag(defaultTag) != null) { Downloader.GetResource(PlasmaDownloader.DownloadType.MOD, defaultTag); } } }
void MainWindow_Load(object sender, EventArgs e) { if (Debugger.IsAttached) { Text = "==== DEBUGGING ==="; } else { Text = "Zero-K lobby"; } Text += " " + Assembly.GetEntryAssembly().GetName().Version; Icon = ZklResources.ZkIcon; systrayIcon.Icon = ZklResources.ZkIcon; Program.SpringScanner.Start(); if (Program.Conf.StartMinimized) { WindowState = FormWindowState.Minimized; } else { WindowState = Program.Conf.LastWindowState; } if (Program.StartupArgs != null && Program.StartupArgs.Length > 0) { navigationControl.Path = Program.StartupArgs[0]; } // download primary game var defaultTag = KnownGames.GetDefaultGame().RapidTag; if (!Program.Downloader.PackageDownloader.SelectedPackages.Contains(defaultTag)) { Program.Downloader.PackageDownloader.SelectPackage(defaultTag); if (Program.Downloader.PackageDownloader.GetByTag(defaultTag) != null) { Program.Downloader.GetResource(DownloadType.MOD, defaultTag); } } if (Program.Conf.ConnectOnStartup) { Program.ConnectBar.TryToConnectTasClient(); } else { NotifySection.AddBar(Program.ConnectBar); } }
public static bool IsOfficial(this Battle b) { var gameInfo = KnownGames.GetGame(b.ModName); if (gameInfo != null && gameInfo.IsPrimary && b.Founder.IsZkLobbyUser) { return(true); } else { return(false); } }