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

@ -323,7 +323,7 @@ void init()
ConsoleConstructor::setup();
// Set up the parser(s)
CON_ADD_PARSER(CMD, "cs", true); // TorqueScript
CON_ADD_PARSER(CMD, TORQUE_SCRIPT_EXTENSION, true); // TorqueScript
// Setup the console types.
ConsoleBaseType::initialize();
@ -1184,7 +1184,7 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript)
Con::expandScriptFilename(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), fileName);
// since this function expects a script file reference, if it's a .dso
// lets terminate the string before the dso so it will act like a .cs
// lets terminate the string before the dso so it will act like a .tscript
if (dStrEndsWith(scriptFilenameBuffer, ".dso"))
{
scriptFilenameBuffer[dStrlen(scriptFilenameBuffer) - dStrlen(".dso")] = '\0';
@ -1206,11 +1206,11 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript)
// Check Editor Extensions
bool isEditorScript = false;
// If the script file extension is '.ed.cs' then compile it to a different compiled extension
if (dStricmp(ext, ".cs") == 0)
// If the script file extension is '.ed.tscript' then compile it to a different compiled extension
if (dStricmp(ext, "." TORQUE_SCRIPT_EXTENSION) == 0)
{
const char* ext2 = ext - 3;
if (dStricmp(ext2, ".ed.cs") == 0)
if (dStricmp(ext2, ".ed." TORQUE_SCRIPT_EXTENSION) == 0)
isEditorScript = true;
}
else if (dStricmp(ext, ".gui") == 0)