Skip to content
Snippets Groups Projects
Commit b3493dca authored by andreykproductengine's avatar andreykproductengine
Browse files

MAINT-6951 Fixed Appearance panel causing camera movement regardless of circumstance.

parent 52553473
No related branches found
No related tags found
No related merge requests found
......@@ -383,12 +383,22 @@ void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_cam
void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearable *wearable, BOOL disable_camera_switch)
{
if (!mEditWearable || ((mEditWearable->getWearable() == wearable) && mEditWearable->getVisible() == visible))
if (!mEditWearable)
{
// visibility isn't changing, hence nothing to do
return;
}
if (mEditWearable->getVisible() == visible && (!visible || mEditWearable->getWearable() != wearable))
{
// visibility isn't changing and panel doesn't need an update, hence nothing to do
return;
}
// If we're just switching between outfit and wearable editing or updating item,
// don't end customization and don't switch camera
// Don't end customization and don't switch camera without visibility change
BOOL change_state = !disable_camera_switch && mEditWearable->getVisible() != visible;
if (!wearable)
{
wearable = gAgentWearables.getViewerWearable(LLWearableType::WT_SHAPE, 0);
......@@ -403,8 +413,8 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearab
if (visible)
{
LLVOAvatarSelf::onCustomizeStart(disable_camera_switch);
mEditWearable->setWearable(wearable, disable_camera_switch);
LLVOAvatarSelf::onCustomizeStart(!change_state);
mEditWearable->setWearable(wearable, !change_state);
mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency
}
else
......@@ -412,9 +422,9 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearab
// Save changes if closing.
mEditWearable->saveChanges();
LLAppearanceMgr::getInstance()->updateIsDirty();
if (!disable_camera_switch) // if we're just switching between outfit and wearable editing, don't end customization.
if (change_state)
{
LLVOAvatarSelf::onCustomizeEnd(disable_camera_switch);
LLVOAvatarSelf::onCustomizeEnd(!change_state);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment