Undo TorqueLab changes until it works properly

This commit is contained in:
Duion 2015-09-06 23:14:36 +02:00
parent 683a11e384
commit 9b8114d4e1
8 changed files with 12 additions and 54 deletions

View file

@ -66,16 +66,14 @@ GuiSwatchButtonCtrl::GuiSwatchButtonCtrl()
static StringTableEntry sProfile = StringTable->insert( "profile" );
setDataField( sProfile, NULL, "GuiInspectorSwatchButtonProfile" );
mGridBitmap = StringTable->insert("tools/gui/images/transp_grid"); //TorqueLab bad bitmap crash fix
//mGridBitmap = "tools/gui/images/transp_grid";
mGridBitmap = "tools/gui/images/transp_grid";
}
void GuiSwatchButtonCtrl::initPersistFields()
{
addField( "color", TypeColorF, Offset( mSwatchColor, GuiSwatchButtonCtrl ), "The foreground color of GuiSwatchButtonCtrl" );
addField("gridBitmap", TypeFilename, Offset(mGridBitmap, GuiSwatchButtonCtrl), "The bitmap used for the transparent grid");//TorqueLab bad bitmap crash fix
//addField( "gridBitmap", TypeString, Offset( mGridBitmap, GuiSwatchButtonCtrl ), "The bitmap used for the transparent grid" );
addField( "gridBitmap", TypeString, Offset( mGridBitmap, GuiSwatchButtonCtrl ), "The bitmap used for the transparent grid" );
Parent::initPersistFields();
}

View file

@ -42,8 +42,7 @@ class GuiSwatchButtonCtrl : public GuiButtonBaseCtrl
ColorF mSwatchColor;
/// Bitmap used for mGrid
StringTableEntry mGridBitmap; //TorqueLab bad bitmap crash fix
//String mGridBitmap;
String mGridBitmap;
/// Background texture that will show through with transparent colors.
GFXTexHandle mGrid;

View file

@ -1000,15 +1000,12 @@ GuiMenuBar::MenuItem* GuiMenuBar::findSubmenuItem(MenuItem *menuItem, const char
// Add a menuitem to the given submenu
void GuiMenuBar::addSubmenuItem(Menu *menu, MenuItem *submenu, const char *text, U32 id, const char *accelerator, S32 checkGroup)
{
// Check that the given menu item supports a submenu
//TorqueLab isSubmenu check removed and simply validate the submenu object
//if(submenu && !submenu->isSubmenu)
if (!submenu)
{
Con::errorf("GuiMenuBar::addSubmenuItem: Attempting to add menuitem '%s' to an invalid submenu", text);
return;
}
submenu->isSubmenu = true;//TorqueLab => Force isSubmenu to true (hack)
// Check that the given menu item supports a submenu
if(submenu && !submenu->isSubmenu)
{
Con::errorf("GuiMenuBar::addSubmenuItem: Attempting to add menuitem '%s' to an invalid submenu",text);
return;
}
// allocate the new menu item
MenuItem *newMenuItem = new MenuItem;
@ -1032,13 +1029,6 @@ void GuiMenuBar::addSubmenuItem(Menu *menu, MenuItem *submenu, const char *text,
// Point back to the submenu's menu
newMenuItem->submenuParentMenu = menu;
//TorqueLab : Added to make sure there's a menu to add the item
if (!submenu->submenu){
Menu *newMenu = sCreateMenu(submenu->text, submenu->id);
submenu->submenu = newMenu;
}
//TorqueLab end
// link it into the menu's menu item list
MenuItem **walk = &submenu->submenu->firstMenuItem;
while(*walk)

View file

@ -2232,9 +2232,6 @@ void WorldEditor::on3DMouseDragged(const Gui3DMouseEvent & event)
copySelection( mSelected );
pasteSelection( false );
//TorqueLab -> Needed to know a dragCopy happen
Con::executef(this, "onDragCopy", mSelected->getIdString());
}
// Check for grid snap toggle with ALT.