diff options
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r-- | indra/newview/llcofwearables.cpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 86d9121213..893400185c 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -284,6 +284,7 @@ LLCOFWearables::LLCOFWearables() : LLPanel(), mAttachmentsTab(NULL), mBodyPartsTab(NULL), mLastSelectedTab(NULL), + mAccordionCtrl(NULL), mCOFVersion(-1) { mClothingMenu = new CofClothingContextMenu(this); @@ -336,6 +337,8 @@ BOOL LLCOFWearables::postBuild() mTab2AssetType[mAttachmentsTab] = LLAssetType::AT_OBJECT; mTab2AssetType[mBodyPartsTab] = LLAssetType::AT_BODYPART; + mAccordionCtrl = getChild<LLAccordionCtrl>("cof_wearables_accordion"); + return LLPanel::postBuild(); } @@ -651,18 +654,35 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() typedef std::map<std::string, LLAssetType::EType> type_map_t; static type_map_t type_map; - static LLAccordionCtrl* accordion_ctrl = getChild<LLAccordionCtrl>("cof_wearables_accordion"); - const LLAccordionCtrlTab* expanded_tab = accordion_ctrl->getExpandedTab(); - return get_if_there(mTab2AssetType, expanded_tab, LLAssetType::AT_NONE); + if (mAccordionCtrl != NULL) + { + const LLAccordionCtrlTab* expanded_tab = mAccordionCtrl->getExpandedTab(); + + return get_if_there(mTab2AssetType, expanded_tab, LLAssetType::AT_NONE); } + return LLAssetType::AT_NONE; +} + LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() +{ + if (mAccordionCtrl != NULL) { - static LLAccordionCtrl* accordion_ctrl = getChild<LLAccordionCtrl>("cof_wearables_accordion"); - const LLAccordionCtrlTab* selected_tab = accordion_ctrl->getSelectedTab(); + const LLAccordionCtrlTab* selected_tab = mAccordionCtrl->getSelectedTab(); - return get_if_there(mTab2AssetType, selected_tab, LLAssetType::AT_NONE); + return get_if_there(mTab2AssetType, selected_tab, LLAssetType::AT_NONE); + } + + return LLAssetType::AT_NONE; +} + +void LLCOFWearables::expandDefaultAccordionTab() +{ + if (mAccordionCtrl != NULL) + { + mAccordionCtrl->expandDefaultTab(); + } } void LLCOFWearables::onListRightClick(LLUICtrl* ctrl, S32 x, S32 y, LLListContextMenu* menu) |