DavidKinder / Windows-Frotz

Z-code interpreter for Windows, based on Stefan Jokisch's Frotz interpreter core.
http://www.davidkinder.co.uk/frotz.html
GNU General Public License v2.0
62 stars 12 forks source link

"Write out a script" appends but message box says it replaces #32

Closed morganwillcock closed 4 months ago

morganwillcock commented 5 months ago

When using Windows Frotz 1.25 I noticed that re-using a log file for script output appends to the log file, but the messaging which is presented to the user indicates that the file content is going to be replaced. The easiest way to demonstrate this is to create a new file with some content in it:

>game.log echo Test message

...then use the script command in a game and choose to use the log file which was just created. The "Confirm Save As" prompt indicates that the file will be replaced: replace ...but the original content of the log file is preserved:

type game.log
Test message
Transcript enabled.

>
DavidKinder commented 4 months ago

That "Confirm Save As" dialog is coming from Windows, because when the file dialog is called for saving any file, the flag that triggers an overwrite warning is set. I've fixed this so the flag is not set for script files in commit https://github.com/DavidKinder/Windows-Frotz/commit/e77fc34a0a345840fc997a87d629f85a8bb62650.