mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-22 16:39:27 +01:00
Prevent saving invalid files
This commit is contained in:
parent
2e76148fba
commit
c96adcf557
1 changed files with 2 additions and 1 deletions
|
|
@ -204,8 +204,9 @@ public class FileEditor<T>(
|
|||
|
||||
private void SaveButton()
|
||||
{
|
||||
var canSave = _changed && _currentFile != null && _currentFile.Valid;
|
||||
if (ImGuiUtil.DrawDisabledButton("Save to File", Vector2.Zero,
|
||||
$"Save the selected {fileType} file with all changes applied. This is not revertible.", !_changed))
|
||||
$"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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue