correct the %dedicated var in function parseArgs()

-it's supposed to be a global like the rest.
also by request, added a help.txt file dump to the -help cli arg
This commit is contained in:
AzaezelX 2022-09-29 00:51:44 -05:00
parent 8993052a14
commit 8a71a6141f
3 changed files with 23 additions and 17 deletions

View file

@ -500,17 +500,23 @@ function displayHelp()
// -log 2 overwrites any existing logfile; it also only closes // -log 2 overwrites any existing logfile; it also only closes
// the logfile when the application shuts down. (default) // the logfile when the application shuts down. (default)
error( %helpstring = "Torque Demo command line options:\n";
"Torque Demo command line options:\n"@ %helpstring =%helpstring @ " -log <logmode> Logging behavior; see main." @ $TorqueScriptFileExtension @ " comments for details\n";
" -log <logmode> Logging behavior; see main." @ $TorqueScriptFileExtension @ " comments for details\n"@ %helpstring =%helpstring @ " -game <game_name> Reset list of mods to only contain <game_name>\n";
" -game <game_name> Reset list of mods to only contain <game_name>\n"@ %helpstring =%helpstring @ " <game_name> Works like the -game argument\n";
" <game_name> Works like the -game argument\n"@ %helpstring =%helpstring @ " -dir <dir_name> Add <dir_name> to list of directories\n";
" -dir <dir_name> Add <dir_name> to list of directories\n"@ %helpstring =%helpstring @ " -console Open a separate console\n";
" -console Open a separate console\n"@ %helpstring =%helpstring @ " -jSave <file_name> Record a journal\n";
" -jSave <file_name> Record a journal\n"@ %helpstring =%helpstring @ " -jPlay <file_name> Play back a journal\n";
" -jPlay <file_name> Play back a journal\n"@ %helpstring =%helpstring @ " -help Display this help message\n";
" -help Display this help message\n"
); error(%helpstring);
%file = new FileObject();
if(%file.openForWrite("help.txt"))
%file.writeLine(%helpstring);
%file.close();
%file.delete();
} }
// Execute startup scripts for each mod, starting at base and working up // Execute startup scripts for each mod, starting at base and working up

View file

@ -55,7 +55,7 @@ function parseArgs()
{ {
$userDirs = $defaultGame; $userDirs = $defaultGame;
$dirCount = 1; $dirCount = 1;
%isDedicated = true; $isDedicated = true;
}*/ }*/
switch$ ($arg) switch$ ($arg)
@ -64,7 +64,7 @@ function parseArgs()
case "-dedicated": case "-dedicated":
$userDirs = $defaultGame; $userDirs = $defaultGame;
$dirCount = 1; $dirCount = 1;
%isDedicated = true; $isDedicated = true;
$Server::Dedicated = true; $Server::Dedicated = true;
enableWinConsole(true); enableWinConsole(true);
$argUsed[%i]++; $argUsed[%i]++;
@ -138,7 +138,7 @@ function parseArgs()
{ {
// Set the selected dir --NOTE: we no longer allow tools with this argument // Set the selected dir --NOTE: we no longer allow tools with this argument
/* /*
if( %isDedicated ) if( $isDedicated )
{ {
$userDirs = $nextArg; $userDirs = $nextArg;
$dirCount = 1; $dirCount = 1;
@ -311,7 +311,7 @@ function parseArgs()
case "-help": case "-help":
$displayHelp = true; $displayHelp = true;
$argUsed[%i]++; $argUsed[%i]++;
displayHelp();
//------------------- //-------------------
case "-compileAll": case "-compileAll":
$compileAll = true; $compileAll = true;

View file

@ -44,7 +44,7 @@ if(isFunction("loadStartup"))
else else
{ {
//If nothing else set a main menu, try to do so now //If nothing else set a main menu, try to do so now
if(!isObject(Canvas.getContent())) if(isObject(Canvas) || !isObject(Canvas.getContent()))
{ {
if (isObject( ProjectSettings.value("UI/mainMenuName") )) if (isObject( ProjectSettings.value("UI/mainMenuName") ))
Canvas.setContent( ProjectSettings.value("UI/mainMenuName") ); Canvas.setContent( ProjectSettings.value("UI/mainMenuName") );