From 285c4c47f56e71e0b92dd82fa4737d0732b0dd26 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 28 May 2010 16:20:00 -0400 Subject: EXT-7505 FIX stuck in appearance edit mode if close appearance sidebar Added a check for visibility changes that should prevent users from getting "stuck" in appearance editing mode by closing the appearance editor prematurely (clicking sidebar hide, etc). Camera state should be restored when panel is restored. reviewed by Seraph --- indra/newview/llpaneloutfitedit.cpp | 1 + indra/newview/llsidepanelappearance.cpp | 23 +++++++++++++++++++++++ indra/newview/llsidepanelappearance.h | 1 + 3 files changed, 25 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index ae4b288588..9e51aaceca 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -36,6 +36,7 @@ // *TODO: reorder includes to match the coding standard #include "llagent.h" +#include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" #include "llcofwearables.h" diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 3719313c14..b66789448f 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -163,6 +163,8 @@ BOOL LLSidepanelAppearance::postBuild() mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this); gInventory.addObserver(mOutfitRenameWatcher); + setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2)); + return TRUE; } @@ -201,6 +203,27 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) mOpened = true; } +void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) +{ + if (new_visibility.asBoolean()) + { + if ((mOutfitEdit && mOutfitEdit->getVisible()) || (mEditWearable && mEditWearable->getVisible())) + { + if (!gAgentCamera.cameraCustomizeAvatar()) + { + gAgentCamera.changeCameraToCustomizeAvatar(); + } + } + } + else + { + if (gAgentCamera.cameraCustomizeAvatar()) + { + gAgentCamera.changeCameraToDefault(); + } + } +} + void LLSidepanelAppearance::onFilterEdit(const std::string& search_string) { if (mFilterSubString != search_string) diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 5bde962c8d..30022ae375 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -72,6 +72,7 @@ public: private: void onFilterEdit(const std::string& search_string); + void onVisibilityChange ( const LLSD& new_visibility ); void onOpenOutfitButtonClicked(); void onEditAppearanceButtonClicked(); -- cgit v1.2.3