mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro.
This commit is contained in:
parent
378a933894
commit
acb192e2a5
133 changed files with 1716 additions and 2087 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include "console/consoleTypes.h"
|
||||
#include "component/simComponent.h"
|
||||
#include "core/stream/stream.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
SimComponent::SimComponent() : mOwner( NULL )
|
||||
{
|
||||
|
|
@ -404,17 +405,16 @@ ConsoleMethod( SimComponent, removeComponents, bool, 3, 64, "%obj.removeComponen
|
|||
return true;
|
||||
}
|
||||
|
||||
ConsoleMethod( SimComponent, getComponentCount, S32, 2, 2, "() Get the current component count\n"
|
||||
DefineConsoleMethod( SimComponent, getComponentCount, S32, (), , "() Get the current component count\n"
|
||||
"@return The number of components in the list as an integer")
|
||||
{
|
||||
return object->getComponentCount();
|
||||
}
|
||||
|
||||
ConsoleMethod( SimComponent, getComponent, S32, 3, 3, "(idx) Get the component corresponding to the given index.\n"
|
||||
DefineConsoleMethod( SimComponent, getComponent, S32, (S32 idx), , "(idx) Get the component corresponding to the given index.\n"
|
||||
"@param idx An integer index value corresponding to the desired component.\n"
|
||||
"@return The id of the component at the given index as an integer")
|
||||
{
|
||||
S32 idx = dAtoi(argv[2]);
|
||||
if(idx < 0 || idx >= object->getComponentCount())
|
||||
{
|
||||
Con::errorf("SimComponent::getComponent - Invalid index %d", idx);
|
||||
|
|
@ -425,27 +425,27 @@ ConsoleMethod( SimComponent, getComponent, S32, 3, 3, "(idx) Get the component c
|
|||
return c ? c->getId() : 0;
|
||||
}
|
||||
|
||||
ConsoleMethod(SimComponent, setEnabled, void, 3, 3, "(enabled) Sets or unsets the enabled flag\n"
|
||||
DefineConsoleMethod(SimComponent, setEnabled, void, (bool enabled), , "(enabled) Sets or unsets the enabled flag\n"
|
||||
"@param enabled Boolean value\n"
|
||||
"@return No return value")
|
||||
{
|
||||
object->setEnabled(dAtob(argv[2]));
|
||||
object->setEnabled(enabled);
|
||||
}
|
||||
|
||||
ConsoleMethod(SimComponent, isEnabled, bool, 2, 2, "() Check whether SimComponent is currently enabled\n"
|
||||
DefineConsoleMethod(SimComponent, isEnabled, bool, (), , "() Check whether SimComponent is currently enabled\n"
|
||||
"@return true if enabled and false if not")
|
||||
{
|
||||
return object->isEnabled();
|
||||
}
|
||||
|
||||
ConsoleMethod(SimComponent, setIsTemplate, void, 3, 3, "(template) Sets or unsets the template flag\n"
|
||||
DefineConsoleMethod(SimComponent, setIsTemplate, void, (bool templateFlag), , "(template) Sets or unsets the template flag\n"
|
||||
"@param template Boolean value\n"
|
||||
"@return No return value")
|
||||
{
|
||||
object->setIsTemplate(dAtob(argv[2]));
|
||||
object->setIsTemplate(templateFlag);
|
||||
}
|
||||
|
||||
ConsoleMethod(SimComponent, getIsTemplate, bool, 2, 2, "() Check whether SimComponent is currently a template\n"
|
||||
DefineConsoleMethod(SimComponent, getIsTemplate, bool, (), , "() Check whether SimComponent is currently a template\n"
|
||||
"@return true if is a template and false if not")
|
||||
{
|
||||
return object->getIsTemplate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue