From 39d65cc1c44496889e4d41956e6576012aba6624 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sun, 18 Aug 2024 16:16:37 -0400 Subject: Fix trying to find the outfit edit panel in non-appearance-panel instances of LLFloaterSidePanelContainer --- indra/newview/llfloatersidepanelcontainer.cpp | 35 ++++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 9e577c83a8..7bc95c2884 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -66,24 +66,26 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) { - LLPanelOutfitEdit* panel_outfit_edit = - dynamic_cast(LLFloaterSidePanelContainer::findPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit) + if(getInstanceName() == "appearance") { - LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); - if (parent == this ) + LLPanelOutfitEdit* panel_outfit_edit = findChild("panel_outfit_edit"); + if (panel_outfit_edit) { - LLSidepanelAppearance* panel_appearance = dynamic_cast(getPanel("appearance")); - if (panel_appearance) + LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); + if (parent == this) { - LLPanelEditWearable *edit_wearable_ptr = panel_appearance->getWearable(); - if (edit_wearable_ptr) - { - edit_wearable_ptr->onClose(); - } - if (!app_quitting) + LLSidepanelAppearance* panel_appearance = dynamic_cast(mMainPanel); + if (panel_appearance) { - panel_appearance->showOutfitsInventoryPanel(); + LLPanelEditWearable *edit_wearable_ptr = panel_appearance->getWearable(); + if (edit_wearable_ptr) + { + edit_wearable_ptr->onClose(); + } + if(!app_quitting) + { + panel_appearance->showOutfitsInventoryPanel(); + } } } } @@ -99,10 +101,9 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) void LLFloaterSidePanelContainer::onClickCloseBtn(bool app_quitting) { - if (!app_quitting) + if (!app_quitting && getInstanceName() == "appearance") { - LLPanelOutfitEdit* panel_outfit_edit = - dynamic_cast(LLFloaterSidePanelContainer::findPanel("appearance", "panel_outfit_edit")); + LLPanelOutfitEdit* panel_outfit_edit = findChild("panel_outfit_edit"); if (panel_outfit_edit) { LLFloater* parent = gFloaterView->getParentFloater(panel_outfit_edit); -- cgit v1.2.3