gui shadowvar cleanups

This commit is contained in:
Azaezel 2018-03-15 14:50:54 -05:00
parent 2009bf1ee3
commit 342bf8f3d3
9 changed files with 40 additions and 46 deletions

View file

@ -142,7 +142,6 @@ void GuiDecoyCtrl::onMouseMove(const GuiEvent &event)
if(mIsDecoy == true)
{
mVisible = false;
GuiControl *parent = getParent();
GuiControl *tempControl = parent->findHitControl(localPoint);
//the decoy control has the responsibility of keeping track of the decoyed controls status

View file

@ -189,7 +189,7 @@ DefineEngineMethod( GuiDirectoryFileListCtrl, getSelectedFiles, const char*, (),
// Fetch the remaining entries
for( S32 i = 1; i < ItemVector.size(); i++ )
{
StringTableEntry itemText = object->getItemText( ItemVector[i] );
itemText = object->getItemText( ItemVector[i] );
if( !itemText )
continue;

View file

@ -3004,10 +3004,10 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
{
if( !mActive || !mAwake || !mVisible )
return;
BitSet32 hitFlags = 0;
if( isMethod("onMouseUp") )
{
BitSet32 hitFlags = 0;
Item* item;
S32 hitItemId = -1;
@ -3025,7 +3025,7 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
return;
}
BitSet32 hitFlags = 0;
hitFlags = 0;
Item *item;
bool hitCheck = _hitTest( event.mousePoint, item, hitFlags );
mRenamingItem = NULL;
@ -3061,7 +3061,7 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
{
Parent::onMouseMove( event );
BitSet32 hitFlags = 0;
hitFlags = 0;
if( !_hitTest( event.mousePoint, newItem2, hitFlags ) )
{
if( !mShowRoot )
@ -3794,16 +3794,12 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
if (item->isInspectorData())
{
Entity* e = dynamic_cast<Entity*>(item->getObject());
//if (item->mScriptInfo.mText != StringTable->insert("Components"))
{
Entity* e = dynamic_cast<Entity*>(item->getObject());
if (e)
{
if (item->isExpanded())
e->onInspect();
else
e->onEndInspect();
}
if (e)
{
if (item->isExpanded())
e->onInspect();
else
e->onEndInspect();
}
}

View file

@ -1530,9 +1530,9 @@ void GuiCanvas::popDialogControl(GuiControl *gui)
if (size() > 0)
{
GuiControl *ctrl = static_cast<GuiControl *>(last());
if( ctrl->getFirstResponder() )
ctrl->getFirstResponder()->setFirstResponder();
GuiControl *lastCtrl = static_cast<GuiControl *>(last());
if(lastCtrl->getFirstResponder() )
lastCtrl->getFirstResponder()->setFirstResponder();
}
else
{
@ -1547,8 +1547,8 @@ void GuiCanvas::popDialogControl(GuiControl *gui)
if (size() > 0)
{
GuiControl *ctrl = static_cast<GuiControl*>(last());
ctrl->buildAcceleratorMap();
GuiControl *lastCtrl = static_cast<GuiControl*>(last());
lastCtrl->buildAcceleratorMap();
}
refreshMouseControl();
}

View file

@ -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
// incremental drags correctly.
Point2I mousePoint = event.mousePoint;
snapToGrid( mousePoint );
Point2I dragPoint = event.mousePoint;
snapToGrid(dragPoint);
Point2I delta = mousePoint - mLastDragPos;
Point2I delta = dragPoint - mLastDragPos;
// If CTRL is down, apply smart snapping.
@ -584,7 +584,7 @@ void GuiEditCtrl::onMouseDragged( const GuiEvent &event )
// Remember drag point.
mLastDragPos = mousePoint;
mLastDragPos = dragPoint;
}
else if (mMouseDownMode == MovingSelection && mSelectedControls.size())
{
@ -770,7 +770,7 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect)
( mMouseDownMode == MovingSelection || mMouseDownMode == SizingSelection ) &&
( mGridSnap.x || mGridSnap.y ) )
{
Point2I cext = getContentControl()->getExtent();
cext = getContentControl()->getExtent();
Point2I coff = getContentControl()->localToGlobalCoord(Point2I(0,0));
// create point-dots
@ -847,8 +847,8 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect)
if( mSnapTargets[ axis ] )
{
RectI bounds = mSnapTargets[ axis ]->getGlobalBounds();
drawer->drawRect( bounds, ColorI( 128, 128, 128, 128 ) );
RectI snapBounds = mSnapTargets[ axis ]->getGlobalBounds();
drawer->drawRect(snapBounds, ColorI( 128, 128, 128, 128 ) );
}
}
}

View file

@ -177,9 +177,9 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect)
Point2I pos = offset;
Point2I ext = getExtent();
RectI r(pos, ext);
GFX->getDrawUtil()->drawRectFill(r, ColorI(255,255,255));
GFX->getDrawUtil()->drawRect(r, ColorI(0,0,0));
RectI bgRect(pos, ext);
GFX->getDrawUtil()->drawRectFill(bgRect, ColorI(255,255,255));
GFX->getDrawUtil()->drawRect(bgRect, ColorI(0,0,0));
// shrink by 2 pixels
pos.x += 2;
@ -218,13 +218,13 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect)
// draw the knots
for (U32 k=0; k < mFilter.size(); k++)
{
RectI r;
r.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k));
r.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k]));
r.point += pos + Point2I(-2,-2);
r.extent = Point2I(5,5);
RectI knotRect;
knotRect.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k));
knotRect.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k]));
knotRect.point += pos + Point2I(-2,-2);
knotRect.extent = Point2I(5,5);
GFX->getDrawUtil()->drawRectFill(r, ColorI(255,0,0));
GFX->getDrawUtil()->drawRectFill(knotRect, ColorI(255,0,0));
}
renderChildControls(offset, updateRect);

View file

@ -658,18 +658,18 @@ void GuiInspector::refresh()
if( !group && !isGroupFiltered( itr->pGroupname ) )
{
GuiInspectorGroup *group = new GuiInspectorGroup( itr->pGroupname, this );
GuiInspectorGroup *newGroup = new GuiInspectorGroup( itr->pGroupname, this );
group->registerObject();
if( !group->getNumFields() )
newGroup->registerObject();
if( !newGroup->getNumFields() )
{
#ifdef DEBUG_SPEW
Platform::outputDebugString( "[GuiInspector] Removing empty group '%s'",
group->getCaption().c_str() );
newGroup->getCaption().c_str() );
#endif
// The group ended up having no fields. Remove it.
group->deleteObject();
newGroup->deleteObject();
}
else
{

View file

@ -1035,7 +1035,6 @@ GuiControl* GuiInspectorTypeEaseF::constructEditControl()
mBrowseButton = new GuiButtonCtrl();
{
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() );
mBrowseButton->setField( "Command", szBuffer );
mBrowseButton->setField( "text", "E" );

View file

@ -535,10 +535,10 @@ void GuiNavEditorCtrl::renderScene(const RectI & updateRect)
GFXStateBlockDesc desc;
desc.setBlend(false);
desc.setZReadWrite(true ,true);
MatrixF mat(true);
mat.setPosition(mLinkStart);
MatrixF linkMat(true);
linkMat.setPosition(mLinkStart);
Point3F scale(0.8f, 0.8f, 0.8f);
GFX->getDrawUtil()->drawTransform(desc, mat, &scale);
GFX->getDrawUtil()->drawTransform(desc, linkMat, &scale);
}
}