public static System.Windows.Forms.MenuItem GetShowOptions() { var modOptions = new System.Windows.Forms.MenuItem("Change Game Options") { Enabled = Program.TasClient.MyBattle != null }; modOptions.Click += (s, e) => { var form = new Form { Width = 1000, Height = 300, Icon = ZklResources.ZkIcon, Text = "Game options" }; var optionsControl = new ModOptionsControl { Dock = DockStyle.Fill }; form.Controls.Add(optionsControl); Program.TasClient.BattleClosed += (s2, e2) => { form.Close(); form.Dispose(); optionsControl.Dispose(); }; form.Show(); //hack show Program.FormMain }; return(modOptions); }
public static void ShowGameOptions() { var form = new Form { Width = 1000, Height = 300, Icon = ZklResources.ZkIcon, Text = "Game options" }; var optionsControl = new ModOptionsControl { Dock = DockStyle.Fill }; form.Controls.Add(optionsControl); Program.TasClient.BattleClosed += (s2, e2) => { form.Close(); form.Dispose(); optionsControl.Dispose(); }; form.Show(); //hack show Program.FormMain }