mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-09-23 07:22:25 +00:00
PreSave can now cancel the Saving of PCK Files
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user