diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterdebugmaterials.cpp | 53 | ||||
-rw-r--r-- | indra/newview/llfloaterdebugmaterials.h | 1 |
2 files changed, 51 insertions, 3 deletions
diff --git a/indra/newview/llfloaterdebugmaterials.cpp b/indra/newview/llfloaterdebugmaterials.cpp index da1068d879..cab2ab6372 100644 --- a/indra/newview/llfloaterdebugmaterials.cpp +++ b/indra/newview/llfloaterdebugmaterials.cpp @@ -123,12 +123,15 @@ BOOL LLFloaterDebugMaterials::postBuild() mGetNormalMapScrollList = findChild<LLScrollListCtrl>("get_normal_map_scroll_list"); llassert(mGetNormalMapScrollList != NULL); + mGetNormalMapScrollList->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onGetScrollListSelectionChange, this, _1)); mGetSpecularMapScrollList = findChild<LLScrollListCtrl>("get_specular_map_scroll_list"); llassert(mGetSpecularMapScrollList != NULL); + mGetSpecularMapScrollList->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onGetScrollListSelectionChange, this, _1)); mGetOtherDataScrollList = findChild<LLScrollListCtrl>("get_other_data_scroll_list"); llassert(mGetOtherDataScrollList != NULL); + mGetOtherDataScrollList->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onGetScrollListSelectionChange, this, _1)); mNormalMap = findChild<LLTextureCtrl>("normal_map"); llassert(mNormalMap != NULL); @@ -425,6 +428,50 @@ void LLFloaterDebugMaterials::onInWorldSelectionChange() updateControls(); } +void LLFloaterDebugMaterials::onGetScrollListSelectionChange(LLUICtrl* pUICtrl) +{ + LLScrollListCtrl* scrollListCtrl = dynamic_cast<LLScrollListCtrl*>(pUICtrl); + llassert(scrollListCtrl != NULL); + + if (scrollListCtrl != mGetNormalMapScrollList) + { + mGetNormalMapScrollList->deselectAllItems(TRUE); + } + if (scrollListCtrl != mGetSpecularMapScrollList) + { + mGetSpecularMapScrollList->deselectAllItems(TRUE); + } + if (scrollListCtrl != mGetOtherDataScrollList) + { + mGetOtherDataScrollList->deselectAllItems(TRUE); + } + + std::vector<LLScrollListItem*> selectedItems = scrollListCtrl->getAllSelected(); + if (!selectedItems.empty()) + { + llassert(selectedItems.size() == 1); + LLScrollListItem* selectedItem = selectedItems.front(); + + llassert(selectedItem != NULL); + const LLSD& selectedIdValue = selectedItem->getValue(); + + llinfos << "attempting to select by value '" << selectedIdValue << "'" << llendl; + + if (scrollListCtrl != mGetNormalMapScrollList) + { + mGetNormalMapScrollList->selectByValue(selectedIdValue); + } + if (scrollListCtrl != mGetSpecularMapScrollList) + { + mGetSpecularMapScrollList->selectByValue(selectedIdValue); + } + if (scrollListCtrl != mGetOtherDataScrollList) + { + mGetOtherDataScrollList->selectByValue(selectedIdValue); + } + } +} + void LLFloaterDebugMaterials::onDeferredCheckRegionMaterialStatus(LLUUID regionId) { checkRegionMaterialStatus(regionId); @@ -997,9 +1044,9 @@ void LLFloaterDebugMaterials::parseGetResponse(const LLSD& pContent) cellParams.value = llformat("%d", diffuseAlphaMode); otherDataRowParams.columns.add(cellParams); - normalMapRowParams.value = materialID; - specularMapRowParams.value = materialID; - otherDataRowParams.value = materialID; + normalMapRowParams.value = materialIDString; + specularMapRowParams.value = materialIDString; + otherDataRowParams.value = materialIDString; mGetNormalMapScrollList->addRow(normalMapRowParams); mGetSpecularMapScrollList->addRow(specularMapRowParams); diff --git a/indra/newview/llfloaterdebugmaterials.h b/indra/newview/llfloaterdebugmaterials.h index 732b6a9349..65f3cbd6ca 100644 --- a/indra/newview/llfloaterdebugmaterials.h +++ b/indra/newview/llfloaterdebugmaterials.h @@ -81,6 +81,7 @@ private: void onBadPostClicked(); void onRegionCross(); void onInWorldSelectionChange(); + void onGetScrollListSelectionChange(LLUICtrl* pUICtrl); void onDeferredCheckRegionMaterialStatus(LLUUID regionId); void onDeferredRequestGetMaterials(LLUUID regionId); void onDeferredRequestPutMaterials(LLUUID regionId, bool pIsDoSet); |