mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Adds ability to utilize bitmap arrays and set entry indexes for popup menus
Also enables the ability to fetch the text of a popup menu item
This commit is contained in:
parent
67dbe4dfe2
commit
a5404ad216
2 changed files with 26 additions and 7 deletions
|
|
@ -125,11 +125,13 @@ void GuiPopupMenuTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool s
|
|||
if (idx != 1)
|
||||
{
|
||||
// there's a bitmap...
|
||||
U32 index = U32(idx - 2) * 3;
|
||||
U32 index = U32(idx - 2) * 4;
|
||||
if (!mList[cell.y].active)
|
||||
index += 2;
|
||||
else if (selected || mouseOver)
|
||||
index += 3;
|
||||
else if (selected)
|
||||
index++;
|
||||
else if (mouseOver)
|
||||
index += 2;
|
||||
|
||||
if (mProfile->mBitmapArrayRects.size() > index)
|
||||
{
|
||||
|
|
@ -137,8 +139,10 @@ void GuiPopupMenuTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool s
|
|||
Point2I off = maxBitmapSize - rect.extent;
|
||||
off /= 2;
|
||||
|
||||
Point2I bitPos = Point2I(offset.x + mCellSize.y / 2, offset.y + mCellSize.y / 2);
|
||||
|
||||
GFX->getDrawUtil()->clearBitmapModulation();
|
||||
GFX->getDrawUtil()->drawBitmapSR(mProfile->mTextureObject, offset + off, rect);
|
||||
GFX->getDrawUtil()->drawBitmapSR(mProfile->mTextureObject, bitPos + off, rect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue