summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelappearance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsidepanelappearance.cpp')
-rw-r--r--indra/newview/llsidepanelappearance.cpp46
1 files changed, 33 insertions, 13 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 363fe5f12b..28ec11d1c7 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -32,6 +32,7 @@
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llappearancemgr.h"
+#include "llfolderview.h"
#include "llinventorypanel.h"
#include "llfiltereditor.h"
#include "llfloaterreg.h"
@@ -193,18 +194,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 +300,7 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel()
{
toggleWearableEditPanel(FALSE);
toggleOutfitEditPanel(FALSE);
- togglMyOutfitsPanel(TRUE);
+ toggleMyOutfitsPanel(TRUE);
}
void LLSidepanelAppearance::showOutfitEditPanel()
@@ -305,19 +316,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 +410,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 +454,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);
}
}