Update COLEditor to only return DialogResult.OK once saved

This commit is contained in:
miku-666
2022-09-01 20:23:19 +02:00
parent 9d0ab00599
commit 61b13599dc
3 changed files with 5 additions and 9 deletions

View File

@@ -290,7 +290,6 @@ namespace PckStudio.Forms.Editor
this.Name = "COLEditor";
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.COLEditor_FormClosing);
this.metroPanel1.ResumeLayout(false);
this.metroPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).EndInit();

View File

@@ -82,7 +82,8 @@ namespace PckStudio.Forms.Editor
COLFileWriter.Write(stream, colurfile);
_file.SetData(stream.ToArray());
}
}
DialogResult = DialogResult.OK;
}
static byte[] StringToByteArrayFastest(string hex)
{
@@ -101,7 +102,7 @@ namespace PckStudio.Forms.Editor
static int GetHexVal(char hex)
{
int val = (int)hex;
int val = hex;
return val - (val < 58 ? 48 : (val < 97 ? 55 : 87));
}
@@ -219,10 +220,5 @@ namespace PckStudio.Forms.Editor
}
colorPick.Dispose();
}
private void COLEditor_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult = DialogResult.OK;
}
}
}

View File

@@ -2714,7 +2714,8 @@ namespace PckStudio
file.filepath == "colours.col") // .col file
{
using COLEditor diag = new COLEditor(file);
diag.ShowDialog(this);
if (diag.ShowDialog(this) == DialogResult.OK)
saved = false;
}
}