mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-05 17:26:28 +00:00
Update COLEditor to only return DialogResult.OK once saved
This commit is contained in:
1
PCK-Studio/Forms/Editor/COLEditor.Designer.cs
generated
1
PCK-Studio/Forms/Editor/COLEditor.Designer.cs
generated
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user