private void SaveLayerButton_Click(object sender, EventArgs e) { if (_IsNew) { if (WorldRef.Layers.ContainsKey(LayerName.Text.ToLower())) { MessageBox.Show("Please Enter A Unique Layer Name"); return; } } LayerInformationResult = new NebulaGames.RPGWorld.GameBuilder.LayerInfo(); LayerInformationResult.Name = LayerName.Text; LayerInformationResult.LayerType = (NebulaGames.RPGWorld.Enumerations.LayerType)Enum.Parse(typeof(NebulaGames.RPGWorld.Enumerations.LayerType), LayerType.EditValue.ToString()); LayerInformationResult.Visible = IsVisible.Checked; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
public DialogResult Show(NebulaGames.RPGWorld.GameBuilder.EditorWorld CurrentWorld, NebulaGames.RPGWorld.GameBuilder.LayerInfo CurrentLayerInfo) { WorldRef = CurrentWorld; LayerName.Text = CurrentLayerInfo.Name; LayerType.SelectedIndex = LayerType.Properties.Items.GetItemIndexByValue(CurrentLayerInfo.LayerType.ToString()); IsVisible.Checked = CurrentLayerInfo.Visible; _IsNew = false; return(this.ShowDialog()); }