diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagentcamera.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 115 | ||||
-rw-r--r-- | indra/newview/llpaneleditwearable.h | 9 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 14 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 26 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.h | 3 | ||||
-rw-r--r-- | indra/newview/llwearable.cpp | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_wearable.xml | 2 |
14 files changed, 167 insertions, 97 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 9638d0e94f..d9eceec30d 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1538,26 +1538,6 @@ F32 LLAgentCamera::calcCustomizeAvatarUIOffset(const LLVector3d& camera_pos_glob { F32 ui_offset = 0.f; - if (gFloaterCustomize) - { - const LLRect& rect = gFloaterCustomize->getRect(); - - // Move the camera so that the avatar isn't covered up by this floater. - F32 fraction_of_fov = 0.5f - (0.5f * (1.f - llmin(1.f, ((F32)rect.getWidth() / (F32)gViewerWindow->getWindowWidthScaled())))); - F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); // radians - F32 offset = tan(apparent_angle); - - if( rect.mLeft < (gViewerWindow->getWindowWidthScaled() - rect.mRight) ) - { - // Move the avatar to the right (camera to the left) - ui_offset = offset; - } - else - { - // Move the avatar to the left (camera to the right) - ui_offset = -offset; - } - } F32 range = (F32)dist_vec(camera_pos_global, getFocusGlobal()); mUIOffset = lerp(mUIOffset, ui_offset, LLCriticalDamp::getInterpolant(0.05f)); return mUIOffset * range; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 29865e420a..39fcf867b1 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -62,6 +62,7 @@ #include "llpreviewgesture.h" #include "llpreviewtexture.h" #include "llselectmgr.h" +#include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltrans.h" #include "llviewerassettype.h" @@ -4881,15 +4882,9 @@ void LLWearableBridge::editOnAvatar() const LLWearable* wearable = gAgentWearables.getWearableFromItemID(mUUID); if( wearable ) { - // Set the tab to the right wearable. - if (gFloaterCustomize) - gFloaterCustomize->setCurrentWearableType( wearable->getType() ); + LLPanel * panel = LLSideTray::getInstance()->getPanel("sidepanel_appearance"); - if( CAMERA_MODE_CUSTOMIZE_AVATAR != gAgentCamera.getCameraMode() ) - { - // Start Avatar Customization - gAgentCamera.changeCameraToCustomizeAvatar(); - } + LLSidePanelAppearance::editWearable(wearable, panel); } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 8e9b164c09..2ba39fca9c 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -215,7 +215,9 @@ LLEditWearableDictionary::~LLEditWearableDictionary() LLEditWearableDictionary::Wearables::Wearables() { - addEntry(LLWearableType::WT_SHAPE, new WearableEntry(LLWearableType::WT_SHAPE,"edit_shape_title","shape_desc_text",0,0,9, SUBPART_SHAPE_HEAD, SUBPART_SHAPE_EYES, SUBPART_SHAPE_EARS, SUBPART_SHAPE_NOSE, SUBPART_SHAPE_MOUTH, SUBPART_SHAPE_CHIN, SUBPART_SHAPE_TORSO, SUBPART_SHAPE_LEGS, SUBPART_SHAPE_WHOLE)); + // note the subpart that is listed first is treated as "default", regardless of what order is in enum. + // Please match the order presented in XUI. -Nyx + addEntry(LLWearableType::WT_SHAPE, new WearableEntry(LLWearableType::WT_SHAPE,"edit_shape_title","shape_desc_text",0,0,9, SUBPART_SHAPE_WHOLE, SUBPART_SHAPE_HEAD, SUBPART_SHAPE_EYES, SUBPART_SHAPE_EARS, SUBPART_SHAPE_NOSE, SUBPART_SHAPE_MOUTH, SUBPART_SHAPE_CHIN, SUBPART_SHAPE_TORSO, SUBPART_SHAPE_LEGS )); addEntry(LLWearableType::WT_SKIN, new WearableEntry(LLWearableType::WT_SKIN,"edit_skin_title","skin_desc_text",0,3,4, TEX_HEAD_BODYPAINT, TEX_UPPER_BODYPAINT, TEX_LOWER_BODYPAINT, SUBPART_SKIN_COLOR, SUBPART_SKIN_FACEDETAIL, SUBPART_SKIN_MAKEUP, SUBPART_SKIN_BODYDETAIL)); addEntry(LLWearableType::WT_HAIR, new WearableEntry(LLWearableType::WT_HAIR,"edit_hair_title","hair_desc_text",0,1,4, TEX_HAIR, SUBPART_HAIR_COLOR, SUBPART_HAIR_STYLE, SUBPART_HAIR_EYEBROWS, SUBPART_HAIR_FACIAL)); addEntry(LLWearableType::WT_EYES, new WearableEntry(LLWearableType::WT_EYES,"edit_eyes_title","eyes_desc_text",0,1,1, TEX_EYES_IRIS, SUBPART_EYES)); @@ -893,6 +895,70 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) // Update picker controls state for_each_picker_ctrl_entry <LLColorSwatchCtrl> (targetPanel, type, boost::bind(set_enabled_color_swatch_ctrl, show, _1, _2)); for_each_picker_ctrl_entry <LLTextureCtrl> (targetPanel, type, boost::bind(set_enabled_texture_ctrl, show, _1, _2)); + + showDefaultSubpart(); +} + +void LLPanelEditWearable::showDefaultSubpart() +{ + changeCamera(0); +} + +void LLPanelEditWearable::onTabExpandedCollapsed(const LLSD& param, U8 index) +{ + bool expanded = param.asBoolean(); + + if (!mWearablePtr || !gAgentCamera.cameraCustomizeAvatar()) + { + // we don't have a valid wearable we're editing, or we've left the wearable editor + return; + } + + if (expanded) + { + changeCamera(index); + } + +} + +void LLPanelEditWearable::changeCamera(U8 subpart) +{ + const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType()); + if (!wearable_entry) + { + llinfos << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << llendl; + return; + } + + if (subpart >= wearable_entry->mSubparts.size()) + { + llinfos << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << subpart << llendl; + return; + } + + ESubpart subpart_e = wearable_entry->mSubparts[subpart]; + const LLEditWearableDictionary::SubpartEntry *subpart_entry = LLEditWearableDictionary::getInstance()->getSubpart(subpart_e); + + if (!subpart_entry) + { + llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl; + return; + } + + // Update the camera + gMorphView->setCameraDistToDefault(); + gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) ); + gMorphView->setCameraTargetOffset( subpart_entry->mTargetOffset ); + gMorphView->setCameraOffset( subpart_entry->mCameraOffset ); + if (gSavedSettings.getBOOL("AppearanceCameraMovement")) + { + gMorphView->updateCamera(); + } +} + +void LLPanelEditWearable::updateScrollingPanelList() +{ + updateScrollingPanelUI(); } void LLPanelEditWearable::initializePanel() @@ -969,6 +1035,7 @@ void LLPanelEditWearable::initializePanel() for_each_picker_ctrl_entry <LLColorSwatchCtrl> (getPanel(type), type, boost::bind(init_color_swatch_ctrl, this, _1, _2)); for_each_picker_ctrl_entry <LLTextureCtrl> (getPanel(type), type, boost::bind(init_texture_ctrl, this, _1, _2)); + showDefaultSubpart(); updateVerbs(); } @@ -994,52 +1061,6 @@ void LLPanelEditWearable::updateTypeSpecificControls(LLWearableType::EType type) } } -void LLPanelEditWearable::onTabExpandedCollapsed(const LLSD& param, U8 index) -{ - bool expanded = param.asBoolean(); - - if (!mWearablePtr || !gAgentCamera.cameraCustomizeAvatar()) - { - // we don't have a valid wearable we're editing, or we've left the wearable editor - return; - } - - if (expanded) - { - const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType()); - if (!wearable_entry) - { - llinfos << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << llendl; - return; - } - - if (index >= wearable_entry->mSubparts.size()) - { - llinfos << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << index << llendl; - return; - } - - ESubpart subpart_e = wearable_entry->mSubparts[index]; - const LLEditWearableDictionary::SubpartEntry *subpart_entry = LLEditWearableDictionary::getInstance()->getSubpart(subpart_e); - - if (!subpart_entry) - { - llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl; - return; - } - - // Update the camera - gMorphView->setCameraTargetJoint( gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ) ); - gMorphView->setCameraTargetOffset( subpart_entry->mTargetOffset ); - gMorphView->setCameraOffset( subpart_entry->mCameraOffset ); - gMorphView->setCameraDistToDefault(); - if (gSavedSettings.getBOOL("AppearanceCameraMovement")) - { - gMorphView->updateCamera(); - } - } -} - void LLPanelEditWearable::updateScrollingPanelUI() { // do nothing if we don't have a valid wearable we're editing diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 6f9ac82407..0af3758a4e 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -63,10 +63,14 @@ public: void saveChanges(); void revertChanges(); + void showDefaultSubpart(); + void onTabExpandedCollapsed(const LLSD& param, U8 index); + + void updateScrollingPanelList(); + static void onRevertButtonClicked(void* userdata); void onCommitSexChange(); - void onTabExpandedCollapsed(const LLSD& param, U8 index); private: typedef std::map<F32, LLViewerVisualParam*> value_map_t; @@ -86,6 +90,9 @@ private: void toggleTypeSpecificControls(LLWearableType::EType type); void updateTypeSpecificControls(LLWearableType::EType type); + // changes camera angle to default for selected subpart + void changeCamera(U8 subpart); + // the pointer to the wearable we're editing. NULL means we're not editing a wearable. LLWearable *mWearablePtr; LLViewerInventoryItem* mWearableItem; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 010d593b27..6f934a0b66 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -465,3 +465,19 @@ void LLSidepanelAppearance::setWearablesLoading(bool val) childSetVisible("wearables_loading_indicator", val); childSetVisible("edit_outfit_btn", !val); } + +void LLSidepanelAppearance::showDefaultSubpart() +{ + if (mEditWearable->getVisible()) + { + mEditWearable->showDefaultSubpart(); + } +} + +void LLSidepanelAppearance::updateScrollingPanelList() +{ + if (mEditWearable->getVisible()) + { + mEditWearable->updateScrollingPanelList(); + } +} diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 12303b6e96..5bde962c8d 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -67,6 +67,8 @@ public: void showOutfitEditPanel(); void showWearableEditPanel(LLWearable *wearable = NULL); void setWearablesLoading(bool val); + void showDefaultSubpart(); + void updateScrollingPanelList(); private: void onFilterEdit(const std::string& search_string); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f0532d5a31..838f57073e 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -883,9 +883,10 @@ void ModifiedCOFCallback::fire(const LLUUID& inv_item) if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode() ) { // If we're in appearance editing mode, the current tab may need to be refreshed - if (gFloaterCustomize) + LLSidepanelAppearance *panel = dynamic_cast<LLSidePanelAppearance*>(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + if (panel) { - gFloaterCustomize->switchToDefaultSubpart(); + panel->showDefaultSubpart(); } } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e0463e3c4a..f72f122f8a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4545,7 +4545,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message) gResizeScreenTexture = TRUE; - if (gFloaterCustomize && gFloaterCustomize->getVisible()) + if (gAgentCamera.cameraCustomizeAvatar()) { LLVisualParamHint::requestHintUpdates(); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4371396629..76aa2ae0f1 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7887,3 +7887,26 @@ BOOL LLVOAvatar::isTextureDefined(LLVOAvatarDefines::ETextureIndex te, U32 index getImage(te, index)->getID() != IMG_DEFAULT); } +//virtual +BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const +{ + if (isIndexLocalTexture(type)) + { + return isTextureDefined(type, index); + } + else + { + // baked textures can use TE images directly + return ((isTextureDefined(type) || isSelf()) + && (getTEImage(type)->getID() != IMG_INVISIBLE + || LLDrawPoolAlpha::sShowDebugAlpha)); + } +} + +//virtual +BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const +{ + // non-self avatars don't have wearables + return FALSE; +} + diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 86a7cdae02..df47e9ba1d 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -462,7 +462,9 @@ public: //-------------------------------------------------------------------- public: virtual BOOL isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; - BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex index) const; + virtual BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + virtual BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const; + protected: BOOL isFullyBaked(); static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); @@ -1039,14 +1041,4 @@ protected: // Shared with LLVOAvatarSelf }; // LLVOAvatar -//------------------------------------------------------------------------ -// Inlines -//------------------------------------------------------------------------ -inline BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex te) const -{ - return ((isTextureDefined(te) || isSelf()) - && (getTEImage(te)->getID() != IMG_INVISIBLE - || LLDrawPoolAlpha::sShowDebugAlpha)); -} - #endif // LL_VO_AVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index cf3fb01b5a..ebca12dee8 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1332,6 +1332,32 @@ BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 return isDefined; } +//virtual +BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const +{ + if (isIndexBakedTexture(type)) + { + return LLVOAvatar::isTextureVisible(type,0); + } + + LLUUID tex_id = getLocalTextureID(type,index); + return (tex_id != IMG_INVISIBLE) + || (LLDrawPoolAlpha::sShowDebugAlpha); +} + +//virtual +BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const +{ + if (isIndexBakedTexture(type)) + { + return isTextureVisible(type); + } + + U32 index = gAgentWearables.getWearableIndex(wearable); + return isTextureVisible(type,index); +} + + //----------------------------------------------------------------------------- // requestLayerSetUploads() //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 8e6d9698f2..189c1ac808 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -179,6 +179,9 @@ public: BOOL isLocalTextureDataFinal(const LLTexLayerSet* layerset) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index /*virtual*/ BOOL isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index) const; + /*virtual*/ BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + /*virtual*/ BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const; + //-------------------------------------------------------------------- // Local Textures diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 10b9a18fa8..358defbb31 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -705,9 +705,9 @@ void LLWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload_bake } } - if( gFloaterCustomize ) + if( gAgentCamera.cameraCustomizeAvatar() ) { - gFloaterCustomize->setWearable(type, NULL, PERM_ALL, TRUE); + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); } gAgentAvatarp->updateVisualParams(); @@ -976,9 +976,11 @@ void LLWearable::revertValues() syncImages(mSavedTEMap, mTEMap); - if( gFloaterCustomize ) + + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + if( panel ) { - gFloaterCustomize->updateScrollingPanelList(TRUE); + panel->updateScrollingPanelList(); } } @@ -1015,9 +1017,11 @@ void LLWearable::saveValues() // Deep copy of mTEMap (copies only those tes that are current, filling in defaults where needed) syncImages(mTEMap, mSavedTEMap); - if( gFloaterCustomize ) + + LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + if( panel ) { - gFloaterCustomize->updateScrollingPanelList(TRUE); + panel->updateScrollingPanelList(); } } diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index 71f740590b..0455086ef3 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -107,7 +107,7 @@ left="0" Jacket: </string> <string - name="skirt_skirt_desc_text"> + name="skirt_desc_text"> Skirt: </string> <string |