mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Parametrize script extension, default to 'tscript'
This commit is contained in:
parent
b8b62292bd
commit
099dd4f1f3
542 changed files with 774 additions and 783 deletions
|
|
@ -294,7 +294,7 @@ DefineEngineStaticMethod( BanList, export, void, ( const char* filename ),,
|
|||
"Dump the banlist to a file.\n\n"
|
||||
"@param filename Path of the file to write the list to.\n\n"
|
||||
"@tsexample\n"
|
||||
"BanList::Export(\"./server/banlist.cs\");\n"
|
||||
"BanList::Export(\"./server/banlist." TORQUE_SCRIPT_EXTENSION "\");\n"
|
||||
"@endtsexample\n\n")
|
||||
{
|
||||
BanList::instance()->exportToFile( filename );
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
/// Initialize core libraries and call registered init functions
|
||||
static void init();
|
||||
|
||||
/// Pass command line arguments to registered functions and main.cs
|
||||
/// Pass command line arguments to registered functions and main.tscript
|
||||
static bool handleCommandLine(S32 argc, const char **argv);
|
||||
|
||||
/// A standard mainloop implementation.
|
||||
|
|
@ -53,4 +53,4 @@ private:
|
|||
static void preShutdown();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEve
|
|||
|
||||
"@tsexample\n"
|
||||
"// Create a standard function. Needs to be executed on the client, such \n"
|
||||
"// as within scripts/client/default.bind.cs\n"
|
||||
"// as within scripts/client/default.bind." TORQUE_SCRIPT_EXTENSION "\n"
|
||||
"function toggleCamera(%val)\n"
|
||||
"{\n"
|
||||
" // If key was down, call a server command named 'ToggleCamera'\n"
|
||||
|
|
@ -228,7 +228,7 @@ DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEve
|
|||
" commandToServer('ToggleCamera');\n"
|
||||
"}\n\n"
|
||||
"// Server command being called from above. Needs to be executed on the \n"
|
||||
"// server, such as within scripts/server/commands.cs\n"
|
||||
"// server, such as within scripts/server/commands." TORQUE_SCRIPT_EXTENSION "\n"
|
||||
"function serverCmdToggleCamera(%client)\n"
|
||||
"{\n"
|
||||
" if (%client.getControlObject() == %client.player)\n"
|
||||
|
|
@ -264,7 +264,7 @@ DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEve
|
|||
|
||||
"@tsexample\n"
|
||||
"// Set up the client command. Needs to be executed on the client, such as\n"
|
||||
"// within scripts/client/client.cs\n"
|
||||
"// within scripts/client/client." TORQUE_SCRIPT_EXTENSION "\n"
|
||||
"// Update the Ammo Counter with current ammo, if not any then hide the counter.\n"
|
||||
"function clientCmdSetAmmoAmountHud(%amount)\n"
|
||||
"{\n"
|
||||
|
|
@ -277,7 +277,7 @@ DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEve
|
|||
" }\n"
|
||||
"}\n\n"
|
||||
"// Call it from a server function. Needs to be executed on the server, \n"
|
||||
"//such as within scripts/server/game.cs\n"
|
||||
"//such as within scripts/server/game." TORQUE_SCRIPT_EXTENSION "\n"
|
||||
"function GameConnection::setAmmoAmountHud(%client, %amount)\n"
|
||||
"{\n"
|
||||
" commandToClient(%client, 'SetAmmoAmountHud', %amount);\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue