private void Form2_Shown(object sender, EventArgs e) { lblUrl.Text = "Downloading " + this.demoUrl; NFKHelper.GetOrCreateConfigFile(); try { // local file if (File.Exists(demoUrl)) { NFKHelper.DemoFile = demoUrl; waitGameLoading(); } // web link else { downloadFile(demoUrl, NFKHelper.GetOrCreateDemoDownloadDir()); } } catch (Exception ex) { Common.ShowError("Error", ex.Message + "\n" + demoUrl); userMode = false; this.Close(); } }
public FormIntro() { //#if !DEBUG this.TopMost = true; //#endif this.Location = new Point(0, 0); this.StartPosition = FormStartPosition.Manual; this.BackColor = Color.Black; this.ShowInTaskbar = false; // read options from the game config var lines = File.ReadAllLines(NFKHelper.GetOrCreateConfigFile()); foreach (var l in lines) { // extract window size if (l.Trim().StartsWith("r_mode")) { var parts = l.Trim().Split(' '); if (parts.Length == 3) { int.TryParse(parts[1], out w); int.TryParse(parts[2], out h); } } // switch to full screen if game is zoomwindowed if (l.Trim().StartsWith("zoomwindow")) { this.WindowState = FormWindowState.Maximized; } } InitializeComponent(); this.Width = w; this.Height = h + WINDOW_HEADER_HEIGHT; }
private void LinkConfig_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var fileName = NFKHelper.GetOrCreateConfigFile(); var p = Process.Start("explorer.exe", "/select, \"" + fileName + "\""); }