Parametrize script extension, default to 'tscript'

This commit is contained in:
Lukas Aldershaab 2020-12-12 16:54:16 +01:00
parent b8b62292bd
commit 099dd4f1f3
542 changed files with 774 additions and 783 deletions

View file

@ -436,7 +436,7 @@ bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv )
}
#endif
// Executes an entry script file. This is "main.cs"
// Executes an entry script file. This is "main.tscript"
// by default, but any file name (with no whitespace
// in it) may be run if it is specified as the first
// command-line parameter. The script used, default
@ -459,7 +459,7 @@ bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv )
// The working filestream.
FileStream str;
const char *defaultScriptName = "main.cs";
const char *defaultScriptName = "main." TORQUE_SCRIPT_EXTENSION;
bool useDefaultScript = true;
// Check if any command-line parameters were passed (the first is just the app name).
@ -493,14 +493,14 @@ bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv )
{
OpenFileDialog ofd;
FileDialogData &fdd = ofd.getData();
fdd.mFilters = StringTable->insert("Main Entry Script (main.cs)|main.cs|");
fdd.mFilters = StringTable->insert("Main Entry Script (main." TORQUE_SCRIPT_EXTENSION ")|main." TORQUE_SCRIPT_EXTENSION "|");
fdd.mTitle = StringTable->insert("Locate Game Entry Script");
// Get the user's selection
if( !ofd.Execute() )
return false;
// Process and update CWD so we can run the selected main.cs
// Process and update CWD so we can run the selected main.tscript
S32 pathLen = dStrlen( fdd.mFile );
FrameTemp<char> szPathCopy( pathLen + 1);