Skip to content

Commit 69adfde

Browse files
committed
Save means overwrite file. Fixes #88
1 parent 9697da9 commit 69adfde

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

AvaGui/ViewModels/DatTypes/DatObjectEditorViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ public void SaveCurrentObject()
144144
return;
145145
}
146146

147-
var savePath = CurrentFile.FileLocation == FileLocation.Local ? CurrentFile.Filename : Path.Combine(Model.Settings.DownloadFolder, Path.ChangeExtension(CurrentFile.Name, ".dat"));
147+
var savePath = CurrentFile.FileLocation == FileLocation.Local
148+
? Path.Combine(Model.Settings.ObjDataDirectory, CurrentFile.Filename)
149+
: Path.Combine(Model.Settings.DownloadFolder, Path.ChangeExtension(CurrentFile.Name, ".dat"));
150+
148151
Logger?.Info($"Saving {CurrentObject.DatFileInfo.S5Header.Name} to {savePath}");
149152
SawyerStreamWriter.Save(savePath, CurrentObject.DatFileInfo.S5Header.Name, CurrentObject.LocoObject);
150153
}

0 commit comments

Comments
 (0)