PreSave can now cancel the Saving of PCK Files

This commit is contained in:
MayNL
2026-06-28 19:01:36 -04:00
parent 066cf8801f
commit cf0a5de7b1
2 changed files with 7 additions and 4 deletions
+4 -3
View File
@@ -41,15 +41,16 @@ namespace PckStudio.Controls
public void SetSaveContext(ISaveContext<T> saveContext) => SaveContext = saveContext;
protected virtual void PreSave()
{ }
protected virtual bool PreSave()
{ return true; }
protected virtual void PostSave()
{ }
public void Save()
{
PreSave();
if (!PreSave())
return;
SaveContext.Save(EditorValue);
PostSave();
}
+3 -1
View File
@@ -185,9 +185,11 @@ namespace PckStudio.Controls
);
}
protected override void PreSave()
protected override bool PreSave()
{
EditorValue.Endianness = BigEndianCheckBox.Checked ? OMI.ByteOrder.BigEndian : OMI.ByteOrder.LittleEndian;
return true;
}
protected override void PostSave()