Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro.

This commit is contained in:
Vincent Gee 2014-11-03 22:42:51 -05:00
parent 378a933894
commit acb192e2a5
133 changed files with 1716 additions and 2087 deletions

View file

@ -24,6 +24,7 @@
#include "gui/editor/inspector/dynamicGroup.h"
#include "gui/editor/guiInspector.h"
#include "gui/buttons/guiIconButtonCtrl.h"
#include "console/engineAPI.h"
//-----------------------------------------------------------------------------
// GuiInspectorDynamicField - Child class of GuiInspectorField
@ -315,7 +316,7 @@ void GuiInspectorDynamicField::_executeSelectedCallback()
Con::executef( mInspector, "onFieldSelected", mDynField->slotName, "TypeDynamicField" );
}
ConsoleMethod( GuiInspectorDynamicField, renameField, void, 3,3, "field.renameField(newDynamicFieldName);" )
DefineConsoleMethod( GuiInspectorDynamicField, renameField, void, (const char* newDynamicFieldName),, "field.renameField(newDynamicFieldName);" )
{
object->renameField( argv[ 2 ] );
object->renameField( newDynamicFieldName );
}

View file

@ -24,6 +24,7 @@
#include "gui/editor/guiInspector.h"
#include "gui/editor/inspector/dynamicGroup.h"
#include "gui/editor/inspector/dynamicField.h"
#include "console/engineAPI.h"
IMPLEMENT_CONOBJECT(GuiInspectorDynamicGroup);
@ -176,7 +177,7 @@ void GuiInspectorDynamicGroup::updateAllFields()
inspectGroup();
}
ConsoleMethod(GuiInspectorDynamicGroup, inspectGroup, bool, 2, 2, "Refreshes the dynamic fields in the inspector.")
DefineConsoleMethod(GuiInspectorDynamicGroup, inspectGroup, bool, (), , "Refreshes the dynamic fields in the inspector.")
{
return object->inspectGroup();
}
@ -251,11 +252,11 @@ void GuiInspectorDynamicGroup::addDynamicField()
instantExpand();
}
ConsoleMethod( GuiInspectorDynamicGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();" )
DefineConsoleMethod( GuiInspectorDynamicGroup, addDynamicField, void, (), , "obj.addDynamicField();" )
{
object->addDynamicField();
}
ConsoleMethod( GuiInspectorDynamicGroup, removeDynamicField, void, 3, 3, "" )
DefineConsoleMethod( GuiInspectorDynamicGroup, removeDynamicField, void, (), , "" )
{
}

View file

@ -20,6 +20,7 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "console/engineAPI.h"
#include "platform/platform.h"
#include "gui/editor/inspector/field.h"
#include "gui/buttons/guiIconButtonCtrl.h"
@ -615,53 +616,49 @@ void GuiInspectorField::_setFieldDocs( StringTableEntry docs )
//-----------------------------------------------------------------------------
ConsoleMethod( GuiInspectorField, getInspector, S32, 2, 2, "() - Return the GuiInspector to which this field belongs." )
DefineConsoleMethod( GuiInspectorField, getInspector, S32, (), , "() - Return the GuiInspector to which this field belongs." )
{
return object->getInspector()->getId();
}
//-----------------------------------------------------------------------------
ConsoleMethod( GuiInspectorField, getInspectedFieldName, const char*, 2, 2, "() - Return the name of the field edited by this inspector field." )
DefineConsoleMethod( GuiInspectorField, getInspectedFieldName, const char*, (), , "() - Return the name of the field edited by this inspector field." )
{
return object->getFieldName();
}
//-----------------------------------------------------------------------------
ConsoleMethod( GuiInspectorField, getInspectedFieldType, const char*, 2, 2, "() - Return the type of the field edited by this inspector field." )
DefineConsoleMethod( GuiInspectorField, getInspectedFieldType, const char*, (), , "() - Return the type of the field edited by this inspector field." )
{
return object->getFieldType();
}
//-----------------------------------------------------------------------------
ConsoleMethod( GuiInspectorField, apply, void, 3, 4, "( string newValue, bool callbacks=true ) - Set the field's value. Suppress callbacks for undo if callbacks=false." )
DefineConsoleMethod( GuiInspectorField, apply, void, ( const char * newValue, bool callbacks ), ("", true), "( string newValue, bool callbacks=true ) - Set the field's value. Suppress callbacks for undo if callbacks=false." )
{
bool callbacks = true;
if( argc > 3 )
callbacks = dAtob( argv[ 3 ] );
object->setData( argv[ 2 ], callbacks );
object->setData( newValue, callbacks );
}
//-----------------------------------------------------------------------------
ConsoleMethod( GuiInspectorField, applyWithoutUndo, void, 3, 3, "() - Set field value without recording undo (same as 'apply( value, false )')." )
DefineConsoleMethod( GuiInspectorField, applyWithoutUndo, void, (const char * data), , "() - Set field value without recording undo (same as 'apply( value, false )')." )
{
object->setData( argv[ 2 ], false );
object->setData( data, false );
}
//-----------------------------------------------------------------------------
ConsoleMethod( GuiInspectorField, getData, const char*, 2, 2, "() - Return the value currently displayed on the field." )
DefineConsoleMethod( GuiInspectorField, getData, const char*, (), , "() - Return the value currently displayed on the field." )
{
return object->getData();
}
//-----------------------------------------------------------------------------
ConsoleMethod( GuiInspectorField, reset, void, 2, 2, "() - Reset to default value." )
DefineConsoleMethod( GuiInspectorField, reset, void, (), , "() - Reset to default value." )
{
object->resetData();
}

View file

@ -22,6 +22,7 @@
#include "gui/editor/inspector/variableInspector.h"
#include "gui/editor/inspector/variableGroup.h"
#include "console/engineAPI.h"
GuiVariableInspector::GuiVariableInspector()
{
@ -61,7 +62,7 @@ void GuiVariableInspector::loadVars( String searchStr )
//group->inspectGroup();
}
ConsoleMethod( GuiVariableInspector, loadVars, void, 3, 3, "loadVars( searchString )" )
DefineConsoleMethod( GuiVariableInspector, loadVars, void, ( const char * searchString ), , "loadVars( searchString )" )
{
object->loadVars( argv[2] );
object->loadVars( searchString );
}