mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-27 18:43:48 +00:00
Merge remote-tracking branch 'jamesu/console_stack_fix2' into development
Conflicts: Engine/source/console/console.cpp
This commit is contained in:
commit
6c92ab065e
48 changed files with 2979 additions and 449 deletions
|
|
@ -113,7 +113,7 @@ void GuiConsoleTextCtrl::onPreRender()
|
|||
{
|
||||
if ( mConsoleExpression.isNotEmpty() )
|
||||
{
|
||||
mResult = Con::evaluatef( "$guiConsoleTextCtrlTemp = %s;", mConsoleExpression.c_str() );
|
||||
mResult = (const char*)Con::evaluatef( "$guiConsoleTextCtrlTemp = %s;", mConsoleExpression.c_str() );
|
||||
|
||||
// Of the resulting string we will be printing,
|
||||
// Find the number of lines and length of each.
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onClearSelection, void, (),(),
|
|||
"@see GuiControl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( const char* index, const char* itemText),( index, itemText ),
|
||||
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( S32 index, const char* itemText),( index, itemText ),
|
||||
"@brief Called whenever a selected item in the list has been unselected.\n\n"
|
||||
"@param index Index id of the item that was unselected\n"
|
||||
"@param itemText Text for the list entry at the index id that was unselected\n\n"
|
||||
|
|
@ -85,7 +85,7 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( const char* index, const
|
|||
"@see GuiControl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onSelect, void, ( const char* index , const char* itemText ),( index, itemText ),
|
||||
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onSelect, void, ( S32 index , const char* itemText ),( index, itemText ),
|
||||
"@brief Called whenever an item in the list is selected.\n\n"
|
||||
"@param index Index id for the item in the list that was selected.\n"
|
||||
"@param itemText Text for the list item at the index that was selected.\n\n"
|
||||
|
|
@ -111,7 +111,7 @@ IMPLEMENT_CALLBACK( GuiListBoxCtrl, onDoubleClick, void, (),(),
|
|||
"@see GuiControl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseUp, void, (const char* itemHit, const char* mouseClickCount),( itemHit,mouseClickCount),
|
||||
IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseUp, void, ( S32 itemHit, S32 mouseClickCount ),( itemHit,mouseClickCount ),
|
||||
"@brief Called whenever the mouse has previously been clicked down (onMouseDown) and has now been raised on the control.\n"
|
||||
"If an item in the list was hit during the click cycle, then the index id of the clicked object along with how many clicks occured are passed\n"
|
||||
"into the callback.\n\n"
|
||||
|
|
@ -309,7 +309,7 @@ void GuiListBoxCtrl::removeSelection( LBItem *item, S32 index )
|
|||
{
|
||||
mSelectedItems.erase( &mSelectedItems[i] );
|
||||
item->isSelected = false;
|
||||
onUnSelect_callback(Con::getIntArg(index), item->itemText);
|
||||
onUnSelect_callback(index, item->itemText);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -355,7 +355,7 @@ void GuiListBoxCtrl::addSelection( LBItem *item, S32 index )
|
|||
item->isSelected = true;
|
||||
mSelectedItems.push_front( item );
|
||||
|
||||
onSelect_callback(Con::getIntArg( index ), item->itemText);
|
||||
onSelect_callback(index, item->itemText);
|
||||
}
|
||||
|
||||
S32 GuiListBoxCtrl::getItemIndex( LBItem *item )
|
||||
|
|
@ -1224,7 +1224,7 @@ void GuiListBoxCtrl::onMouseUp( const GuiEvent& event )
|
|||
{
|
||||
S32 itemHit = -1;
|
||||
if( hitTest( event.mousePoint, itemHit ) )
|
||||
onMouseUp_callback(Con::getIntArg( itemHit ), Con::getIntArg( event.mouseClickCount ) );
|
||||
onMouseUp_callback( itemHit, event.mouseClickCount );
|
||||
|
||||
// Execute console command
|
||||
execConsoleCallback();
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ public:
|
|||
|
||||
DECLARE_CALLBACK( void, onMouseDragged, ());
|
||||
DECLARE_CALLBACK( void, onClearSelection, ());
|
||||
DECLARE_CALLBACK( void, onUnSelect, ( const char* index, const char* itemText));
|
||||
DECLARE_CALLBACK( void, onSelect, ( const char* index , const char* itemText ));
|
||||
DECLARE_CALLBACK( void, onUnSelect, ( S32 index, const char* itemText));
|
||||
DECLARE_CALLBACK( void, onSelect, ( S32 index , const char* itemText ));
|
||||
DECLARE_CALLBACK( void, onDoubleClick, ());
|
||||
DECLARE_CALLBACK( void, onMouseUp, (const char* itemHit, const char* mouseClickCount));
|
||||
DECLARE_CALLBACK( void, onMouseUp, ( S32 itemHit, S32 mouseClickCount ));
|
||||
DECLARE_CALLBACK( void, onDeleteKey, ());
|
||||
DECLARE_CALLBACK( bool, isObjectMirrored, ( const char* indexIdString ));
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ IMPLEMENT_CALLBACK( GuiMLTextCtrl, onURL, void, ( const char* url ),( url ),
|
|||
"@see GuiControl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiMLTextCtrl, onResize, void, ( const char* width, const char* maxY ),( width, maxY ),
|
||||
IMPLEMENT_CALLBACK( GuiMLTextCtrl, onResize, void, ( S32 width, S32 maxY ),( width, maxY ),
|
||||
"@brief Called whenever the control size changes.\n\n"
|
||||
"@param width The new width value for the control\n"
|
||||
"@param maxY The current maximum allowed Y value for the control\n\n"
|
||||
|
|
@ -2133,7 +2133,7 @@ textemit:
|
|||
processEmitAtoms();
|
||||
emitNewLine(mScanPos);
|
||||
setHeight( mMaxY );
|
||||
onResize_callback(Con::getIntArg( getWidth() ), Con::getIntArg( mMaxY ) );
|
||||
onResize_callback( getWidth(), mMaxY );
|
||||
|
||||
//make sure the cursor is still visible - this handles if we're a child of a scroll ctrl...
|
||||
ensureCursorOnScreen();
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class GuiMLTextCtrl : public GuiControl
|
|||
~GuiMLTextCtrl();
|
||||
|
||||
DECLARE_CALLBACK( void, onURL, (const char* url));
|
||||
DECLARE_CALLBACK( void, onResize, ( const char* width, const char* maxY ));
|
||||
DECLARE_CALLBACK( void, onResize, ( S32 width, S32 maxY ));
|
||||
|
||||
// Text retrieval functions
|
||||
U32 getNumChars() const;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ ConsoleDocClass( GuiTextListCtrl,
|
|||
);
|
||||
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiTextListCtrl, onSelect, void, (const char* cellid, const char* text),( cellid , text ),
|
||||
IMPLEMENT_CALLBACK( GuiTextListCtrl, onSelect, void, (S32 cellid, const char* text),( cellid , text ),
|
||||
"@brief Called whenever an item in the list is selected.\n\n"
|
||||
"@param cellid The ID of the cell that was selected\n"
|
||||
"@param text The text in the selected cel\n\n"
|
||||
|
|
@ -66,7 +66,7 @@ IMPLEMENT_CALLBACK( GuiTextListCtrl, onSelect, void, (const char* cellid, const
|
|||
"@see GuiControl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiTextListCtrl, onDeleteKey, void, ( const char* id ),( id ),
|
||||
IMPLEMENT_CALLBACK( GuiTextListCtrl, onDeleteKey, void, ( S32 id ),( id ),
|
||||
"@brief Called when the delete key has been pressed.\n\n"
|
||||
"@param id Id of the selected item in the list\n"
|
||||
"@tsexample\n"
|
||||
|
|
@ -172,7 +172,7 @@ bool GuiTextListCtrl::cellSelected(Point2I cell)
|
|||
|
||||
void GuiTextListCtrl::onCellSelected(Point2I cell)
|
||||
{
|
||||
onSelect_callback(Con::getIntArg(mList[cell.y].id), mList[cell.y].text);
|
||||
onSelect_callback(mList[cell.y].id, mList[cell.y].text);
|
||||
execConsoleCallback();
|
||||
}
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ bool GuiTextListCtrl::onKeyDown( const GuiEvent &event )
|
|||
break;
|
||||
case KEY_DELETE:
|
||||
if ( mSelectedCell.y >= 0 && mSelectedCell.y < mList.size() )
|
||||
onDeleteKey_callback(Con::getIntArg( mList[mSelectedCell.y].id ) );
|
||||
onDeleteKey_callback( mList[mSelectedCell.y].id );
|
||||
break;
|
||||
default:
|
||||
return( Parent::onKeyDown( event ) );
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ class GuiTextListCtrl : public GuiArrayCtrl
|
|||
DECLARE_CATEGORY( "Gui Lists" );
|
||||
DECLARE_DESCRIPTION( "A control that displays text in tabular form." );
|
||||
|
||||
DECLARE_CALLBACK( void, onSelect, (const char* cellid, const char* text));
|
||||
DECLARE_CALLBACK( void, onDeleteKey, ( const char* id ));
|
||||
DECLARE_CALLBACK( void, onSelect, (S32 cellid, const char* text));
|
||||
DECLARE_CALLBACK( void, onDeleteKey, ( S32 id ));
|
||||
|
||||
static void initPersistFields();
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onMouseInMenu, void, (bool isInMenu),( isInMenu
|
|||
"@see GuiTickCtrl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiMenuBar, onMenuSelect, void, ( const char* menuId, const char* menuText ),( menuId , menuText ),
|
||||
IMPLEMENT_CALLBACK( GuiMenuBar, onMenuSelect, void, ( S32 menuId, const char* menuText ),( menuId , menuText ),
|
||||
"@brief Called whenever a menu is selected.\n\n"
|
||||
"@param menuId Index id of the clicked menu\n"
|
||||
"@param menuText Text of the clicked menu\n\n"
|
||||
|
|
@ -125,7 +125,7 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onMenuSelect, void, ( const char* menuId, const
|
|||
"@see GuiTickCtrl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiMenuBar, onMenuItemSelect, void, ( const char* menuId, const char* menuText, const char* menuItemId, const char* menuItemText ),
|
||||
IMPLEMENT_CALLBACK( GuiMenuBar, onMenuItemSelect, void, ( S32 menuId, const char* menuText, S32 menuItemId, const char* menuItemText ),
|
||||
( menuId, menuText, menuItemId, menuItemText ),
|
||||
"@brief Called whenever an item in a menu is selected.\n\n"
|
||||
"@param menuId Index id of the menu which contains the selected menu item\n"
|
||||
|
|
@ -142,7 +142,7 @@ IMPLEMENT_CALLBACK( GuiMenuBar, onMenuItemSelect, void, ( const char* menuId, co
|
|||
"@see GuiTickCtrl\n\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( GuiMenuBar, onSubmenuSelect, void, ( const char* submenuId, const char* submenuText ),( submenuId, submenuText ),
|
||||
IMPLEMENT_CALLBACK( GuiMenuBar, onSubmenuSelect, void, ( S32 submenuId, const char* submenuText ),( submenuId, submenuText ),
|
||||
"@brief Called whenever a submenu is selected.\n\n"
|
||||
"@param submenuId Id of the selected submenu\n"
|
||||
"@param submenuText Text of the selected submenu\n\n"
|
||||
|
|
@ -1393,7 +1393,7 @@ void GuiMenuBar::acceleratorKeyPress(U32 index)
|
|||
if(item->acceleratorIndex == index)
|
||||
{
|
||||
// first, call the script callback for menu selection:
|
||||
onMenuSelect_callback(Con::getIntArg(menu->id), menu->text);
|
||||
onMenuSelect_callback(menu->id, menu->text);
|
||||
|
||||
if(item->visible)
|
||||
menuItemSelected(menu, item);
|
||||
|
|
@ -1575,7 +1575,7 @@ bool GuiSubmenuBackgroundCtrl::pointInControl(const Point2I& parentCoordPoint)
|
|||
void GuiMenuBar::menuItemSelected(GuiMenuBar::Menu *menu, GuiMenuBar::MenuItem *item)
|
||||
{
|
||||
if(item->enabled)
|
||||
onMenuItemSelect_callback(Con::getIntArg(menu->id), menu->text, Con::getIntArg(item->id), item->text);
|
||||
onMenuItemSelect_callback(menu->id, menu->text, item->id, item->text);
|
||||
}
|
||||
|
||||
void GuiMenuBar::onSleep()
|
||||
|
|
@ -1668,7 +1668,7 @@ void GuiMenuBar::onAction()
|
|||
return;
|
||||
|
||||
// first, call the script callback for menu selection:
|
||||
onMenuSelect_callback(Con::getIntArg(mouseDownMenu->id), mouseDownMenu->text);
|
||||
onMenuSelect_callback(mouseDownMenu->id, mouseDownMenu->text);
|
||||
|
||||
MenuItem *visWalk = mouseDownMenu->firstMenuItem;
|
||||
while(visWalk)
|
||||
|
|
@ -1783,7 +1783,7 @@ void GuiMenuBar::onSubmenuAction(S32 selectionIndex, RectI bounds, Point2I cellS
|
|||
return;
|
||||
|
||||
// first, call the script callback for menu selection:
|
||||
onSubmenuSelect_callback(Con::getIntArg(mouseOverSubmenu->id), mouseOverSubmenu->text);
|
||||
onSubmenuSelect_callback(mouseOverSubmenu->id, mouseOverSubmenu->text);
|
||||
|
||||
MenuItem *visWalk = mouseOverSubmenu->submenu->firstMenuItem;
|
||||
while(visWalk)
|
||||
|
|
|
|||
|
|
@ -220,10 +220,10 @@ public:
|
|||
static void initPersistFields();
|
||||
|
||||
DECLARE_CONOBJECT(GuiMenuBar);
|
||||
DECLARE_CALLBACK( void, onMouseInMenu, (bool hasLeftMenu));
|
||||
DECLARE_CALLBACK( void, onMenuSelect, (const char* menuId, const char* menuText));
|
||||
DECLARE_CALLBACK( void, onMenuItemSelect, ( const char* menuId, const char* menuText, const char* menuItemId, const char* menuItemText ));
|
||||
DECLARE_CALLBACK( void, onSubmenuSelect, ( const char* submenuId, const char* submenuText));
|
||||
DECLARE_CALLBACK( void, onMouseInMenu, ( bool hasLeftMenu ));
|
||||
DECLARE_CALLBACK( void, onMenuSelect, ( S32 menuId, const char* menuText ));
|
||||
DECLARE_CALLBACK( void, onMenuItemSelect, ( S32 menuId, const char* menuText, S32 menuItemId, const char* menuItemText ));
|
||||
DECLARE_CALLBACK( void, onSubmenuSelect, ( S32 submenuId, const char* submenuText ));
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "console/simBase.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "gui/editor/inspector/customField.h"
|
||||
#include "gui/editor/guiInspector.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ void GuiInspectorField::setData( const char* data, bool callbacks )
|
|||
{
|
||||
char buffer[ 2048 ];
|
||||
expandEscape( buffer, newValue );
|
||||
newValue = Con::evaluatef( "%%f = \"%s\"; return ( %s );", oldValue.c_str(), buffer );
|
||||
newValue = (const char*)Con::evaluatef( "%%f = \"%s\"; return ( %s );", oldValue.c_str(), buffer );
|
||||
}
|
||||
else if( type == TypeS32Vector
|
||||
|| type == TypeF32Vector
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue