diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-05-28 16:20:00 -0400 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-05-28 16:20:00 -0400 |
commit | 285c4c47f56e71e0b92dd82fa4737d0732b0dd26 (patch) | |
tree | eeb821fea0fa8e8d647eaeb403cfe268227e4f4d /indra/newview | |
parent | a5c9e30fc806cc8cf291b7da0fd4133ca8241fed (diff) |
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
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.h | 1 |
3 files changed, 25 insertions, 0 deletions
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(); |