private void newToolStripMenuItem_Click(object sender, EventArgs e) { MapOptions mo = new Snakii.MapOptions(optionsType.New); Map newMap = Map.NewMap(); mo.ShowDialog(); if (mo.DialogResult == DialogResult.OK) { newMap.Name = mo.MapName; newMap.Description = mo.MapDescription; newMap.objective = mo.ObjectiveType; newMap.objectivevalue = mo.ObjectiveValue; MapEditor ed = new MapEditor(newMap); ed.Show(); this.Close(); } }
private void newButton_Click(object sender, EventArgs e) { MapOptions mo = new Snakii.MapOptions(optionsType.New); Map newMap = Map.NewMap(); mo.ShowDialog(); if (mo.DialogResult == DialogResult.OK) { newMap.Name = mo.MapName; newMap.Description = mo.MapDescription; newMap.objective = mo.ObjectiveType; newMap.objectivevalue = mo.ObjectiveValue; ChosenMap = newMap; SkipObjectives = false; DialogResult = DialogResult.OK; this.Close(); } }
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { MapOptions mo = new Snakii.MapOptions(optionsType.Edit, edit); mo.ShowDialog(); if (mo.DialogResult == DialogResult.OK) { edit.Description = mo.MapDescription; edit.objective = mo.ObjectiveValue; edit.objective = mo.ObjectiveType; if (edit.Name != mo.MapName) { if (File.Exists("Map/" + edit.Name + ".json")) { File.Move("Map/" + edit.Name + ".json", "Map/" + mo.MapName + ".json"); } } edit.Name = mo.MapName; Save(); } }