Skip to content
Snippets Groups Projects
Commit 5e110169 authored by Loren Shih's avatar Loren Shih
Browse files

Fixed an issue where you go into appearance pose when editing physics if you...

Fixed an issue where you go into appearance pose when editing physics if you were formerly in edit outfit.
Miscellaneous code cleanup.
parent d52913bd
No related branches found
No related tags found
No related merge requests found
...@@ -821,7 +821,7 @@ void LLAgentWearables::popWearable(const LLWearableType::EType type, U32 index) ...@@ -821,7 +821,7 @@ void LLAgentWearables::popWearable(const LLWearableType::EType type, U32 index)
} }
} }
U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) U32 LLAgentWearables::getWearableIndex(const LLWearable *wearable) const
{ {
if (wearable == NULL) if (wearable == NULL)
{ {
......
...@@ -124,7 +124,7 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables> ...@@ -124,7 +124,7 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>
void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove); void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove);
void setWearableName(const LLUUID& item_id, const std::string& new_name); void setWearableName(const LLUUID& item_id, const std::string& new_name);
void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index); void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index);
U32 getWearableIndex(LLWearable *wearable); U32 getWearableIndex(const LLWearable *wearable) const;
protected: protected:
void setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append = false); void setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append = false);
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
#include "llbreastmotion.h" #include "llbreastmotion.h"
#include "llcharacter.h" #include "llcharacter.h"
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "llviewervisualparam.H" #include "llviewervisualparam.h"
#include "llvoavatarself.h"
// #define OUTPUT_BREAST_DATA // #define OUTPUT_BREAST_DATA
......
...@@ -185,18 +185,26 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) ...@@ -185,18 +185,26 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
{ {
if (new_visibility.asBoolean()) if (new_visibility.asBoolean())
{ {
bool is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); const BOOL is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible();
bool is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); const BOOL is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible();
if (is_outfit_edit_visible || is_wearable_edit_visible) 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;
}
const BOOL disable_camera_motion = LLWearableType::getDisableCameraSwitch(wearable_ptr->getType());
if (!gAgentCamera.cameraCustomizeAvatar() &&
!disable_camera_motion &&
gSavedSettings.getBOOL("AppearanceCameraMovement"))
{ {
gAgentCamera.changeCameraToCustomizeAvatar(); gAgentCamera.changeCameraToCustomizeAvatar();
} }
if (is_wearable_edit_visible) if (is_wearable_edit_visible)
{ {
LLWearable *wearable_ptr = mEditWearable->getWearable();
if (gAgentWearables.getWearableIndex(wearable_ptr) == LLAgentWearables::MAX_CLOTHING_PER_TYPE) 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 // we're no longer wearing the wearable we were last editing, switch back to outfit editor
...@@ -380,7 +388,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we ...@@ -380,7 +388,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *we
{ {
gAgentCamera.changeCameraToCustomizeAvatar(); gAgentCamera.changeCameraToCustomizeAvatar();
} }
mEditWearable->setWearable(wearable); mEditWearable->setWearable(wearable, disable_camera_switch);
mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency mEditWearable->onOpen(LLSD()); // currently no-op, just for consistency
} }
else else
......
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