mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
gui shadowvar cleanups
This commit is contained in:
parent
2009bf1ee3
commit
342bf8f3d3
9 changed files with 40 additions and 46 deletions
|
|
@ -142,7 +142,6 @@ void GuiDecoyCtrl::onMouseMove(const GuiEvent &event)
|
||||||
if(mIsDecoy == true)
|
if(mIsDecoy == true)
|
||||||
{
|
{
|
||||||
mVisible = false;
|
mVisible = false;
|
||||||
GuiControl *parent = getParent();
|
|
||||||
GuiControl *tempControl = parent->findHitControl(localPoint);
|
GuiControl *tempControl = parent->findHitControl(localPoint);
|
||||||
|
|
||||||
//the decoy control has the responsibility of keeping track of the decoyed controls status
|
//the decoy control has the responsibility of keeping track of the decoyed controls status
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ DefineEngineMethod( GuiDirectoryFileListCtrl, getSelectedFiles, const char*, (),
|
||||||
// Fetch the remaining entries
|
// Fetch the remaining entries
|
||||||
for( S32 i = 1; i < ItemVector.size(); i++ )
|
for( S32 i = 1; i < ItemVector.size(); i++ )
|
||||||
{
|
{
|
||||||
StringTableEntry itemText = object->getItemText( ItemVector[i] );
|
itemText = object->getItemText( ItemVector[i] );
|
||||||
if( !itemText )
|
if( !itemText )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3004,10 +3004,10 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
|
||||||
{
|
{
|
||||||
if( !mActive || !mAwake || !mVisible )
|
if( !mActive || !mAwake || !mVisible )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
BitSet32 hitFlags = 0;
|
||||||
if( isMethod("onMouseUp") )
|
if( isMethod("onMouseUp") )
|
||||||
{
|
{
|
||||||
BitSet32 hitFlags = 0;
|
|
||||||
Item* item;
|
Item* item;
|
||||||
|
|
||||||
S32 hitItemId = -1;
|
S32 hitItemId = -1;
|
||||||
|
|
@ -3025,7 +3025,7 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitSet32 hitFlags = 0;
|
hitFlags = 0;
|
||||||
Item *item;
|
Item *item;
|
||||||
bool hitCheck = _hitTest( event.mousePoint, item, hitFlags );
|
bool hitCheck = _hitTest( event.mousePoint, item, hitFlags );
|
||||||
mRenamingItem = NULL;
|
mRenamingItem = NULL;
|
||||||
|
|
@ -3061,7 +3061,7 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
|
||||||
{
|
{
|
||||||
Parent::onMouseMove( event );
|
Parent::onMouseMove( event );
|
||||||
|
|
||||||
BitSet32 hitFlags = 0;
|
hitFlags = 0;
|
||||||
if( !_hitTest( event.mousePoint, newItem2, hitFlags ) )
|
if( !_hitTest( event.mousePoint, newItem2, hitFlags ) )
|
||||||
{
|
{
|
||||||
if( !mShowRoot )
|
if( !mShowRoot )
|
||||||
|
|
@ -3794,16 +3794,12 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
|
||||||
if (item->isInspectorData())
|
if (item->isInspectorData())
|
||||||
{
|
{
|
||||||
Entity* e = dynamic_cast<Entity*>(item->getObject());
|
Entity* e = dynamic_cast<Entity*>(item->getObject());
|
||||||
//if (item->mScriptInfo.mText != StringTable->insert("Components"))
|
if (e)
|
||||||
{
|
{
|
||||||
Entity* e = dynamic_cast<Entity*>(item->getObject());
|
if (item->isExpanded())
|
||||||
if (e)
|
e->onInspect();
|
||||||
{
|
else
|
||||||
if (item->isExpanded())
|
e->onEndInspect();
|
||||||
e->onInspect();
|
|
||||||
else
|
|
||||||
e->onEndInspect();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1530,9 +1530,9 @@ void GuiCanvas::popDialogControl(GuiControl *gui)
|
||||||
|
|
||||||
if (size() > 0)
|
if (size() > 0)
|
||||||
{
|
{
|
||||||
GuiControl *ctrl = static_cast<GuiControl *>(last());
|
GuiControl *lastCtrl = static_cast<GuiControl *>(last());
|
||||||
if( ctrl->getFirstResponder() )
|
if(lastCtrl->getFirstResponder() )
|
||||||
ctrl->getFirstResponder()->setFirstResponder();
|
lastCtrl->getFirstResponder()->setFirstResponder();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1547,8 +1547,8 @@ void GuiCanvas::popDialogControl(GuiControl *gui)
|
||||||
|
|
||||||
if (size() > 0)
|
if (size() > 0)
|
||||||
{
|
{
|
||||||
GuiControl *ctrl = static_cast<GuiControl*>(last());
|
GuiControl *lastCtrl = static_cast<GuiControl*>(last());
|
||||||
ctrl->buildAcceleratorMap();
|
lastCtrl->buildAcceleratorMap();
|
||||||
}
|
}
|
||||||
refreshMouseControl();
|
refreshMouseControl();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -542,10 +542,10 @@ void GuiEditCtrl::onMouseDragged( const GuiEvent &event )
|
||||||
// Snap the mouse cursor to grid if active. Do this on the mouse cursor so that we handle
|
// Snap the mouse cursor to grid if active. Do this on the mouse cursor so that we handle
|
||||||
// incremental drags correctly.
|
// incremental drags correctly.
|
||||||
|
|
||||||
Point2I mousePoint = event.mousePoint;
|
Point2I dragPoint = event.mousePoint;
|
||||||
snapToGrid( mousePoint );
|
snapToGrid(dragPoint);
|
||||||
|
|
||||||
Point2I delta = mousePoint - mLastDragPos;
|
Point2I delta = dragPoint - mLastDragPos;
|
||||||
|
|
||||||
// If CTRL is down, apply smart snapping.
|
// If CTRL is down, apply smart snapping.
|
||||||
|
|
||||||
|
|
@ -584,7 +584,7 @@ void GuiEditCtrl::onMouseDragged( const GuiEvent &event )
|
||||||
|
|
||||||
// Remember drag point.
|
// Remember drag point.
|
||||||
|
|
||||||
mLastDragPos = mousePoint;
|
mLastDragPos = dragPoint;
|
||||||
}
|
}
|
||||||
else if (mMouseDownMode == MovingSelection && mSelectedControls.size())
|
else if (mMouseDownMode == MovingSelection && mSelectedControls.size())
|
||||||
{
|
{
|
||||||
|
|
@ -770,7 +770,7 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
( mMouseDownMode == MovingSelection || mMouseDownMode == SizingSelection ) &&
|
( mMouseDownMode == MovingSelection || mMouseDownMode == SizingSelection ) &&
|
||||||
( mGridSnap.x || mGridSnap.y ) )
|
( mGridSnap.x || mGridSnap.y ) )
|
||||||
{
|
{
|
||||||
Point2I cext = getContentControl()->getExtent();
|
cext = getContentControl()->getExtent();
|
||||||
Point2I coff = getContentControl()->localToGlobalCoord(Point2I(0,0));
|
Point2I coff = getContentControl()->localToGlobalCoord(Point2I(0,0));
|
||||||
|
|
||||||
// create point-dots
|
// create point-dots
|
||||||
|
|
@ -847,8 +847,8 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
|
|
||||||
if( mSnapTargets[ axis ] )
|
if( mSnapTargets[ axis ] )
|
||||||
{
|
{
|
||||||
RectI bounds = mSnapTargets[ axis ]->getGlobalBounds();
|
RectI snapBounds = mSnapTargets[ axis ]->getGlobalBounds();
|
||||||
drawer->drawRect( bounds, ColorI( 128, 128, 128, 128 ) );
|
drawer->drawRect(snapBounds, ColorI( 128, 128, 128, 128 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,9 +177,9 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
Point2I pos = offset;
|
Point2I pos = offset;
|
||||||
Point2I ext = getExtent();
|
Point2I ext = getExtent();
|
||||||
|
|
||||||
RectI r(pos, ext);
|
RectI bgRect(pos, ext);
|
||||||
GFX->getDrawUtil()->drawRectFill(r, ColorI(255,255,255));
|
GFX->getDrawUtil()->drawRectFill(bgRect, ColorI(255,255,255));
|
||||||
GFX->getDrawUtil()->drawRect(r, ColorI(0,0,0));
|
GFX->getDrawUtil()->drawRect(bgRect, ColorI(0,0,0));
|
||||||
|
|
||||||
// shrink by 2 pixels
|
// shrink by 2 pixels
|
||||||
pos.x += 2;
|
pos.x += 2;
|
||||||
|
|
@ -218,13 +218,13 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
// draw the knots
|
// draw the knots
|
||||||
for (U32 k=0; k < mFilter.size(); k++)
|
for (U32 k=0; k < mFilter.size(); k++)
|
||||||
{
|
{
|
||||||
RectI r;
|
RectI knotRect;
|
||||||
r.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k));
|
knotRect.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k));
|
||||||
r.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k]));
|
knotRect.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k]));
|
||||||
r.point += pos + Point2I(-2,-2);
|
knotRect.point += pos + Point2I(-2,-2);
|
||||||
r.extent = Point2I(5,5);
|
knotRect.extent = Point2I(5,5);
|
||||||
|
|
||||||
GFX->getDrawUtil()->drawRectFill(r, ColorI(255,0,0));
|
GFX->getDrawUtil()->drawRectFill(knotRect, ColorI(255,0,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
renderChildControls(offset, updateRect);
|
renderChildControls(offset, updateRect);
|
||||||
|
|
|
||||||
|
|
@ -658,18 +658,18 @@ void GuiInspector::refresh()
|
||||||
|
|
||||||
if( !group && !isGroupFiltered( itr->pGroupname ) )
|
if( !group && !isGroupFiltered( itr->pGroupname ) )
|
||||||
{
|
{
|
||||||
GuiInspectorGroup *group = new GuiInspectorGroup( itr->pGroupname, this );
|
GuiInspectorGroup *newGroup = new GuiInspectorGroup( itr->pGroupname, this );
|
||||||
|
|
||||||
group->registerObject();
|
newGroup->registerObject();
|
||||||
if( !group->getNumFields() )
|
if( !newGroup->getNumFields() )
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SPEW
|
#ifdef DEBUG_SPEW
|
||||||
Platform::outputDebugString( "[GuiInspector] Removing empty group '%s'",
|
Platform::outputDebugString( "[GuiInspector] Removing empty group '%s'",
|
||||||
group->getCaption().c_str() );
|
newGroup->getCaption().c_str() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The group ended up having no fields. Remove it.
|
// The group ended up having no fields. Remove it.
|
||||||
group->deleteObject();
|
newGroup->deleteObject();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1035,7 +1035,6 @@ GuiControl* GuiInspectorTypeEaseF::constructEditControl()
|
||||||
mBrowseButton = new GuiButtonCtrl();
|
mBrowseButton = new GuiButtonCtrl();
|
||||||
{
|
{
|
||||||
RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) );
|
RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) );
|
||||||
char szBuffer[512];
|
|
||||||
dSprintf( szBuffer, sizeof( szBuffer ), "GetEaseF(%d.getText(), \"%d.apply\", %d.getRoot());", retCtrl->getId(), getId(), getId() );
|
dSprintf( szBuffer, sizeof( szBuffer ), "GetEaseF(%d.getText(), \"%d.apply\", %d.getRoot());", retCtrl->getId(), getId(), getId() );
|
||||||
mBrowseButton->setField( "Command", szBuffer );
|
mBrowseButton->setField( "Command", szBuffer );
|
||||||
mBrowseButton->setField( "text", "E" );
|
mBrowseButton->setField( "text", "E" );
|
||||||
|
|
|
||||||
|
|
@ -535,10 +535,10 @@ void GuiNavEditorCtrl::renderScene(const RectI & updateRect)
|
||||||
GFXStateBlockDesc desc;
|
GFXStateBlockDesc desc;
|
||||||
desc.setBlend(false);
|
desc.setBlend(false);
|
||||||
desc.setZReadWrite(true ,true);
|
desc.setZReadWrite(true ,true);
|
||||||
MatrixF mat(true);
|
MatrixF linkMat(true);
|
||||||
mat.setPosition(mLinkStart);
|
linkMat.setPosition(mLinkStart);
|
||||||
Point3F scale(0.8f, 0.8f, 0.8f);
|
Point3F scale(0.8f, 0.8f, 0.8f);
|
||||||
GFX->getDrawUtil()->drawTransform(desc, mat, &scale);
|
GFX->getDrawUtil()->drawTransform(desc, linkMat, &scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue