Fixed an issue where you go into appearance pose when editing physics if you were formerly in edit outfit.

Miscellaneous code cleanup.
meow-7.2.2
Loren Shih 2010-08-25 17:51:01 -04:00
parent d52913bdbf
commit 5e11016970
4 changed files with 17 additions and 8 deletions

View File

@ -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)
{

View File

@ -124,7 +124,7 @@ public:
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 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:
void setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append = false);

View File

@ -42,7 +42,8 @@
#include "llbreastmotion.h"
#include "llcharacter.h"
#include "llviewercontrol.h"
#include "llviewervisualparam.H"
#include "llviewervisualparam.h"
#include "llvoavatarself.h"
// #define OUTPUT_BREAST_DATA

View File

@ -185,18 +185,26 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
{
if (new_visibility.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;
}
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
@ -380,7 +388,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