mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-20 23:23:47 +00:00
Merge branch 'development' into EngineAPI-Refactor
This commit is contained in:
commit
3a71c75596
1937 changed files with 102332 additions and 70549 deletions
|
|
@ -432,8 +432,6 @@ void GuiTSCtrl::_internalRender(RectI guiViewport, RectI renderViewport, Frustum
|
|||
if (mRenderStyle == RenderStyleStereoSideBySide && debugDraw->willDraw())
|
||||
{
|
||||
// For SBS we need to render over each viewport
|
||||
Frustum frustum;
|
||||
|
||||
GFX->setViewport(mLastCameraQuery.stereoViewports[0]);
|
||||
MathUtils::makeFovPortFrustum(&frustum, mLastCameraQuery.ortho, mLastCameraQuery.nearPlane, mLastCameraQuery.farPlane, mLastCameraQuery.fovPort[0]);
|
||||
GFX->setFrustum(frustum);
|
||||
|
|
@ -543,7 +541,6 @@ void GuiTSCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
GFX->setStereoTargets(mLastCameraQuery.stereoTargets);
|
||||
|
||||
MatrixF myTransforms[2];
|
||||
Frustum frustum;
|
||||
|
||||
if (smUseLatestDisplayTransform)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ void GuiWindowCtrl::moveToCollapseGroup(GuiWindowCtrl* hitWindow, bool orientati
|
|||
}
|
||||
else
|
||||
{
|
||||
S32 groupVec = hitWindow->mCollapseGroup;
|
||||
groupVec = hitWindow->mCollapseGroup;
|
||||
|
||||
if(orientation == 0)
|
||||
parent->mCollapseGroupVec[groupVec].push_front(this);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -190,9 +190,9 @@ void GuiPopupTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selec
|
|||
if(drawbox)
|
||||
{
|
||||
Point2I coloredboxsize(15,10);
|
||||
RectI r(offset.x + mProfile->mTextOffset.x, offset.y+2, coloredboxsize.x, coloredboxsize.y);
|
||||
GFX->getDrawUtil()->drawRectFill( r, boxColor);
|
||||
GFX->getDrawUtil()->drawRect( r, ColorI(0,0,0));
|
||||
RectI boxBounds(offset.x + mProfile->mTextOffset.x, offset.y+2, coloredboxsize.x, coloredboxsize.y);
|
||||
GFX->getDrawUtil()->drawRectFill(boxBounds, boxColor);
|
||||
GFX->getDrawUtil()->drawRect(boxBounds, ColorI(0,0,0));
|
||||
|
||||
textXOffset += coloredboxsize.x + mProfile->mTextOffset.x;
|
||||
}
|
||||
|
|
@ -855,23 +855,23 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
|
||||
GFXDrawUtil* drawUtil = GFX->getDrawUtil();
|
||||
|
||||
RectI r( offset, getExtent() );
|
||||
RectI baseRect( offset, getExtent() );
|
||||
if ( mInAction )
|
||||
{
|
||||
S32 l = r.point.x, r2 = r.point.x + r.extent.x - 1;
|
||||
S32 t = r.point.y, b = r.point.y + r.extent.y - 1;
|
||||
S32 left = baseRect.point.x, right = baseRect.point.x + baseRect.extent.x - 1;
|
||||
S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1;
|
||||
|
||||
// Do we render a bitmap border or lines?
|
||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
||||
{
|
||||
// Render the fixed, filled in border
|
||||
renderFixedBitmapBordersFilled(r, 3, mProfile );
|
||||
renderFixedBitmapBordersFilled(baseRect, 3, mProfile );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//renderSlightlyLoweredBox(r, mProfile);
|
||||
drawUtil->drawRectFill( r, mProfile->mFillColor );
|
||||
drawUtil->drawRectFill(baseRect, mProfile->mFillColor );
|
||||
}
|
||||
|
||||
// Draw a bitmap over the background?
|
||||
|
|
@ -891,10 +891,10 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
// Do we render a bitmap border or lines?
|
||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
||||
{
|
||||
drawUtil->drawLine( l, t, l, b, colorWhite );
|
||||
drawUtil->drawLine( l, t, r2, t, colorWhite );
|
||||
drawUtil->drawLine( l + 1, b, r2, b, mProfile->mBorderColor );
|
||||
drawUtil->drawLine( r2, t + 1, r2, b - 1, mProfile->mBorderColor );
|
||||
drawUtil->drawLine(left, top, left, bottom, colorWhite );
|
||||
drawUtil->drawLine(left, top, right, top, colorWhite );
|
||||
drawUtil->drawLine(left + 1, bottom, right, bottom, mProfile->mBorderColor );
|
||||
drawUtil->drawLine(right, top + 1, right, bottom - 1, mProfile->mBorderColor );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -903,19 +903,19 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
// TODO: Add onMouseEnter() and onMouseLeave() and a definition of mMouseOver (see guiButtonBaseCtrl) for this to work.
|
||||
if ( mMouseOver )
|
||||
{
|
||||
S32 l = r.point.x, r2 = r.point.x + r.extent.x - 1;
|
||||
S32 t = r.point.y, b = r.point.y + r.extent.y - 1;
|
||||
S32 left = baseRect.point.x, right = baseRect.point.x + baseRect.extent.x - 1;
|
||||
S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1;
|
||||
|
||||
// Do we render a bitmap border or lines?
|
||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
||||
{
|
||||
// Render the fixed, filled in border
|
||||
renderFixedBitmapBordersFilled( r, 2, mProfile );
|
||||
renderFixedBitmapBordersFilled(baseRect, 2, mProfile );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
drawUtil->drawRectFill( r, mProfile->mFillColorHL );
|
||||
drawUtil->drawRectFill(baseRect, mProfile->mFillColorHL );
|
||||
}
|
||||
|
||||
// Draw a bitmap over the background?
|
||||
|
|
@ -929,10 +929,10 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
// Do we render a bitmap border or lines?
|
||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
||||
{
|
||||
drawUtil->drawLine( l, t, l, b, colorWhite );
|
||||
drawUtil->drawLine( l, t, r2, t, colorWhite );
|
||||
drawUtil->drawLine( l + 1, b, r2, b, mProfile->mBorderColor );
|
||||
drawUtil->drawLine( r2, t + 1, r2, b - 1, mProfile->mBorderColor );
|
||||
drawUtil->drawLine(left, top, left, bottom, colorWhite);
|
||||
drawUtil->drawLine(left, top, right, top, colorWhite);
|
||||
drawUtil->drawLine(left + 1, bottom, right, bottom, mProfile->mBorderColor);
|
||||
drawUtil->drawLine(right, top + 1, right, bottom - 1, mProfile->mBorderColor);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -941,11 +941,11 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
||||
{
|
||||
// Render the fixed, filled in border
|
||||
renderFixedBitmapBordersFilled( r, 1, mProfile );
|
||||
renderFixedBitmapBordersFilled(baseRect, 1, mProfile );
|
||||
}
|
||||
else
|
||||
{
|
||||
drawUtil->drawRectFill( r, mProfile->mFillColorNA );
|
||||
drawUtil->drawRectFill(baseRect, mProfile->mFillColorNA );
|
||||
}
|
||||
|
||||
// Draw a bitmap over the background?
|
||||
|
|
@ -959,7 +959,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
// Do we render a bitmap border or lines?
|
||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
||||
{
|
||||
drawUtil->drawRect( r, mProfile->mBorderColorNA );
|
||||
drawUtil->drawRect( baseRect, mProfile->mBorderColorNA );
|
||||
}
|
||||
}
|
||||
// renderSlightlyRaisedBox(r, mProfile); // Used to be the only 'else' condition to mInAction above.
|
||||
|
|
@ -1029,9 +1029,9 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
if ( drawbox )
|
||||
{
|
||||
Point2I coloredboxsize( 15, 10 );
|
||||
RectI r( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y );
|
||||
drawUtil->drawRectFill( r, boxColor);
|
||||
drawUtil->drawRect( r, ColorI(0,0,0));
|
||||
RectI boxBounds( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y );
|
||||
drawUtil->drawRectFill(boxBounds, boxColor);
|
||||
drawUtil->drawRect(boxBounds, ColorI(0,0,0));
|
||||
|
||||
localStart.x += coloredboxsize.x + mProfile->mTextOffset.x;
|
||||
}
|
||||
|
|
@ -1055,18 +1055,18 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
|
||||
// Draw the second column to the right
|
||||
getColumn( mText, buff, 1, "\t" );
|
||||
S32 txt_w = mProfile->mFont->getStrWidth( buff );
|
||||
S32 colTxt_w = mProfile->mFont->getStrWidth( buff );
|
||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
||||
{
|
||||
// We're making use of a bitmap border, so take into account the
|
||||
// right cap of the border.
|
||||
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) );
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - bitmapBounds[2].extent.x, localStart.y ) );
|
||||
drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors );
|
||||
|
||||
} else
|
||||
{
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - 12, localStart.y ) );
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - 12, localStart.y ) );
|
||||
drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors );
|
||||
}
|
||||
|
||||
|
|
@ -1079,10 +1079,10 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
|||
if ( !(mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size()) )
|
||||
{
|
||||
// Draw a triangle (down arrow)
|
||||
S32 left = r.point.x + r.extent.x - 12;
|
||||
S32 left = baseRect.point.x + baseRect.extent.x - 12;
|
||||
S32 right = left + 8;
|
||||
S32 middle = left + 4;
|
||||
S32 top = r.extent.y / 2 + r.point.y - 4;
|
||||
S32 top = baseRect.extent.y / 2 + baseRect.point.y - 4;
|
||||
S32 bottom = top + 8;
|
||||
|
||||
PrimBuild::color( mProfile->mFontColor );
|
||||
|
|
|
|||
|
|
@ -1211,9 +1211,9 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
|
|||
if ( drawbox )
|
||||
{
|
||||
Point2I coloredboxsize( 15, 10 );
|
||||
RectI r( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y );
|
||||
drawUtil->drawRectFill( r, boxColor);
|
||||
drawUtil->drawRect( r, ColorI(0,0,0));
|
||||
RectI boxBounds( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y );
|
||||
drawUtil->drawRectFill(boxBounds, boxColor);
|
||||
drawUtil->drawRect(boxBounds, ColorI(0,0,0));
|
||||
|
||||
localStart.x += coloredboxsize.x + mProfile->mTextOffset.x;
|
||||
}
|
||||
|
|
@ -1237,18 +1237,18 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
|
|||
|
||||
// Draw the second column to the right
|
||||
getColumn( mText, buff, 1, "\t" );
|
||||
S32 txt_w = mProfile->mFont->getStrWidth( buff );
|
||||
S32 colTxt_w = mProfile->mFont->getStrWidth( buff );
|
||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
||||
{
|
||||
// We're making use of a bitmap border, so take into account the
|
||||
// right cap of the border.
|
||||
RectI* bitmapBounds = mProfile->mBitmapArrayRects.address();
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) );
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - bitmapBounds[2].extent.x, localStart.y ) );
|
||||
drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors );
|
||||
|
||||
} else
|
||||
{
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - 12, localStart.y ) );
|
||||
Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - 12, localStart.y ) );
|
||||
drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,26 +3025,26 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
|
|||
return;
|
||||
}
|
||||
|
||||
BitSet32 hitFlags = 0;
|
||||
Item *item;
|
||||
bool hitCheck = _hitTest( event.mousePoint, item, hitFlags );
|
||||
hitFlags = 0;
|
||||
Item *hitItem;
|
||||
bool hitCheck = _hitTest( event.mousePoint, hitItem, hitFlags );
|
||||
mRenamingItem = NULL;
|
||||
|
||||
if( hitCheck )
|
||||
{
|
||||
if ( event.mouseClickCount == 1 && !mMouseDragged && mPossibleRenameItem != NULL )
|
||||
{
|
||||
if ( item == mPossibleRenameItem )
|
||||
showItemRenameCtrl( item );
|
||||
if (hitItem == mPossibleRenameItem )
|
||||
showItemRenameCtrl(hitItem);
|
||||
}
|
||||
else // If mouseUp occurs on the same item as mouse down
|
||||
{
|
||||
bool wasSelected = isSelected( item );
|
||||
bool wasSelected = isSelected(hitItem);
|
||||
bool multiSelect = getSelectedItemsCount() > 1;
|
||||
if( wasSelected && multiSelect && item == mTempItem )
|
||||
if( wasSelected && multiSelect && hitItem == mTempItem )
|
||||
{
|
||||
clearSelection();
|
||||
addSelection( item->mId );
|
||||
addSelection( hitItem->mId );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
F32 Scale = F32( getExtent().y ) / F32( mGraphMax[ k ] * 1.05 );
|
||||
|
||||
const S32 numSamples = mGraphData[ k ].size();
|
||||
|
||||
F32 graphOffset;
|
||||
switch( mGraphType[ k ] )
|
||||
{
|
||||
case Bar:
|
||||
|
|
@ -180,21 +180,21 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
PrimBuild::begin( GFXTriangleStrip, 4 );
|
||||
PrimBuild::color( mGraphColor[ k ] );
|
||||
|
||||
F32 offset = F32( getExtent().x ) / F32( MaxDataPoints ) * F32( sample + 1 );
|
||||
graphOffset = F32( getExtent().x ) / F32( MaxDataPoints ) * F32( sample + 1 );
|
||||
|
||||
PrimBuild::vertex2f( globalPos.x + prevOffset,
|
||||
midPointY - ( getDatum( k, sample ) * Scale ) );
|
||||
|
||||
PrimBuild::vertex2f( globalPos.x + offset,
|
||||
PrimBuild::vertex2f( globalPos.x + graphOffset,
|
||||
midPointY - ( getDatum( k, sample ) * Scale ) );
|
||||
|
||||
PrimBuild::vertex2f( globalPos.x + offset,
|
||||
PrimBuild::vertex2f( globalPos.x + graphOffset,
|
||||
midPointY );
|
||||
|
||||
PrimBuild::vertex2f( globalPos.x + prevOffset,
|
||||
midPointY );
|
||||
|
||||
prevOffset = offset;
|
||||
prevOffset = graphOffset;
|
||||
|
||||
PrimBuild::end();
|
||||
}
|
||||
|
|
@ -209,12 +209,12 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
|
||||
for( S32 sample = 0; sample < numSamples; ++ sample )
|
||||
{
|
||||
F32 offset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
||||
graphOffset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
||||
|
||||
PrimBuild::vertex2f( globalPos.x + offset,
|
||||
PrimBuild::vertex2f( globalPos.x + graphOffset,
|
||||
midPointY );
|
||||
|
||||
PrimBuild::vertex2f( globalPos.x + offset,
|
||||
PrimBuild::vertex2f( globalPos.x + graphOffset,
|
||||
midPointY - ( getDatum( k, sample ) * Scale ) );
|
||||
}
|
||||
|
||||
|
|
@ -234,9 +234,9 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
|
||||
for( S32 sample = 0; sample < numSamples; ++ sample )
|
||||
{
|
||||
F32 offset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
||||
graphOffset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample );
|
||||
|
||||
PrimBuild::vertex2f( globalPos.x + offset,
|
||||
PrimBuild::vertex2f( globalPos.x + graphOffset,
|
||||
midPointY - ( getDatum( k, sample ) * Scale ) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -658,23 +658,23 @@ 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
|
||||
{
|
||||
mGroups.push_back( group );
|
||||
addObject( group );
|
||||
mGroups.push_back(newGroup);
|
||||
addObject(newGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1034,7 +1034,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" );
|
||||
|
|
|
|||
|
|
@ -1369,19 +1369,19 @@ void GuiMenuBar::buildWindowAcceleratorMap(WindowInputGenerator &inputGenerator)
|
|||
{
|
||||
for (U32 item = 0; item < mMenuList[i].popupMenu->mMenuItems.size(); item++)
|
||||
{
|
||||
if (!mMenuList[i].popupMenu->mMenuItems[item].accelerator)
|
||||
if (!mMenuList[i].popupMenu->mMenuItems[item].mAccelerator)
|
||||
{
|
||||
mMenuList[i].popupMenu->mMenuItems[item].accelerator = 0;
|
||||
mMenuList[i].popupMenu->mMenuItems[item].mAccelerator = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
EventDescriptor accelEvent;
|
||||
ActionMap::createEventDescriptor(mMenuList[i].popupMenu->mMenuItems[item].accelerator, &accelEvent);
|
||||
ActionMap::createEventDescriptor(mMenuList[i].popupMenu->mMenuItems[item].mAccelerator, &accelEvent);
|
||||
|
||||
//now we have a modifier, and a key, add them to the canvas
|
||||
inputGenerator.addAcceleratorKey(this, mMenuList[i].popupMenu->mMenuItems[item].cmd, accelEvent.eventCode, accelEvent.flags);
|
||||
inputGenerator.addAcceleratorKey(this, mMenuList[i].popupMenu->mMenuItems[item].mCMD, accelEvent.eventCode, accelEvent.flags);
|
||||
|
||||
mMenuList[i].popupMenu->mMenuItems[item].acceleratorIndex = mCurAcceleratorIndex;
|
||||
mMenuList[i].popupMenu->mMenuItems[item].mAcceleratorIndex = mCurAcceleratorIndex;
|
||||
mCurAcceleratorIndex++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1403,7 +1403,7 @@ void GuiMenuBar::acceleratorKeyPress(U32 index)
|
|||
|
||||
for(U32 item = 0; item < mMenuList[i].popupMenu->mMenuItems.size(); item++)
|
||||
{
|
||||
if(mMenuList[i].popupMenu->mMenuItems[item].acceleratorIndex == index)
|
||||
if(mMenuList[i].popupMenu->mMenuItems[item].mAcceleratorIndex == index)
|
||||
{
|
||||
// first, call the script callback for menu selection:
|
||||
onMenuSelect_callback(mMenuList[i].popupMenu->getId(), mMenuList[i].text);
|
||||
|
|
@ -1454,7 +1454,7 @@ void GuiMenuBar::insert(SimObject* pObject, S32 pos)
|
|||
newMenu.drawBitmapOnly = false;
|
||||
newMenu.drawBorder = true;
|
||||
newMenu.bitmapIndex = -1;
|
||||
newMenu.text = menu->barTitle;
|
||||
newMenu.text = menu->mBarTitle;
|
||||
newMenu.visible = true;
|
||||
newMenu.popupMenu = menu;
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ GuiPopupMenuTextListCtrl::GuiPopupMenuTextListCtrl()
|
|||
void GuiPopupMenuTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver)
|
||||
{
|
||||
//check if we're a real entry, or if it's a divider
|
||||
if (mPopup->mMenuItems[cell.y].isSpacer)
|
||||
if (mPopup->mMenuItems[cell.y].mIsSpacer)
|
||||
{
|
||||
S32 yp = offset.y + mCellSize.y / 2;
|
||||
GFX->getDrawUtil()->drawLine(offset.x + 5, yp, offset.x + mCellSize.x - 5, yp, ColorI(128, 128, 128));
|
||||
|
|
@ -214,8 +214,8 @@ void GuiPopupMenuTextListCtrl::onMouseUp(const GuiEvent &event)
|
|||
|
||||
if (item)
|
||||
{
|
||||
if (item->enabled)
|
||||
dAtob(Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->text.isNotEmpty() ? item->text : ""));
|
||||
if (item->mEnabled)
|
||||
dAtob(Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->mText.isNotEmpty() ? item->mText : ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -247,9 +247,9 @@ void GuiPopupMenuTextListCtrl::onCellHighlighted(Point2I cell)
|
|||
{
|
||||
MenuItem *list = &mPopup->mMenuItems[selectionIndex];
|
||||
|
||||
if (list->isSubmenu && list->subMenu != nullptr)
|
||||
if (list->mIsSubmenu && list->mSubMenu != nullptr)
|
||||
{
|
||||
list->subMenu->showPopup(getRoot(), getPosition().x + mCellSize.x, getPosition().y + (selectionIndex * mCellSize.y));
|
||||
list->mSubMenu->showPopup(getRoot(), getPosition().x + mCellSize.x, getPosition().y + (selectionIndex * mCellSize.y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -366,8 +366,8 @@ bool GuiShapeEdPreview::setObjectModel(const char* modelName)
|
|||
mOrbitPos = shape->center;
|
||||
|
||||
// Set camera move and zoom speed according to model size
|
||||
mMoveSpeed = shape->radius / sMoveScaler;
|
||||
mZoomSpeed = shape->radius / sZoomScaler;
|
||||
mMoveSpeed = shape->mRadius / sMoveScaler;
|
||||
mZoomSpeed = shape->mRadius / sZoomScaler;
|
||||
|
||||
// Reset node selection
|
||||
mHoverNode = -1;
|
||||
|
|
@ -853,7 +853,7 @@ void GuiShapeEdPreview::exportToCollada( const String& path )
|
|||
if ( mModel )
|
||||
{
|
||||
MatrixF orientation( true );
|
||||
orientation.setPosition( mModel->getShape()->bounds.getCenter() );
|
||||
orientation.setPosition( mModel->getShape()->mBounds.getCenter() );
|
||||
orientation.inverse();
|
||||
|
||||
OptimizedPolyList polyList;
|
||||
|
|
@ -1138,8 +1138,8 @@ bool GuiShapeEdPreview::getCameraTransform(MatrixF* cameraMatrix)
|
|||
cameraMatrix->identity();
|
||||
if ( mModel )
|
||||
{
|
||||
Point3F camPos = mModel->getShape()->bounds.getCenter();
|
||||
F32 offset = mModel->getShape()->bounds.len();
|
||||
Point3F camPos = mModel->getShape()->mBounds.getCenter();
|
||||
F32 offset = mModel->getShape()->mBounds.len();
|
||||
|
||||
switch (mDisplayType)
|
||||
{
|
||||
|
|
@ -1244,9 +1244,9 @@ void GuiShapeEdPreview::updateDetailLevel(const SceneRenderState* state)
|
|||
continue;
|
||||
|
||||
// Count the number of draw calls and materials
|
||||
mNumDrawCalls += mesh->primitives.size();
|
||||
for ( S32 iPrim = 0; iPrim < mesh->primitives.size(); iPrim++ )
|
||||
usedMaterials.push_back_unique( mesh->primitives[iPrim].matIndex & TSDrawPrimitive::MaterialMask );
|
||||
mNumDrawCalls += mesh->mPrimitives.size();
|
||||
for ( S32 iPrim = 0; iPrim < mesh->mPrimitives.size(); iPrim++ )
|
||||
usedMaterials.push_back_unique( mesh->mPrimitives[iPrim].matIndex & TSDrawPrimitive::MaterialMask );
|
||||
|
||||
// For skinned meshes, count the number of bones and weights
|
||||
if ( mesh->getMeshType() == TSMesh::SkinMeshType )
|
||||
|
|
@ -1442,7 +1442,7 @@ void GuiShapeEdPreview::renderWorld(const RectI &updateRect)
|
|||
// Render the shape bounding box
|
||||
if ( mRenderBounds )
|
||||
{
|
||||
Point3F boxSize = mModel->getShape()->bounds.maxExtents - mModel->getShape()->bounds.minExtents;
|
||||
Point3F boxSize = mModel->getShape()->mBounds.maxExtents - mModel->getShape()->mBounds.minExtents;
|
||||
|
||||
GFXStateBlockDesc desc;
|
||||
desc.fillMode = GFXFillWireframe;
|
||||
|
|
@ -1544,7 +1544,7 @@ void GuiShapeEdPreview::renderSunDirection() const
|
|||
{
|
||||
// Render four arrows aiming in the direction of the sun's light
|
||||
ColorI color = LinearColorF( mFakeSun->getColor()).toColorI();
|
||||
F32 length = mModel->getShape()->bounds.len() * 0.8f;
|
||||
F32 length = mModel->getShape()->mBounds.len() * 0.8f;
|
||||
|
||||
// Get the sun's vectors
|
||||
Point3F fwd = mFakeSun->getTransform().getForwardVector();
|
||||
|
|
|
|||
|
|
@ -46,14 +46,20 @@ public:
|
|||
//-----------------------------------------------------------------------------
|
||||
PopupMenu::PopupMenu()
|
||||
{
|
||||
bitmapIndex = -1;
|
||||
mMenuItems = NULL;
|
||||
mMenuBarCtrl = nullptr;
|
||||
|
||||
barTitle = StringTable->EmptyString();
|
||||
mBarTitle = StringTable->EmptyString();
|
||||
mBounds = RectI(0, 0, 64, 64);
|
||||
mVisible = true;
|
||||
|
||||
mMenuBarCtrl = nullptr;
|
||||
mTextList = nullptr;
|
||||
mBitmapIndex = -1;
|
||||
mDrawBitmapOnly = false;
|
||||
mDrawBorder = false;
|
||||
|
||||
isSubmenu = false;
|
||||
mTextList = nullptr;
|
||||
|
||||
mIsSubmenu = false;
|
||||
}
|
||||
|
||||
PopupMenu::~PopupMenu()
|
||||
|
|
@ -76,7 +82,7 @@ void PopupMenu::initPersistFields()
|
|||
{
|
||||
Parent::initPersistFields();
|
||||
|
||||
addField("barTitle", TypeCaseString, Offset(barTitle, PopupMenu), "");
|
||||
addField("barTitle", TypeCaseString, Offset(mBarTitle, PopupMenu), "");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -134,28 +140,28 @@ S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, c
|
|||
String titleString = title;
|
||||
|
||||
MenuItem newItem;
|
||||
newItem.id = pos;
|
||||
newItem.text = titleString;
|
||||
newItem.cmd = cmd;
|
||||
newItem.mID = pos;
|
||||
newItem.mText = titleString;
|
||||
newItem.mCMD = cmd;
|
||||
|
||||
if (titleString.isEmpty() || titleString == String("-"))
|
||||
newItem.isSpacer = true;
|
||||
newItem.mIsSpacer = true;
|
||||
else
|
||||
newItem.isSpacer = false;
|
||||
newItem.mIsSpacer = false;
|
||||
|
||||
if (accelerator[0])
|
||||
newItem.accelerator = dStrdup(accelerator);
|
||||
newItem.mAccelerator = dStrdup(accelerator);
|
||||
else
|
||||
newItem.accelerator = NULL;
|
||||
newItem.mAccelerator = NULL;
|
||||
|
||||
newItem.visible = true;
|
||||
newItem.isChecked = false;
|
||||
newItem.acceleratorIndex = 0;
|
||||
newItem.enabled = !newItem.isSpacer;
|
||||
newItem.mVisible = true;
|
||||
newItem.mIsChecked = false;
|
||||
newItem.mAcceleratorIndex = 0;
|
||||
newItem.mEnabled = !newItem.mIsSpacer;
|
||||
|
||||
newItem.isSubmenu = false;
|
||||
newItem.subMenu = nullptr;
|
||||
newItem.subMenuParentMenu = nullptr;
|
||||
newItem.mIsSubmenu = false;
|
||||
newItem.mSubMenu = nullptr;
|
||||
newItem.mSubMenuParentMenu = nullptr;
|
||||
|
||||
mMenuItems.push_back(newItem);
|
||||
|
||||
|
|
@ -166,11 +172,11 @@ S32 PopupMenu::insertSubMenu(S32 pos, const char *title, PopupMenu *submenu)
|
|||
{
|
||||
S32 itemPos = insertItem(pos, title, "", "");
|
||||
|
||||
mMenuItems[itemPos].isSubmenu = true;
|
||||
mMenuItems[itemPos].subMenu = submenu;
|
||||
mMenuItems[itemPos].subMenuParentMenu = this;
|
||||
mMenuItems[itemPos].mIsSubmenu = true;
|
||||
mMenuItems[itemPos].mSubMenu = submenu;
|
||||
mMenuItems[itemPos].mSubMenuParentMenu = this;
|
||||
|
||||
submenu->isSubmenu = true;
|
||||
submenu->mIsSubmenu = true;
|
||||
|
||||
return itemPos;
|
||||
}
|
||||
|
|
@ -181,15 +187,15 @@ bool PopupMenu::setItem(S32 pos, const char *title, const char* accelerator, con
|
|||
|
||||
for (U32 i = 0; i < mMenuItems.size(); i++)
|
||||
{
|
||||
if (mMenuItems[i].text == titleString)
|
||||
if (mMenuItems[i].mText == titleString)
|
||||
{
|
||||
mMenuItems[i].id = pos;
|
||||
mMenuItems[i].cmd = cmd;
|
||||
mMenuItems[i].mID = pos;
|
||||
mMenuItems[i].mCMD = cmd;
|
||||
|
||||
if (accelerator && accelerator[0])
|
||||
mMenuItems[i].accelerator = dStrdup(accelerator);
|
||||
mMenuItems[i].mAccelerator = dStrdup(accelerator);
|
||||
else
|
||||
mMenuItems[i].accelerator = NULL;
|
||||
mMenuItems[i].mAccelerator = NULL;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -199,7 +205,7 @@ bool PopupMenu::setItem(S32 pos, const char *title, const char* accelerator, con
|
|||
|
||||
void PopupMenu::removeItem(S32 itemPos)
|
||||
{
|
||||
if (mMenuItems.size() < itemPos || itemPos < 0)
|
||||
if (mMenuItems.empty() || mMenuItems.size() < itemPos || itemPos < 0)
|
||||
return;
|
||||
|
||||
mMenuItems.erase(itemPos);
|
||||
|
|
@ -208,45 +214,45 @@ void PopupMenu::removeItem(S32 itemPos)
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
void PopupMenu::enableItem(S32 pos, bool enable)
|
||||
{
|
||||
if (mMenuItems.size() < pos || pos < 0)
|
||||
if (mMenuItems.empty() || mMenuItems.size() < pos || pos < 0)
|
||||
return;
|
||||
|
||||
mMenuItems[pos].enabled = enable;
|
||||
mMenuItems[pos].mEnabled = enable;
|
||||
}
|
||||
|
||||
void PopupMenu::checkItem(S32 pos, bool checked)
|
||||
{
|
||||
if (mMenuItems.size() < pos || pos < 0)
|
||||
if (mMenuItems.empty() || mMenuItems.size() < pos || pos < 0)
|
||||
return;
|
||||
|
||||
if (checked && mMenuItems[pos].checkGroup != -1)
|
||||
if (checked && mMenuItems[pos].mCheckGroup != -1)
|
||||
{
|
||||
// first, uncheck everything in the group:
|
||||
for (U32 i = 0; i < mMenuItems.size(); i++)
|
||||
if (mMenuItems[i].checkGroup == mMenuItems[pos].checkGroup && mMenuItems[i].isChecked)
|
||||
mMenuItems[i].isChecked = false;
|
||||
if (mMenuItems[i].mCheckGroup == mMenuItems[pos].mCheckGroup && mMenuItems[i].mIsChecked)
|
||||
mMenuItems[i].mIsChecked = false;
|
||||
}
|
||||
|
||||
mMenuItems[pos].isChecked;
|
||||
mMenuItems[pos].mIsChecked = checked;
|
||||
}
|
||||
|
||||
void PopupMenu::checkRadioItem(S32 firstPos, S32 lastPos, S32 checkPos)
|
||||
{
|
||||
for (U32 i = 0; i < mMenuItems.size(); i++)
|
||||
{
|
||||
if (mMenuItems[i].id >= firstPos && mMenuItems[i].id <= lastPos)
|
||||
if (mMenuItems[i].mID >= firstPos && mMenuItems[i].mID <= lastPos)
|
||||
{
|
||||
mMenuItems[i].isChecked = false;
|
||||
mMenuItems[i].mIsChecked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool PopupMenu::isItemChecked(S32 pos)
|
||||
{
|
||||
if (mMenuItems.size() < pos || pos < 0)
|
||||
if (mMenuItems.empty() || mMenuItems.size() < pos || pos < 0)
|
||||
return false;
|
||||
|
||||
return mMenuItems[pos].isChecked;
|
||||
return mMenuItems[pos].mIsChecked;
|
||||
}
|
||||
|
||||
U32 PopupMenu::getItemCount()
|
||||
|
|
@ -254,6 +260,11 @@ U32 PopupMenu::getItemCount()
|
|||
return mMenuItems.size();
|
||||
}
|
||||
|
||||
void PopupMenu::clearItems()
|
||||
{
|
||||
mMenuItems.clear();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool PopupMenu::canHandleID(U32 id)
|
||||
{
|
||||
|
|
@ -305,7 +316,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
|
|||
if (!backgroundCtrl || !mTextList)
|
||||
return;
|
||||
|
||||
if (!isSubmenu)
|
||||
if (!mIsSubmenu)
|
||||
{
|
||||
//if we're a 'parent' menu, then tell the background to clear out all existing other popups
|
||||
|
||||
|
|
@ -354,11 +365,11 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
|
|||
|
||||
for (U32 i = 0; i < mMenuItems.size(); i++)
|
||||
{
|
||||
if (!mMenuItems[i].visible)
|
||||
if (!mMenuItems[i].mVisible)
|
||||
continue;
|
||||
|
||||
S32 iTextWidth = font->getStrWidth(mMenuItems[i].text.c_str());
|
||||
S32 iAcceleratorWidth = mMenuItems[i].accelerator ? font->getStrWidth(mMenuItems[i].accelerator) : 0;
|
||||
S32 iTextWidth = font->getStrWidth(mMenuItems[i].mText.c_str());
|
||||
S32 iAcceleratorWidth = mMenuItems[i].mAccelerator ? font->getStrWidth(mMenuItems[i].mAccelerator) : 0;
|
||||
|
||||
if (iTextWidth > textWidth)
|
||||
textWidth = iTextWidth;
|
||||
|
|
@ -378,7 +389,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
|
|||
|
||||
for (U32 i = 0; i < mMenuItems.size(); i++)
|
||||
{
|
||||
if (!mMenuItems[i].visible)
|
||||
if (!mMenuItems[i].mVisible)
|
||||
continue;
|
||||
|
||||
char buf[512];
|
||||
|
|
@ -386,17 +397,17 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
|
|||
// If this menu item is a submenu, then set the isSubmenu to 2 to indicate
|
||||
// an arrow should be drawn. Otherwise set the isSubmenu normally.
|
||||
char isSubmenu = 1;
|
||||
if (mMenuItems[i].isSubmenu)
|
||||
if (mMenuItems[i].mIsSubmenu)
|
||||
isSubmenu = 2;
|
||||
|
||||
char bitmapIndex = 1;
|
||||
if (mMenuItems[i].bitmapIndex >= 0 && (mMenuItems[i].bitmapIndex * 3 <= profile->mBitmapArrayRects.size()))
|
||||
bitmapIndex = mMenuItems[i].bitmapIndex + 2;
|
||||
if (mMenuItems[i].mBitmapIndex >= 0 && (mMenuItems[i].mBitmapIndex * 3 <= profile->mBitmapArrayRects.size()))
|
||||
bitmapIndex = mMenuItems[i].mBitmapIndex + 2;
|
||||
|
||||
dSprintf(buf, sizeof(buf), "%c%c\t%s\t%s", bitmapIndex, isSubmenu, mMenuItems[i].text.c_str(), mMenuItems[i].accelerator ? mMenuItems[i].accelerator : "");
|
||||
dSprintf(buf, sizeof(buf), "%c%c\t%s\t%s", bitmapIndex, isSubmenu, mMenuItems[i].mText.c_str(), mMenuItems[i].mAccelerator ? mMenuItems[i].mAccelerator : "");
|
||||
mTextList->addEntry(entryCount, buf);
|
||||
|
||||
if (!mMenuItems[i].enabled)
|
||||
if (!mMenuItems[i].mEnabled)
|
||||
mTextList->setEntryActive(entryCount, false);
|
||||
|
||||
entryCount++;
|
||||
|
|
@ -437,8 +448,8 @@ void PopupMenu::hidePopupSubmenus()
|
|||
{
|
||||
for (U32 i = 0; i < mMenuItems.size(); i++)
|
||||
{
|
||||
if (mMenuItems[i].subMenu != nullptr)
|
||||
mMenuItems[i].subMenu->hidePopup();
|
||||
if (mMenuItems[i].mSubMenu != nullptr)
|
||||
mMenuItems[i].mSubMenu->hidePopup();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -498,6 +509,11 @@ DefineEngineMethod(PopupMenu, getItemCount, S32, (), , "()")
|
|||
return object->getItemCount();
|
||||
}
|
||||
|
||||
DefineConsoleMethod(PopupMenu, clearItems, void, (), , "()")
|
||||
{
|
||||
return object->clearItems();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
DefineEngineMethod(PopupMenu, showPopup, void, (const char * canvasName, S32 x, S32 y), ( -1, -1), "(Canvas,[x, y])")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,27 +34,27 @@ class GuiPopupMenuBackgroundCtrl;
|
|||
|
||||
struct MenuItem // an individual item in a pull-down menu
|
||||
{
|
||||
String text; // the text of the menu item
|
||||
U32 id; // a script-assigned identifier
|
||||
char *accelerator; // the keyboard accelerator shortcut for the menu item
|
||||
U32 acceleratorIndex; // index of this accelerator
|
||||
bool enabled; // true if the menu item is selectable
|
||||
bool visible; // true if the menu item is visible
|
||||
S32 bitmapIndex; // index of the bitmap in the bitmap array
|
||||
S32 checkGroup; // the group index of the item visa vi check marks -
|
||||
String mText; // the text of the menu item
|
||||
U32 mID; // a script-assigned identifier
|
||||
char *mAccelerator; // the keyboard accelerator shortcut for the menu item
|
||||
U32 mAcceleratorIndex; // index of this accelerator
|
||||
bool mEnabled; // true if the menu item is selectable
|
||||
bool mVisible; // true if the menu item is visible
|
||||
S32 mBitmapIndex; // index of the bitmap in the bitmap array
|
||||
S32 mCheckGroup; // the group index of the item visa vi check marks -
|
||||
// only one item in the group can be checked.
|
||||
|
||||
bool isSubmenu; // This menu item has a submenu that will be displayed
|
||||
bool mIsSubmenu; // This menu item has a submenu that will be displayed
|
||||
|
||||
bool isChecked;
|
||||
bool mIsChecked;
|
||||
|
||||
bool isSpacer;
|
||||
bool mIsSpacer;
|
||||
|
||||
bool isMenubarEntry;
|
||||
bool mIsMenubarEntry;
|
||||
|
||||
PopupMenu* subMenuParentMenu; // For a submenu, this is the parent menu
|
||||
PopupMenu* subMenu;
|
||||
String cmd;
|
||||
PopupMenu* mSubMenuParentMenu; // For a submenu, this is the parent menu
|
||||
PopupMenu* mSubMenu;
|
||||
String mCMD;
|
||||
};
|
||||
|
||||
// PopupMenu represents a menu.
|
||||
|
|
@ -72,16 +72,16 @@ protected:
|
|||
|
||||
GuiMenuBar* mMenuBarCtrl;
|
||||
|
||||
StringTableEntry barTitle;
|
||||
StringTableEntry mBarTitle;
|
||||
|
||||
RectI bounds;
|
||||
bool visible;
|
||||
RectI mBounds;
|
||||
bool mVisible;
|
||||
|
||||
S32 bitmapIndex; // Index of the bitmap in the bitmap array (-1 = no bitmap)
|
||||
bool drawBitmapOnly; // Draw only the bitmap and not the text
|
||||
bool drawBorder; // Should a border be drawn around this menu (usually if we only have a bitmap, we don't want a border)
|
||||
S32 mBitmapIndex; // Index of the bitmap in the bitmap array (-1 = no bitmap)
|
||||
bool mDrawBitmapOnly; // Draw only the bitmap and not the text
|
||||
bool mDrawBorder; // Should a border be drawn around this menu (usually if we only have a bitmap, we don't want a border)
|
||||
|
||||
bool isSubmenu;
|
||||
bool mIsSubmenu;
|
||||
|
||||
//This is the gui control that renders our popup
|
||||
GuiPopupMenuTextListCtrl *mTextList;
|
||||
|
|
@ -137,6 +137,9 @@ public:
|
|||
/// Returns the number of items in the menu.
|
||||
U32 getItemCount();
|
||||
|
||||
///Clears all items
|
||||
void clearItems();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/// Displays this menu as a popup menu and blocks until the user has selected
|
||||
/// an item.
|
||||
|
|
@ -175,8 +178,8 @@ public:
|
|||
virtual bool onMessageReceived(StringTableEntry queue, const char* event, const char* data );
|
||||
virtual bool onMessageObjectReceived(StringTableEntry queue, Message *msg );
|
||||
|
||||
bool isVisible() { return visible; }
|
||||
void setVisible(bool isVis) { visible = isVis; }
|
||||
bool isVisible() { return mVisible; }
|
||||
void setVisible(bool isVis) { mVisible = isVis; }
|
||||
|
||||
GuiMenuBar* getMenuBarCtrl();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -612,12 +612,12 @@ bool Gizmo::collideAxisGizmo( const Gui3DMouseEvent & event )
|
|||
Point3F(mOrigin + (p1 + p2) * scale)
|
||||
};
|
||||
|
||||
Point3F end = camPos + event.vec * smProjectDistance;
|
||||
F32 t = plane.intersect(camPos, end);
|
||||
Point3F endProj = camPos + event.vec * smProjectDistance;
|
||||
F32 t = plane.intersect(camPos, endProj);
|
||||
if ( t >= 0 && t <= 1 )
|
||||
{
|
||||
Point3F pos;
|
||||
pos.interpolate(camPos, end, t);
|
||||
pos.interpolate(camPos, endProj, t);
|
||||
|
||||
// check if inside our 'poly' of this axisIdx vector...
|
||||
bool inside = true;
|
||||
|
|
|
|||
|
|
@ -1454,16 +1454,16 @@ void WorldEditor::renderSplinePath(SimPath::Path *path)
|
|||
|
||||
}
|
||||
|
||||
CameraSpline::Knot::Path path;
|
||||
CameraSpline::Knot::Path tPath;
|
||||
switch (pathmarker->mSmoothingType)
|
||||
{
|
||||
case Marker::SmoothingTypeLinear: path = CameraSpline::Knot::LINEAR; break;
|
||||
case Marker::SmoothingTypeLinear: tPath = CameraSpline::Knot::LINEAR; break;
|
||||
case Marker::SmoothingTypeSpline:
|
||||
default: path = CameraSpline::Knot::SPLINE; break;
|
||||
default: tPath = CameraSpline::Knot::SPLINE; break;
|
||||
|
||||
}
|
||||
|
||||
spline.push_back(new CameraSpline::Knot(pos, rot, 1.0f, type, path));
|
||||
spline.push_back(new CameraSpline::Knot(pos, rot, 1.0f, type, tPath));
|
||||
}
|
||||
|
||||
F32 t = 0.0f;
|
||||
|
|
@ -1559,8 +1559,8 @@ void WorldEditor::renderSplinePath(SimPath::Path *path)
|
|||
|
||||
// Reset for next pass...
|
||||
vIdx = 0;
|
||||
void *lockPtr = vb.lock();
|
||||
if(!lockPtr) return;
|
||||
void *nextlockPtr = vb.lock();
|
||||
if(!nextlockPtr) return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3036,25 +3036,25 @@ bool WorldEditor::alignByAxis( S32 axis )
|
|||
if(mSelected->size() < 2)
|
||||
return true;
|
||||
|
||||
SceneObject* object = dynamic_cast< SceneObject* >( ( *mSelected )[ 0 ] );
|
||||
if( !object )
|
||||
SceneObject* primaryObj = dynamic_cast< SceneObject* >( ( *mSelected )[ 0 ] );
|
||||
if( !primaryObj)
|
||||
return false;
|
||||
|
||||
submitUndo( mSelected, "Align By Axis" );
|
||||
|
||||
// All objects will be repositioned to line up with the
|
||||
// first selected object
|
||||
Point3F pos = object->getPosition();
|
||||
Point3F pos = primaryObj->getPosition();
|
||||
|
||||
for(S32 i=0; i<mSelected->size(); ++i)
|
||||
{
|
||||
SceneObject* object = dynamic_cast< SceneObject* >( ( *mSelected )[ i ] );
|
||||
if( !object )
|
||||
SceneObject* additionalObj = dynamic_cast< SceneObject* >( ( *mSelected )[ i ] );
|
||||
if( !additionalObj)
|
||||
continue;
|
||||
|
||||
Point3F objPos = object->getPosition();
|
||||
Point3F objPos = additionalObj->getPosition();
|
||||
objPos[axis] = pos[axis];
|
||||
object->setPosition(objPos);
|
||||
additionalObj->setPosition(objPos);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -4073,8 +4073,8 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
|||
|
||||
// Create the object.
|
||||
|
||||
SceneObject* object = dynamic_cast< SceneObject* >( classRep->create() );
|
||||
if( !Object )
|
||||
SceneObject* polyObj = dynamic_cast< SceneObject* >( classRep->create() );
|
||||
if( !polyObj)
|
||||
{
|
||||
Con::errorf( "WorldEditor::createPolyhedralObject - Could not create SceneObject with class '%s'", className );
|
||||
return NULL;
|
||||
|
|
@ -4092,7 +4092,7 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
|||
for( U32 i = 0; i < numPoints; ++ i )
|
||||
{
|
||||
static StringTableEntry sPoint = StringTable->insert( "point" );
|
||||
object->setDataField( sPoint, NULL, EngineMarshallData( points[ i ] ) );
|
||||
polyObj->setDataField( sPoint, NULL, EngineMarshallData( points[ i ] ) );
|
||||
}
|
||||
|
||||
// Add the plane data.
|
||||
|
|
@ -4108,7 +4108,7 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
|||
char buffer[ 1024 ];
|
||||
dSprintf( buffer, sizeof( buffer ), "%g %g %g %g", plane.x, plane.y, plane.z, plane.d );
|
||||
|
||||
object->setDataField( sPlane, NULL, buffer );
|
||||
polyObj->setDataField( sPlane, NULL, buffer );
|
||||
}
|
||||
|
||||
// Add the edge data.
|
||||
|
|
@ -4127,24 +4127,24 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
|||
edge.vertex[ 0 ], edge.vertex[ 1 ]
|
||||
);
|
||||
|
||||
object->setDataField( sEdge, NULL, buffer );
|
||||
polyObj->setDataField( sEdge, NULL, buffer );
|
||||
}
|
||||
|
||||
// Set the transform.
|
||||
|
||||
object->setTransform( savedTransform );
|
||||
object->setScale( savedScale );
|
||||
polyObj->setTransform( savedTransform );
|
||||
polyObj->setScale( savedScale );
|
||||
|
||||
// Register and return the object.
|
||||
|
||||
if( !object->registerObject() )
|
||||
if( !polyObj->registerObject() )
|
||||
{
|
||||
Con::errorf( "WorldEditor::createPolyhedralObject - Failed to register object!" );
|
||||
delete object;
|
||||
delete polyObj;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return object;
|
||||
return polyObj;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue