diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-11-20 17:38:20 +0200 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-11-20 17:38:20 +0200 |
commit | e98a6b0b4592e88217fcdff7df743688ef692818 (patch) | |
tree | a1ad3c03710da63c8d5587ac074fa64ef0d27e86 /indra/newview | |
parent | fb17b94f0fb035deffd8dc9999a04cb764e295c3 (diff) |
SL-14370 Don't build Appearance floater if it's not needed
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerwearable.cpp | 4 |
3 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 64ddeff1b0..dd7ce40e97 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -60,7 +60,7 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) { LLPanelOutfitEdit* panel_outfit_edit = - dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); + dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::findPanel("appearance", "panel_outfit_edit")); if (panel_outfit_edit) { LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); @@ -145,3 +145,15 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, return NULL; } + +LLPanel* LLFloaterSidePanelContainer::findPanel(const std::string& floater_name, const std::string& panel_name) +{ + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::findTypedInstance<LLFloaterSidePanelContainer>(floater_name); + + if (floaterp) + { + return floaterp->findChild<LLPanel>(panel_name, true); + } + + return NULL; +} diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 635514e26c..20baf28184 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -62,6 +62,8 @@ public: static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); static LLPanel* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName); + + static LLPanel* findPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName); /** * Gets the panel of given type T (doesn't show it or do anything else with it). diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 232b7c384d..839e7c5524 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -464,7 +464,7 @@ void LLViewerWearable::revertValues() LLWearable::revertValues(); - LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::getPanel("appearance")); + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::findPanel("appearance")); if( panel ) { panel->updateScrollingPanelList(); @@ -480,7 +480,7 @@ void LLViewerWearable::saveValues() { LLWearable::saveValues(); - LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::getPanel("appearance")); + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::findPanel("appearance")); if( panel ) { panel->updateScrollingPanelList(); |