mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
Merge pull request #1545 from Areloch/GuiEditorSelectionListFix
Fixes issues with shifting the gui selection dropdown to be searchable via the Ex control.
This commit is contained in:
commit
ac9400a1ec
3 changed files with 30 additions and 12 deletions
|
|
@ -1317,21 +1317,35 @@ void GuiPopUpMenuCtrlEx::closePopUp()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get the selection from the text list:
|
// Get the selection from the text list:
|
||||||
mSelIndex = mTl->getSelectedCell().y;
|
if (mSearchText.isEmpty())
|
||||||
|
{
|
||||||
|
mSelIndex = mTl->getSelectedCell().y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
S32 filteredEntryCount = 0;
|
||||||
|
for (U32 i=0; i < mEntries.size(); i++)
|
||||||
|
{
|
||||||
|
String entryText = String::ToLower(mEntries[i].buf);
|
||||||
|
if (entryText.find(mSearchText) != -1 && mEntries[i].id != -2)
|
||||||
|
{
|
||||||
|
if (filteredEntryCount == mTl->getSelectedCell().y)
|
||||||
|
{
|
||||||
|
mSelIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
filteredEntryCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
mSelIndex = ( mRevNum >= mSelIndex && mSelIndex != -1 ) ? mRevNum - mSelIndex : mSelIndex;
|
mSelIndex = ( mRevNum >= mSelIndex && mSelIndex != -1 ) ? mRevNum - mSelIndex : mSelIndex;
|
||||||
if ( mSelIndex != -1 )
|
if ( mSelIndex != -1 )
|
||||||
{
|
{
|
||||||
if (mReplaceText)
|
if (mReplaceText)
|
||||||
setText(mEntries[mSelIndex].buf);
|
setText(mEntries[mSelIndex].buf);
|
||||||
|
|
||||||
for(U32 i=0; i < mEntries.size(); i++)
|
setIntVariable(mEntries[mSelIndex].id);
|
||||||
{
|
|
||||||
if(dStrcmp(mEntries[i].buf,mTl->mList[mSelIndex].text) == 0)
|
|
||||||
{
|
|
||||||
setIntVariable(mEntries[i].id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release the mouse:
|
// Release the mouse:
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,7 @@ $guiContent = new GuiControl(GuiEditorGui, EditorGuiGroup) {
|
||||||
horizSizing = "right";
|
horizSizing = "right";
|
||||||
vertSizing = "center";
|
vertSizing = "center";
|
||||||
position = "8 0";
|
position = "8 0";
|
||||||
extent = "300 27";
|
extent = "300 20";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,11 @@ function GuiEditorContentList::scanGroup( %this, %group )
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function GuiEditorContentList::onSelect( %this, %ctrl )
|
function GuiEditorContentList::onSelect( %this, %index, %text )
|
||||||
{
|
{
|
||||||
GuiEditor.openForEditing( %ctrl );
|
//Strip out just the guiControl id
|
||||||
|
%ctrlId = getToken(%text, "-", 1);
|
||||||
|
%ctrlId = trim(%ctrlId);
|
||||||
|
|
||||||
|
GuiEditor.openForEditing( %ctrlId );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue