[Scummvm-git-logs] scummvm master -> 7a3f2c452d3cf71bc9552cd4680489734fcf50e6

djsrv dservilla at gmail.com
Thu Jun 11 14:41:45 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7a3f2c452d DIRECTOR: LINGO: Write files as plaintext


Commit: 7a3f2c452d3cf71bc9552cd4680489734fcf50e6
    https://github.com/scummvm/scummvm/commit/7a3f2c452d3cf71bc9552cd4680489734fcf50e6
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-11T10:39:50-04:00

Commit Message:
DIRECTOR: LINGO: Write files as plaintext

Changed paths:
    engines/director/lingo/xlibs/fileio.cpp


diff --git a/engines/director/lingo/xlibs/fileio.cpp b/engines/director/lingo/xlibs/fileio.cpp
index cb53999b01..a27eae62a2 100644
--- a/engines/director/lingo/xlibs/fileio.cpp
+++ b/engines/director/lingo/xlibs/fileio.cpp
@@ -136,12 +136,14 @@ void FileIO::m_new(int nargs) {
 
 	if (option.hasPrefix("?")) {
 		option = option.substr(1);
-		GUI::FileBrowserDialog browser(0, filename.c_str(), option.equalsIgnoreCase("read") ? GUI::kFBModeLoad : GUI::kFBModeSave);
+		GUI::FileBrowserDialog browser(0, "txt", option.equalsIgnoreCase("read") ? GUI::kFBModeLoad : GUI::kFBModeSave);
 		if (browser.runModal() <= 0) {
 			g_lingo->push(Datum(kErrorFileNotFound));
 			return;
 		}
 		filename = browser.getResult();
+	} else {
+		filename += ".txt";
 	}
 
 	if (option.equalsIgnoreCase("read")) {
@@ -155,7 +157,7 @@ void FileIO::m_new(int nargs) {
 	} else if (option.equalsIgnoreCase("write")) {
 		// OutSaveFile is not seekable so create a separate seekable stream
 		// which will be written to the outfile upon disposal
-		me->outFile = g_system->getSavefileManager()->openForSaving(filename);
+		me->outFile = g_system->getSavefileManager()->openForSaving(filename, false);
 		me->outStream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES);
 		if (!me->outFile) {
 			delete me;
@@ -169,7 +171,7 @@ void FileIO::m_new(int nargs) {
 			g_lingo->push(Datum(kErrorIO));
 			return;
 		}
-		me->outFile = g_system->getSavefileManager()->openForSaving(filename);
+		me->outFile = g_system->getSavefileManager()->openForSaving(filename, false);
 		me->outStream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES);
 		if (!me->outFile) {
 			delete me;




More information about the Scummvm-git-logs mailing list