mirror of
https://github.com/kwsch/pkNX.git
synced 2026-09-09 02:55:21 -05:00
Simplify dialog result pattern
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using pkNX.Containers;
|
||||
using pkNX.Game;
|
||||
using pkNX.Randomization;
|
||||
@@ -204,9 +205,7 @@ private void PopWildEdit(string file)
|
||||
var obj = FlatBufferConverter.DeserializeFrom<EncounterArchive7b>(winner);
|
||||
|
||||
using var form = new GGWE(ROM, obj);
|
||||
form.ShowDialog();
|
||||
var result = form.Result;
|
||||
if (string.IsNullOrWhiteSpace(result))
|
||||
if (form.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
|
||||
var data = FlatBufferConverter.SerializeFrom(obj);
|
||||
|
||||
@@ -279,8 +279,6 @@ private void SaveEntry(int i)
|
||||
EL_Sky.SaveCurrent();
|
||||
}
|
||||
|
||||
public string Result { get; set; }
|
||||
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveEntry(entry);
|
||||
@@ -291,7 +289,7 @@ private void B_Save_Click(object sender, EventArgs e)
|
||||
EL_Super.SaveCurrent();
|
||||
EL_Sky.SaveCurrent();
|
||||
|
||||
Result = "OK";
|
||||
DialogResult = DialogResult.OK;
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user