Add model update button.

This commit is contained in:
Ottermandias 2024-07-07 16:17:12 +02:00
parent 4f0f3721a6
commit 0d939b12f4
3 changed files with 24 additions and 7 deletions

View file

@ -207,12 +207,15 @@ public class FileEditor<T>(
var canSave = _changed && _currentFile is { Valid: true };
if (ImGuiUtil.DrawDisabledButton("Save to File", Vector2.Zero,
$"Save the selected {fileType} file with all changes applied. This is not revertible.", !canSave))
{
compactor.WriteAllBytes(_currentPath!.File.FullName, _currentFile!.Write());
if (owner.Mod != null)
communicator.ModFileChanged.Invoke(owner.Mod, _currentPath);
_changed = false;
}
SaveFile();
}
public void SaveFile()
{
compactor.WriteAllBytes(_currentPath!.File.FullName, _currentFile!.Write());
if (owner.Mod != null)
communicator.ModFileChanged.Invoke(owner.Mod, _currentPath);
_changed = false;
}
private void ResetButton()