diff options
Diffstat (limited to 'indra/newview/llsidepanelappearance.cpp')
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 363fe5f12b..16729f045a 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -193,18 +193,28 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) { if (new_visibility["visible"].asBoolean()) { - bool is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); - bool is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); + const BOOL is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); + const BOOL is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); if (is_outfit_edit_visible || is_wearable_edit_visible) { - if (!gAgentCamera.cameraCustomizeAvatar() && gSavedSettings.getBOOL("AppearanceCameraMovement")) + const LLWearable *wearable_ptr = mEditWearable->getWearable(); + if (!wearable_ptr) + { + llwarns << "Visibility change to invalid wearable" << llendl; + return; + } + // Disable camera switch is currently just for WT_PHYSICS type since we don't want to freeze the avatar + // when editing its physics. + const BOOL disable_camera_motion = LLWearableType::getDisableCameraSwitch(wearable_ptr->getType()); + if (!gAgentCamera.cameraCustomizeAvatar() && + !disable_camera_motion && + gSavedSettings.getBOOL("AppearanceCameraMovement")) { gAgentCamera.changeCameraToCustomizeAvatar(); } if (is_wearable_edit_visible) { - LLWearable *wearable_ptr = mEditWearable->getWearable(); if (gAgentWearables.getWearableIndex(wearable_ptr) == LLAgentWearables::MAX_CLOTHING_PER_TYPE) { // we're no longer wearing the wearable we were last editing, switch back to outfit editor @@ -289,7 +299,7 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel() { toggleWearableEditPanel(FALSE); toggleOutfitEditPanel(FALSE); - togglMyOutfitsPanel(TRUE); + toggleMyOutfitsPanel(TRUE); } void LLSidepanelAppearance::showOutfitEditPanel() @@ -305,19 +315,28 @@ void LLSidepanelAppearance::showOutfitEditPanel() mOutfitEdit->resetAccordionState(); } - togglMyOutfitsPanel(FALSE); + // If we're exiting the edit wearable view, and the camera was not focused on the avatar + // (e.g. such as if we were editing a physics param), then skip the outfits edit mode since + // otherwise this would trigger the camera focus mode. + if (mEditWearable != NULL && mEditWearable->getVisible() && !gAgentCamera.cameraCustomizeAvatar()) + { + showOutfitsInventoryPanel(); + return; + } + + toggleMyOutfitsPanel(FALSE); toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode toggleOutfitEditPanel(TRUE); } -void LLSidepanelAppearance::showWearableEditPanel(LLWearable *wearable /* = NULL*/) +void LLSidepanelAppearance::showWearableEditPanel(LLWearable *wearable /* = NULL*/, BOOL disable_camera_switch) { - togglMyOutfitsPanel(FALSE); + toggleMyOutfitsPanel(FALSE); toggleOutfitEditPanel(FALSE, TRUE); // don't switch out of edit appearance mode - toggleWearableEditPanel(TRUE, wearable); + toggleWearableEditPanel(TRUE, wearable, disable_camera_switch); } -void LLSidepanelAppearance::togglMyOutfitsPanel(BOOL visible) +void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible) { if (!mPanelOutfitsInventory || mPanelOutfitsInventory->getVisible() == visible) { @@ -390,7 +409,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we { gAgentCamera.changeCameraToCustomizeAvatar(); } - mEditWearable->setWearable(wearable); + mEditWearable->setWearable(wearable, disable_camera_switch); mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency } else @@ -434,14 +453,14 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) } //static -void LLSidepanelAppearance::editWearable(LLWearable *wearable, LLView *data) +void LLSidepanelAppearance::editWearable(LLWearable *wearable, LLView *data, BOOL disable_camera_switch) { LLSideTray::getInstance()->showPanel("sidepanel_appearance"); LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data); if (panel) { - panel->showWearableEditPanel(wearable); + panel->showWearableEditPanel(wearable, disable_camera_switch); } } |