public MapMakerF() { InitializeComponent(); MinimumSize = MaximumSize = Size; MaximizeBox = false; Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); IsMaking = false; MapsManager.RemoveMapsFiles(); Global.Maps.Clear(); _kindClientStep = new KindClientStep(StepMapChoosen) { Parent = panel1 }; FormClosing += (sender, e) => { if (IsMaking) { DialogResult = DialogResult.OK; return; } if (MessageBox.Show("Do you want really quit?", "", MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; } else { DialogResult = DialogResult.Abort; } }; }
private void AssignEvents() { comboBoxClientNum.SelectedIndexChanged += (sender, e) => { if (!_checkSelected) { return; } if (comboBoxClientNum.Items.Count > 0 && comboBoxClientNum.SelectedIndex >= 0) { ClientInfo client = (ClientInfo)comboBoxClientNum.Items[comboBoxClientNum.SelectedIndex]; UOClientManager.AttachToClient(client.handle); } }; customButtonRefreshClients.Click += (sender, e) => { ReloadClients(); }; customButtonRebuildMaps.Click += (sender, e) => { if (MessageBox.Show("All maps will be lost.\r\n\r\nAre you sure to continue?", "Attention!", MessageBoxButtons.YesNo) == DialogResult.No) { return; } ParentForm.Hide(); MapsManager.RemoveMapsFiles(); Global.MainWindow.RebuildMaps(true); Global.MainWindow.Show(); }; numericUpDownFPS.ValueChanged += (sender, e) => { Global.SettingsCollection["fps"] = numericUpDownFPS.Value; Global.MainWindow.SetTimerIntervalByFps((int)numericUpDownFPS.Value); }; radioButtonDetailed.CheckedChanged += (sender, e) => { if (radioButtonDetailed.Checked) { Global.SettingsCollection["mapkind"] = 0; Global.Facet = Global.Facet; } }; radioButtonNormal.CheckedChanged += (sender, e) => { if (radioButtonNormal.Checked) { Global.SettingsCollection["mapkind"] = 1; Global.Facet = Global.Facet; } }; customFlatButtonCheckNewVersion.Click += (sender, e) => { Core.Network.Update.CheckUpdates(); }; radioButtonEnhanced.CheckedChanged += (sender, e) => { label3.Visible = textBoxClientPath.Visible = customButtonClientPath.Visible = radioButtonEnhanced.Checked; }; customButtonClientPath.Click += (sender, e) => { FolderBrowserDialog dialog = new FolderBrowserDialog { Description = "Select enhanced client folder" }; if (dialog.ShowDialog() == DialogResult.OK) { Global.SettingsCollection["clientpath"] = Global.UOPath = textBoxClientPath.Text = dialog.SelectedPath; } }; numericUpDownChatFontSize.ValueChanged += (sender, e) => { Global.SettingsCollection["chatfontsize"] = (int)numericUpDownChatFontSize.Value; Global.MainWindow.ChatWindow?.ChangeFontSize(); }; }