diff --git a/Engine/source/T3D/aiConnection.cpp b/Engine/source/T3D/aiConnection.cpp index 21564d5eb..42ed1dff3 100644 --- a/Engine/source/T3D/aiConnection.cpp +++ b/Engine/source/T3D/aiConnection.cpp @@ -130,7 +130,7 @@ static inline F32 moveClamp(F32 v) //----------------------------------------------------------------------------- /// Construct and connect an AI connection object -ConsoleFunction(aiConnect, S32 , 2, 20, "(...)" +DefineEngineStringlyVariadicFunction(aiConnect, S32 , 2, 20, "(...)" "@brief Creates a new AIConnection, and passes arguments to its onConnect script callback.\n\n" "@returns The newly created AIConnection\n" "@see GameConnection for parameter information\n" diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index 2376e7180..dc5f69367 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -326,7 +326,7 @@ DefineEngineMethod( GameConnection, setJoinPassword, void, (const char* password object->setJoinPassword(password); } -ConsoleMethod(GameConnection, setConnectArgs, void, 3, 17, +DefineEngineStringlyVariadicMethod(GameConnection, setConnectArgs, void, 3, 17, "(const char* args) @brief On the client, pass along a variable set of parameters to the server.\n\n" "Once the connection is established with the server, the server calls its onConnect() method " diff --git a/Engine/source/afx/afxCamera.cpp b/Engine/source/afx/afxCamera.cpp index 1aad5f455..3c460dad8 100644 --- a/Engine/source/afx/afxCamera.cpp +++ b/Engine/source/afx/afxCamera.cpp @@ -452,7 +452,7 @@ const char* afxCamera::getMode() static char buffer[100]; -ConsoleMethod(afxCamera, setOrbitMode, void, 7, 8, +DefineEngineStringlyVariadicMethod(afxCamera, setOrbitMode, void, 7, 8, "(GameBase orbitObject, TransformF mat, float minDistance, float maxDistance, float curDistance, bool ownClientObject)" "Set the camera to orbit around some given object.\n\n" "@param orbitObject Object we want to orbit.\n" diff --git a/Engine/source/afx/afxMagicSpell.cpp b/Engine/source/afx/afxMagicSpell.cpp index 7aeb93da8..b7f2714ea 100644 --- a/Engine/source/afx/afxMagicSpell.cpp +++ b/Engine/source/afx/afxMagicSpell.cpp @@ -2633,29 +2633,29 @@ DefineEngineMethod(afxMagicSpell, getImpactedObject, S32, (),, return (imp_obj) ? imp_obj->getId() : -1; } -ConsoleMethod(afxMagicSpell, setTimeFactor, void, 3, 4, "(F32 factor) or (string phase, F32 factor)" - "Sets the time-factor for the spell, either overall or for a specific phrase.\n\n" - "@ingroup AFX") +DefineEngineStringlyVariadicMethod(afxMagicSpell, setTimeFactor, void, 3, 4, "(F32 factor) or (string phase, F32 factor)" + "Sets the time-factor for the spell, either overall or for a specific phrase.\n\n" + "@ingroup AFX") { - if (argc == 3) - object->setTimeFactor(dAtof(argv[2])); - else - { - if (dStricmp(argv[2], "overall") == 0) - object->setTimeFactor(dAtof(argv[3])); - else if (dStricmp(argv[2], "casting") == 0) - object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "launch") == 0) - object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "delivery") == 0) - object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "impact") == 0) - object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, dAtof(argv[3])); - else if (dStricmp(argv[2], "linger") == 0) - object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, dAtof(argv[3])); - else - Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getStringValue()); - } + if (argc == 3) + object->setTimeFactor(dAtof(argv[2])); + else + { + if (dStricmp(argv[2], "overall") == 0) + object->setTimeFactor(dAtof(argv[3])); + else if (dStricmp(argv[2], "casting") == 0) + object->setTimeFactor(afxMagicSpell::CASTING_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "launch") == 0) + object->setTimeFactor(afxMagicSpell::LAUNCH_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "delivery") == 0) + object->setTimeFactor(afxMagicSpell::DELIVERY_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "impact") == 0) + object->setTimeFactor(afxMagicSpell::IMPACT_PHRASE, dAtof(argv[3])); + else if (dStricmp(argv[2], "linger") == 0) + object->setTimeFactor(afxMagicSpell::LINGER_PHRASE, dAtof(argv[3])); + else + Con::errorf("afxMagicSpell::setTimeFactor() -- unknown spell phrase [%s].", argv[2].getStringValue()); + } } DefineEngineMethod(afxMagicSpell, interruptStage, void, (),, diff --git a/Engine/source/afx/arcaneFX.cpp b/Engine/source/afx/arcaneFX.cpp index 4252183c1..385c056f6 100644 --- a/Engine/source/afx/arcaneFX.cpp +++ b/Engine/source/afx/arcaneFX.cpp @@ -860,18 +860,18 @@ DefineEngineFunction(getMaxF, F32, (float a, float b),, return getMax(a, b); } -ConsoleFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" - "Like echo(), but first argument is returned.\n" - "@ingroup AFX") +DefineEngineStringlyVariadicFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" + "Like echo(), but first argument is returned.\n" + "@ingroup AFX") { U32 len = 0; S32 i; - for(i = 2; i < argc; i++) + for (i = 2; i < argc; i++) len += dStrlen(argv[i]); char *ret = Con::getReturnBuffer(len + 1); ret[0] = 0; - for(i = 2; i < argc; i++) + for (i = 2; i < argc; i++) dStrcat(ret, argv[i], len + 1); Con::printf("%s -- [%s]", ret, argv[1].getStringValue()); @@ -880,7 +880,7 @@ ConsoleFunction(echoThru, const char*, 2, 0, "(string passthru, string text...)" return argv[1]; } -ConsoleFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" +DefineEngineStringlyVariadicFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" "Like warn(), but first argument is returned.\n" "@ingroup AFX") { @@ -900,7 +900,7 @@ ConsoleFunction(warnThru, const char*, 2, 0, "(string passthru, string text...)" return argv[1]; } -ConsoleFunction(errorThru, const char*, 2, 0, "(string passthru, string text...)" +DefineEngineStringlyVariadicFunction(errorThru, const char*, 2, 0, "(string passthru, string text...)" "Like error(), but first argument is returned.\n" "@ingroup AFX") { diff --git a/Engine/source/app/net/net.cpp b/Engine/source/app/net/net.cpp index c5f1be189..abec3ccc1 100644 --- a/Engine/source/app/net/net.cpp +++ b/Engine/source/app/net/net.cpp @@ -212,7 +212,7 @@ ConsoleDocClass( RemoteCommandEvent, ConsoleFunctionGroupBegin( Net, "Functions for use with the network; tagged strings and remote commands."); -ConsoleFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandArgs + 1, "(string func, ...)" +DefineEngineStringlyVariadicFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandArgs + 1, "(string func, ...)" "@brief Send a command to the server.\n\n" "@param func Name of the server command being called\n" @@ -255,7 +255,7 @@ ConsoleFunction( commandToServer, void, 2, RemoteCommandEvent::MaxRemoteCommandA RemoteCommandEvent::sendRemoteCommand(conn, args.count(), args); } -ConsoleFunction( commandToClient, void, 3, RemoteCommandEvent::MaxRemoteCommandArgs + 2, "(NetConnection client, string func, ...)" +DefineEngineStringlyVariadicFunction( commandToClient, void, 3, RemoteCommandEvent::MaxRemoteCommandArgs + 2, "(NetConnection client, string func, ...)" "@brief Send a command from the server to the client\n\n" "@param client The numeric ID of a client GameConnection\n" @@ -349,7 +349,7 @@ DefineEngineFunction(getTaggedString, const char* , (const char *tag), (""), -ConsoleFunction( buildTaggedString, const char*, 2, 11, "(string format, ...)" +DefineEngineStringlyVariadicFunction( buildTaggedString, const char*, 2, 11, "(string format, ...)" "@brief Build a string using the specified tagged string format.\n\n" "This function takes an already tagged string (passed in as a tagged string ID) and one " diff --git a/Engine/source/cinterface/c_scripting.cpp b/Engine/source/cinterface/c_scripting.cpp index 1138cbc1c..f10effde2 100644 --- a/Engine/source/cinterface/c_scripting.cpp +++ b/Engine/source/cinterface/c_scripting.cpp @@ -420,7 +420,7 @@ extern "C" { } -ConsoleFunction(TestFunction2Args, const char *, 3, 3, "testFunction(arg1, arg2)") +DefineEngineStringlyVariadicFunction(TestFunction2Args, const char *, 3, 3, "testFunction(arg1, arg2)") { return "Return Value"; } diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index 358b738f9..dfa3cd5a8 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -1191,11 +1191,6 @@ public: # define ConsoleFunctionGroupBegin(groupName, usage) \ static ConsoleConstructor cfg_ConsoleFunctionGroup_##groupName##_GroupBegin(NULL,#groupName,usage) -# define ConsoleFunction(name,returnType,minArgs,maxArgs,usage1) \ - returnType cf_##name(SimObject *, S32, ConsoleValueRef *argv); \ - ConsoleConstructor cc_##name##_obj(NULL,#name,cf_##name,usage1,minArgs,maxArgs); \ - returnType cf_##name(SimObject *, S32 argc, ConsoleValueRef *argv) - # define ConsoleToolFunction(name,returnType,minArgs,maxArgs,usage1) \ returnType ctf_##name(SimObject *, S32, ConsoleValueRef *argv); \ ConsoleConstructor cc_##name##_obj(NULL,#name,ctf_##name,usage1,minArgs,maxArgs, true); \ @@ -1211,15 +1206,6 @@ public: # define ConsoleMethodGroupBegin(className, groupName, usage) \ static ConsoleConstructor cc_##className##_##groupName##_GroupBegin(#className,#groupName,usage) -# define ConsoleMethod(className,name,returnType,minArgs,maxArgs,usage1) \ - inline returnType cm_##className##_##name(className *, S32, ConsoleValueRef *argv); \ - returnType cm_##className##_##name##_caster(SimObject *object, S32 argc, ConsoleValueRef *argv) { \ - AssertFatal( dynamic_cast( object ), "Object passed to " #name " is not a " #className "!" ); \ - conmethod_return_##returnType ) cm_##className##_##name(static_cast(object),argc,argv); \ - }; \ - ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage1,minArgs,maxArgs); \ - inline returnType cm_##className##_##name(className *object, S32 argc, ConsoleValueRef *argv) - # define ConsoleMethodGroupEnd(className, groupName) \ static ConsoleConstructor cc_##className##_##groupName##_GroupEnd(#className,#groupName,NULL) diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 565c79206..33c1c9a5f 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -1200,7 +1200,7 @@ DefineEngineFunction( isValidIP, bool, ( const char* str),, // Torque won't normally add another string if it already exists with another casing, // so this forces the addition. It should be called once near the start, such as in main.cs. -ConsoleFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" +DefineEngineStringlyVariadicFunction(addCaseSensitiveStrings,void,2,0,"[string1, string2, ...]" "Adds case sensitive strings to the StringTable.") { for(int i = 1; i < argc; i++) @@ -1879,7 +1879,7 @@ DefineEngineFunction( getTag, const char*, ( const char* textTagString ), , "( s //----------------------------------------------------------------------------- -ConsoleFunction( echo, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( echo, void, 2, 0, "( string message... ) " "@brief Logs a message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console. " "A newline is added automatically after the text.\n\n" @@ -1902,7 +1902,7 @@ ConsoleFunction( echo, void, 2, 0, "( string message... ) " //----------------------------------------------------------------------------- -ConsoleFunction( warn, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( warn, void, 2, 0, "( string message... ) " "@brief Logs a warning message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console as a warning " "message (in the in-game console, these will show up using a turquoise font by default). " @@ -1926,7 +1926,7 @@ ConsoleFunction( warn, void, 2, 0, "( string message... ) " //----------------------------------------------------------------------------- -ConsoleFunction( error, void, 2, 0, "( string message... ) " +DefineEngineStringlyVariadicFunction( error, void, 2, 0, "( string message... ) " "@brief Logs an error message to the console.\n\n" "Concatenates all given arguments to a single string and prints the string to the console as an error " "message (in the in-game console, these will show up using a red font by default). " @@ -2236,7 +2236,7 @@ DefineEngineFunction( generateUUID, Torque::UUID, (),, //----------------------------------------------------------------------------- -ConsoleFunction( call, const char *, 2, 0, "( string functionName, string args... ) " +DefineEngineStringlyVariadicFunction( call, const char *, 2, 0, "( string functionName, string args... ) " "Apply the given arguments to the specified global function and return the result of the call.\n\n" "@param functionName The name of the function to call. This function must be in the global namespace, i.e. " "you cannot call a function in a namespace through #call. Use eval() for that.\n" diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 6d0484171..ab1717745 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -855,6 +855,64 @@ public: ); \ static inline returnType _fn ## className ## name ## impl args +# define DefineEngineStringlyVariadicFunction(name,returnType,minArgs,maxArgs,usage) \ + static inline returnType _fn ## name ## impl (SimObject *, S32 argc, ConsoleValueRef *argv); \ + TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## name \ + (S32 argc, const char** argv) \ + { \ + _CHECK_ENGINE_INITIALIZED( name, returnType ); \ + StringStackConsoleWrapper args(argc, argv); \ + return EngineTypeTraits< returnType >::ReturnValue( \ + _fn ## name ## impl(NULL, args.count(), args) \ + ); \ + } \ + static _EngineFunctionDefaultArguments< void (S32 argc, const char** argv) > _fn ## name ## DefaultArgs; \ + static EngineFunctionInfo _fn ## name ## FunctionInfo( \ + #name, \ + &_SCOPE<>()(), \ + usage, \ + #returnType " " #name "(S32 argc, const char** argv)", \ + "fn" #name, \ + TYPE< returnType (S32 argc, const char** argv) >(), \ + &_fn ## name ## DefaultArgs, \ + ( void* ) &fn ## name, \ + 0 \ + ); \ + ConsoleConstructor cc_##name##_obj(NULL,#name,_fn ## name ## impl,usage,minArgs,maxArgs); \ + returnType _fn ## name ## impl(SimObject *, S32 argc, ConsoleValueRef *argv) + +# define DefineEngineStringlyVariadicMethod(className, name,returnType,minArgs,maxArgs,usage) \ + static inline returnType _fn ## className ## _ ## name ## impl (className* object, S32 argc, ConsoleValueRef* argv); \ + TORQUE_API EngineTypeTraits< returnType >::ReturnValueType fn ## className ## _ ## name \ + (className* object, S32 argc, const char** argv) \ + { \ + _CHECK_ENGINE_INITIALIZED( name, returnType ); \ + StringStackConsoleWrapper args(argc, argv); \ + return EngineTypeTraits< returnType >::ReturnValue( \ + _fn ## className ## _ ## name ## impl(object, args.count(), args) \ + ); \ + } \ + static _EngineFunctionDefaultArguments< void (className* object, S32 argc, const char** argv) > _fn ## className ## _ ## name ## DefaultArgs; \ + static EngineFunctionInfo _fn ## className ## _ ## name ## FunctionInfo( \ + #name, \ + &_SCOPE<>()(), \ + usage, \ + #returnType " " #name "(SimObject* object, S32 argc, const char** argv)", \ + "fn" #className "_" #name, \ + TYPE< returnType (SimObject* object, S32 argc, const char** argv) >(), \ + &_fn ## className ## _ ## name ## DefaultArgs, \ + ( void* ) &fn ## className ## _ ## name, \ + 0 \ + ); \ + returnType cm_##className##_##name##_caster(SimObject* object, S32 argc, ConsoleValueRef* argv) { \ + AssertFatal( dynamic_cast( object ), "Object passed to " #name " is not a " #className "!" ); \ + conmethod_return_##returnType ) _fn ## className ## _ ## name ## impl(static_cast(object),argc,argv); \ + }; \ + ConsoleConstructor cc_##className##_##name##_obj(#className,#name,cm_##className##_##name##_caster,usage,minArgs,maxArgs); \ + static inline returnType _fn ## className ## _ ## name ## impl(className *object, S32 argc, ConsoleValueRef *argv) + + + // The following three macros are only temporary. They allow to define engineAPI functions using the framework // here in this file while being visible only in the new API. When the console interop is removed, these macros // can be removed and all their uses be replaced with their corresponding versions that now still include support diff --git a/Engine/source/console/sim.cpp b/Engine/source/console/sim.cpp index 6bb194db3..1fbcdd748 100644 --- a/Engine/source/console/sim.cpp +++ b/Engine/source/console/sim.cpp @@ -181,7 +181,7 @@ DefineEngineFunction( getTimeSinceStart, S32, (S32 scheduleId), ,"getTimeSinceSt return ret; } -ConsoleFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, )") +DefineEngineStringlyVariadicFunction(schedule, S32, 4, 0, "schedule(time, refobject|0, command, )") { U32 timeDelta = U32(dAtof(argv[1])); SimObject *refObject = Sim::findObject(argv[2]); diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 62ac25fd1..02d7eec40 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2945,7 +2945,7 @@ DefineEngineMethod( SimObject, setFieldType, void, ( const char* fieldName, cons //----------------------------------------------------------------------------- -ConsoleMethod( SimObject, call, const char*, 3, 0, "( string method, string args... ) Dynamically call a method on an object.\n" +DefineEngineStringlyVariadicMethod( SimObject, call, const char*, 3, 0, "( string method, string args... ) Dynamically call a method on an object.\n" "@param method Name of method to call.\n" "@param args Zero or more arguments for the method.\n" "@return The result of the method call." ) @@ -3047,7 +3047,7 @@ DefineEngineMethod( SimObject, delete, void, (),, //----------------------------------------------------------------------------- -ConsoleMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, string args... ) Delay an invocation of a method.\n" +DefineEngineStringlyVariadicMethod( SimObject,schedule, S32, 4, 0, "( float time, string method, string args... ) Delay an invocation of a method.\n" "@param time The number of milliseconds after which to invoke the method. This is a soft limit.\n" "@param method The method to call.\n" "@param args The arguments with which to call the method.\n" diff --git a/Engine/source/console/simSet.cpp b/Engine/source/console/simSet.cpp index 545c411b7..e04416d30 100644 --- a/Engine/source/console/simSet.cpp +++ b/Engine/source/console/simSet.cpp @@ -895,15 +895,7 @@ DefineEngineMethod( SimSet, listObjects, void, (),, //----------------------------------------------------------------------------- -DEFINE_CALLIN( fnSimSet_add, add, SimSet, void, ( SimSet* set, SimObject* object ),,, - "Add the given object to the set.\n" - "@param object An object." ) -{ - if( object ) - set->addObject( object ); -} - -ConsoleMethod( SimSet, add, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, add, void, 3, 0, "( SimObject objects... ) Add the given objects to the set.\n" "@param objects The objects to add to the set." ) { @@ -919,15 +911,7 @@ ConsoleMethod( SimSet, add, void, 3, 0, //----------------------------------------------------------------------------- -DEFINE_CALLIN( fnSimSet_remove, remove, SimSet, void, ( SimSet* set, SimObject* object ),,, - "Remove the given object from the set.\n" - "@param object An object." ) -{ - if( object ) - set->removeObject( object ); -} - -ConsoleMethod( SimSet, remove, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, remove, void, 3, 0, "( SimObject objects... ) Remove the given objects from the set.\n" "@param objects The objects to remove from the set." ) { @@ -970,7 +954,7 @@ DefineEngineMethod( SimSet, getRandom, SimObject*, (),, //----------------------------------------------------------------------------- -ConsoleMethod( SimSet, callOnChildren, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, callOnChildren, void, 3, 0, "( string method, string args... ) Call a method on all objects contained in the set.\n\n" "@param method The name of the method to call.\n" "@param args The arguments to the method.\n\n" @@ -982,7 +966,7 @@ ConsoleMethod( SimSet, callOnChildren, void, 3, 0, //----------------------------------------------------------------------------- -ConsoleMethod( SimSet, callOnChildrenNoRecurse, void, 3, 0, +DefineEngineStringlyVariadicMethod( SimSet, callOnChildrenNoRecurse, void, 3, 0, "( string method, string args... ) Call a method on all objects contained in the set.\n\n" "@param method The name of the method to call.\n" "@param args The arguments to the method.\n\n" diff --git a/Engine/source/gui/editor/guiFilterCtrl.cpp b/Engine/source/gui/editor/guiFilterCtrl.cpp index c0d9c2a72..7870abe24 100644 --- a/Engine/source/gui/editor/guiFilterCtrl.cpp +++ b/Engine/source/gui/editor/guiFilterCtrl.cpp @@ -77,7 +77,7 @@ DefineEngineMethod( GuiFilterCtrl, getValue, const char*, (), , "Return a tuple return buffer; } -ConsoleMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" +DefineEngineStringlyVariadicMethod( GuiFilterCtrl, setValue, void, 3, 20, "(f1, f2, ...)" "Reset the filter to use the specified points, spread equidistantly across the domain." "@internal") { diff --git a/Engine/source/gui/editor/guiGraphCtrl.cpp b/Engine/source/gui/editor/guiGraphCtrl.cpp index 8b1c14108..343f56e24 100644 --- a/Engine/source/gui/editor/guiGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiGraphCtrl.cpp @@ -407,7 +407,7 @@ DefineEngineMethod( GuiGraphCtrl, setGraphType, void, ( S32 plotId, GuiGraphType //----------------------------------------------------------------------------- -ConsoleMethod( GuiGraphCtrl, matchScale, void, 3, GuiGraphCtrl::MaxPlots + 2, "( int plotID1, int plotID2, ... ) " +DefineEngineStringlyVariadicMethod( GuiGraphCtrl, matchScale, void, 3, GuiGraphCtrl::MaxPlots + 2, "( int plotID1, int plotID2, ... ) " "Set the scale of all specified plots to the maximum scale among them.\n\n" "@param plotID1 Index of plotting curve.\n" "@param plotID2 Index of plotting curve." ) diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index 24e710091..1f95b6376 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -3225,7 +3225,7 @@ void WorldEditor::setEditorTool(EditorTool* newTool) //------------------------------------------------------------------------------ -ConsoleMethod( WorldEditor, ignoreObjClass, void, 3, 0, "(string class_name, ...)") +DefineEngineStringlyVariadicMethod( WorldEditor, ignoreObjClass, void, 3, 0, "(string class_name, ...)") { object->ignoreObjClass(argc, argv); } diff --git a/Engine/source/platformWin32/winMath.cpp b/Engine/source/platformWin32/winMath.cpp index 50e5fdbc6..3b6e3ec15 100644 --- a/Engine/source/platformWin32/winMath.cpp +++ b/Engine/source/platformWin32/winMath.cpp @@ -33,7 +33,7 @@ extern void mInstall_AMD_Math(); extern void mInstall_Library_SSE(); //-------------------------------------- -ConsoleFunction( mathInit, void, 1, 10, "( ... )" +DefineEngineStringlyVariadicFunction( mathInit, void, 1, 10, "( ... )" "@brief Install the math library with specified extensions.\n\n" "Possible parameters are:\n\n" " - 'DETECT' Autodetect math lib settings.\n\n" diff --git a/Engine/source/sim/actionMap.cpp b/Engine/source/sim/actionMap.cpp index ca2932e84..a69ec4bea 100644 --- a/Engine/source/sim/actionMap.cpp +++ b/Engine/source/sim/actionMap.cpp @@ -2077,7 +2077,7 @@ static ConsoleDocFragment _ActionMapbind2( "ActionMap", "bool bind( string device, string action, string flag, string deadZone, string scale, string command );"); -ConsoleMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier, spec, mod...], command )" +DefineEngineStringlyVariadicMethod( ActionMap, bind, bool, 5, 10, "actionMap.bind( device, action, [modifier, spec, mod...], command )" "@hide") { StringStackWrapper args(argc - 2, argv + 2); @@ -2126,7 +2126,7 @@ static ConsoleDocFragment _ActionMapbindObj2( "ActionMap", "bool bindObj( string device, string action, string flag, string deadZone, string scale, string command, SimObjectID object );"); -ConsoleMethod( ActionMap, bindObj, bool, 6, 11, "(device, action, [modifier, spec, mod...], command, object)" +DefineEngineStringlyVariadicMethod( ActionMap, bindObj, bool, 6, 11, "(device, action, [modifier, spec, mod...], command, object)" "@hide") { SimObject* simObject = Sim::findObject(argv[argc - 1]);