diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloatercustomize.cpp | 278 |
1 files changed, 243 insertions, 35 deletions
diff --git a/linden/indra/newview/llfloatercustomize.cpp b/linden/indra/newview/llfloatercustomize.cpp index 4761491..74b58bd 100644 --- a/linden/indra/newview/llfloatercustomize.cpp +++ b/linden/indra/newview/llfloatercustomize.cpp | |||
@@ -355,7 +355,9 @@ enum ESubpart { | |||
355 | SUBPART_GLOVES, | 355 | SUBPART_GLOVES, |
356 | SUBPART_UNDERSHIRT, | 356 | SUBPART_UNDERSHIRT, |
357 | SUBPART_UNDERPANTS, | 357 | SUBPART_UNDERPANTS, |
358 | SUBPART_SKIRT | 358 | SUBPART_SKIRT, |
359 | SUBPART_ALPHA, | ||
360 | SUBPART_TATTOO | ||
359 | }; | 361 | }; |
360 | 362 | ||
361 | struct LLSubpart | 363 | struct LLSubpart |
@@ -384,6 +386,7 @@ public: | |||
384 | 386 | ||
385 | void addSubpart(const std::string& name, ESubpart id, LLSubpart* part ); | 387 | void addSubpart(const std::string& name, ESubpart id, LLSubpart* part ); |
386 | void addTextureDropTarget( ETextureIndex te, const std::string& name, const LLUUID& default_image_id, BOOL allow_no_texture ); | 388 | void addTextureDropTarget( ETextureIndex te, const std::string& name, const LLUUID& default_image_id, BOOL allow_no_texture ); |
389 | void addInvisibilityCheckbox(ETextureIndex te, const std::string& name); | ||
387 | void addColorSwatch( ETextureIndex te, const std::string& name ); | 390 | void addColorSwatch( ETextureIndex te, const std::string& name ); |
388 | 391 | ||
389 | const std::string& getLabel() { return LLWearable::typeToTypeLabel( mType ); } | 392 | const std::string& getLabel() { return LLWearable::typeToTypeLabel( mType ); } |
@@ -398,6 +401,11 @@ public: | |||
398 | 401 | ||
399 | void setUIPermissions(U32 perm_mask, BOOL is_complete); | 402 | void setUIPermissions(U32 perm_mask, BOOL is_complete); |
400 | 403 | ||
404 | void hideTextureControls(); | ||
405 | bool textureIsInvisible(ETextureIndex te); | ||
406 | void initPreviousTextureList(); | ||
407 | void initPreviousTextureListEntry(ETextureIndex te); | ||
408 | |||
401 | virtual void setVisible( BOOL visible ); | 409 | virtual void setVisible( BOOL visible ); |
402 | 410 | ||
403 | // Callbacks | 411 | // Callbacks |
@@ -412,6 +420,7 @@ public: | |||
412 | static void onBtnTakeOffDialog( S32 option, void* userdata ); | 420 | static void onBtnTakeOffDialog( S32 option, void* userdata ); |
413 | static void onBtnCreateNew( void* userdata ); | 421 | static void onBtnCreateNew( void* userdata ); |
414 | static void onTextureCommit( LLUICtrl* ctrl, void* userdata ); | 422 | static void onTextureCommit( LLUICtrl* ctrl, void* userdata ); |
423 | static void onInvisibilityCommit( LLUICtrl* ctrl, void* userdata ); | ||
415 | static void onColorCommit( LLUICtrl* ctrl, void* userdata ); | 424 | static void onColorCommit( LLUICtrl* ctrl, void* userdata ); |
416 | static void onCommitSexChange( LLUICtrl*, void* userdata ); | 425 | static void onCommitSexChange( LLUICtrl*, void* userdata ); |
417 | static bool onSelectAutoWearOption(const LLSD& notification, const LLSD& response); | 426 | static bool onSelectAutoWearOption(const LLSD& notification, const LLSD& response); |
@@ -422,8 +431,10 @@ private: | |||
422 | EWearableType mType; | 431 | EWearableType mType; |
423 | BOOL mCanTakeOff; | 432 | BOOL mCanTakeOff; |
424 | std::map<std::string, S32> mTextureList; | 433 | std::map<std::string, S32> mTextureList; |
434 | std::map<std::string, S32> mInvisibilityList; | ||
425 | std::map<std::string, S32> mColorList; | 435 | std::map<std::string, S32> mColorList; |
426 | std::map<ESubpart, LLSubpart*> mSubpartList; | 436 | std::map<ESubpart, LLSubpart*> mSubpartList; |
437 | std::map<S32, LLUUID> mPreviousTextureList; | ||
427 | ESubpart mCurrentSubpart; | 438 | ESubpart mCurrentSubpart; |
428 | }; | 439 | }; |
429 | 440 | ||
@@ -658,6 +669,71 @@ bool LLPanelEditWearable::onSelectAutoWearOption(const LLSD& notification, const | |||
658 | } | 669 | } |
659 | return false; | 670 | return false; |
660 | } | 671 | } |
672 | |||
673 | bool LLPanelEditWearable::textureIsInvisible(ETextureIndex te) | ||
674 | { | ||
675 | if (gAgent.getWearable(mType)) | ||
676 | { | ||
677 | LLVOAvatar *avatar = gAgent.getAvatarObject(); | ||
678 | if (avatar) | ||
679 | { | ||
680 | const LLTextureEntry* current_te = avatar->getTE(te); | ||
681 | return (current_te && current_te->getID() == IMG_INVISIBLE); | ||
682 | } | ||
683 | } | ||
684 | return false; | ||
685 | } | ||
686 | |||
687 | void LLPanelEditWearable::addInvisibilityCheckbox(ETextureIndex te, const std::string& name) | ||
688 | { | ||
689 | childSetCommitCallback(name, LLPanelEditWearable::onInvisibilityCommit, this); | ||
690 | |||
691 | mInvisibilityList[name] = te; | ||
692 | } | ||
693 | |||
694 | // static | ||
695 | void LLPanelEditWearable::onInvisibilityCommit(LLUICtrl* ctrl, void* userdata) | ||
696 | { | ||
697 | LLPanelEditWearable* self = (LLPanelEditWearable*) userdata; | ||
698 | LLCheckBoxCtrl* checkbox_ctrl = (LLCheckBoxCtrl*) ctrl; | ||
699 | LLVOAvatar *avatar = gAgent.getAvatarObject(); | ||
700 | if (!avatar) | ||
701 | { | ||
702 | return; | ||
703 | } | ||
704 | |||
705 | ETextureIndex te = (ETextureIndex)(self->mInvisibilityList[ctrl->getName()]); | ||
706 | |||
707 | bool new_invis_state = checkbox_ctrl->get(); | ||
708 | if (new_invis_state) | ||
709 | { | ||
710 | LLViewerImage* image = gImageList.getImage(IMG_INVISIBLE); | ||
711 | const LLTextureEntry* current_te = avatar->getTE(te); | ||
712 | if (current_te) | ||
713 | { | ||
714 | self->mPreviousTextureList[(S32)te] = current_te->getID(); | ||
715 | } | ||
716 | avatar->setLocTexTE(te, image, TRUE); | ||
717 | avatar->wearableUpdated(self->mType, FALSE); | ||
718 | } | ||
719 | else | ||
720 | { | ||
721 | // Try to restore previous texture, if any. | ||
722 | LLUUID prev_id = self->mPreviousTextureList[(S32)te]; | ||
723 | if (prev_id.isNull() || (prev_id == IMG_INVISIBLE)) | ||
724 | { | ||
725 | prev_id = LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID")); | ||
726 | } | ||
727 | if (prev_id.notNull()) | ||
728 | { | ||
729 | LLViewerImage* image = gImageList.getImage(prev_id); | ||
730 | avatar->setLocTexTE(te, image, TRUE); | ||
731 | avatar->wearableUpdated(self->mType, FALSE); | ||
732 | } | ||
733 | |||
734 | } | ||
735 | } | ||
736 | |||
661 | void LLPanelEditWearable::addColorSwatch( ETextureIndex te, const std::string& name ) | 737 | void LLPanelEditWearable::addColorSwatch( ETextureIndex te, const std::string& name ) |
662 | { | 738 | { |
663 | childSetCommitCallback(name, LLPanelEditWearable::onColorCommit, this); | 739 | childSetCommitCallback(name, LLPanelEditWearable::onColorCommit, this); |
@@ -683,11 +759,35 @@ void LLPanelEditWearable::onColorCommit( LLUICtrl* ctrl, void* userdata ) | |||
683 | avatar->setClothesColor( te, new_color, TRUE ); | 759 | avatar->setClothesColor( te, new_color, TRUE ); |
684 | 760 | ||
685 | LLVisualParamHint::requestHintUpdates(); | 761 | LLVisualParamHint::requestHintUpdates(); |
762 | avatar->wearableUpdated(self->mType, FALSE); | ||
686 | } | 763 | } |
687 | } | 764 | } |
688 | } | 765 | } |
689 | 766 | ||
690 | 767 | ||
768 | void LLPanelEditWearable::initPreviousTextureList() | ||
769 | { | ||
770 | initPreviousTextureListEntry(TEX_LOWER_ALPHA); | ||
771 | initPreviousTextureListEntry(TEX_UPPER_ALPHA); | ||
772 | initPreviousTextureListEntry(TEX_HEAD_ALPHA); | ||
773 | initPreviousTextureListEntry(TEX_EYES_ALPHA); | ||
774 | initPreviousTextureListEntry(TEX_LOWER_ALPHA); | ||
775 | } | ||
776 | |||
777 | void LLPanelEditWearable::initPreviousTextureListEntry(ETextureIndex te) | ||
778 | { | ||
779 | LLVOAvatar* avatar = gAgent.getAvatarObject(); | ||
780 | if (!avatar) | ||
781 | { | ||
782 | return; | ||
783 | } | ||
784 | const LLTextureEntry* current_te = avatar->getTE(te); | ||
785 | if (current_te) | ||
786 | { | ||
787 | mPreviousTextureList[te] = current_te->getID(); | ||
788 | } | ||
789 | } | ||
790 | |||
691 | void LLPanelEditWearable::addTextureDropTarget( ETextureIndex te, const std::string& name, | 791 | void LLPanelEditWearable::addTextureDropTarget( ETextureIndex te, const std::string& name, |
692 | const LLUUID& default_image_id, BOOL allow_no_texture ) | 792 | const LLUUID& default_image_id, BOOL allow_no_texture ) |
693 | { | 793 | { |
@@ -702,6 +802,19 @@ void LLPanelEditWearable::addTextureDropTarget( ETextureIndex te, const std::str | |||
702 | texture_ctrl->setNonImmediateFilterPermMask(PERM_NONE);//PERM_COPY | PERM_TRANSFER); | 802 | texture_ctrl->setNonImmediateFilterPermMask(PERM_NONE);//PERM_COPY | PERM_TRANSFER); |
703 | } | 803 | } |
704 | mTextureList[name] = te; | 804 | mTextureList[name] = te; |
805 | LLVOAvatar* avatar = gAgent.getAvatarObject(); | ||
806 | if (avatar) | ||
807 | { | ||
808 | LLWearable* wearable = gAgent.getWearable(mType); | ||
809 | if (wearable && mType == WT_ALPHA) | ||
810 | { | ||
811 | const LLTextureEntry* current_te = avatar->getTE(te); | ||
812 | if (current_te) | ||
813 | { | ||
814 | mPreviousTextureList[te] = current_te->getID(); | ||
815 | } | ||
816 | } | ||
817 | } | ||
705 | } | 818 | } |
706 | 819 | ||
707 | // static | 820 | // static |
@@ -717,11 +830,20 @@ void LLPanelEditWearable::onTextureCommit( LLUICtrl* ctrl, void* userdata ) | |||
717 | 830 | ||
718 | // Set the new version | 831 | // Set the new version |
719 | LLViewerImage* image = gImageList.getImage( texture_ctrl->getImageAssetID() ); | 832 | LLViewerImage* image = gImageList.getImage( texture_ctrl->getImageAssetID() ); |
720 | if( image->getID().isNull() ) | 833 | if (image->getID().isNull()) |
721 | { | 834 | { |
722 | image = gImageList.getImage(IMG_DEFAULT_AVATAR); | 835 | image = gImageList.getImage(IMG_DEFAULT_AVATAR); |
723 | } | 836 | } |
724 | avatar->setLocTexTE( te, image, TRUE ); | 837 | self->mTextureList[ctrl->getName()] = te; |
838 | if (gAgent.getWearable(self->mType)) | ||
839 | { | ||
840 | avatar->setLocTexTE(te, image, TRUE); | ||
841 | avatar->wearableUpdated(self->mType, FALSE); | ||
842 | } | ||
843 | if (self->mType == WT_ALPHA && image->getID() != IMG_INVISIBLE) | ||
844 | { | ||
845 | self->mPreviousTextureList[te] = image->getID(); | ||
846 | } | ||
725 | } | 847 | } |
726 | } | 848 | } |
727 | 849 | ||
@@ -743,6 +865,8 @@ ESubpart LLPanelEditWearable::getDefaultSubpart() | |||
743 | case WT_UNDERSHIRT: return SUBPART_UNDERSHIRT; | 865 | case WT_UNDERSHIRT: return SUBPART_UNDERSHIRT; |
744 | case WT_UNDERPANTS: return SUBPART_UNDERPANTS; | 866 | case WT_UNDERPANTS: return SUBPART_UNDERPANTS; |
745 | case WT_SKIRT: return SUBPART_SKIRT; | 867 | case WT_SKIRT: return SUBPART_SKIRT; |
868 | case WT_ALPHA: return SUBPART_ALPHA; | ||
869 | case WT_TATTOO: return SUBPART_TATTOO; | ||
746 | 870 | ||
747 | default: llassert(0); return SUBPART_SHAPE_WHOLE; | 871 | default: llassert(0); return SUBPART_SHAPE_WHOLE; |
748 | } | 872 | } |
@@ -816,16 +940,7 @@ void LLPanelEditWearable::draw() | |||
816 | childSetVisible("title_no_modify", TRUE); | 940 | childSetVisible("title_no_modify", TRUE); |
817 | childSetTextArg("title_no_modify", "[DESC]", std::string(LLWearable::typeToTypeLabel( mType ))); | 941 | childSetTextArg("title_no_modify", "[DESC]", std::string(LLWearable::typeToTypeLabel( mType ))); |
818 | 942 | ||
819 | for( std::map<std::string, S32>::iterator iter = mTextureList.begin(); | 943 | hideTextureControls(); |
820 | iter != mTextureList.end(); ++iter ) | ||
821 | { | ||
822 | childSetVisible(iter->first, FALSE ); | ||
823 | } | ||
824 | for( std::map<std::string, S32>::iterator iter = mColorList.begin(); | ||
825 | iter != mColorList.end(); ++iter ) | ||
826 | { | ||
827 | childSetVisible(iter->first, FALSE ); | ||
828 | } | ||
829 | } | 944 | } |
830 | else if(has_wearable && !is_complete) | 945 | else if(has_wearable && !is_complete) |
831 | { | 946 | { |
@@ -839,16 +954,7 @@ void LLPanelEditWearable::draw() | |||
839 | childSetVisible("path", TRUE); | 954 | childSetVisible("path", TRUE); |
840 | childSetTextArg("path", "[PATH]", path); | 955 | childSetTextArg("path", "[PATH]", path); |
841 | 956 | ||
842 | for( std::map<std::string, S32>::iterator iter = mTextureList.begin(); | 957 | hideTextureControls(); |
843 | iter != mTextureList.end(); ++iter ) | ||
844 | { | ||
845 | childSetVisible(iter->first, FALSE ); | ||
846 | } | ||
847 | for( std::map<std::string, S32>::iterator iter = mColorList.begin(); | ||
848 | iter != mColorList.end(); ++iter ) | ||
849 | { | ||
850 | childSetVisible(iter->first, FALSE ); | ||
851 | } | ||
852 | } | 958 | } |
853 | else if(has_wearable && is_modifiable) | 959 | else if(has_wearable && is_modifiable) |
854 | { | 960 | { |
@@ -908,6 +1014,20 @@ void LLPanelEditWearable::draw() | |||
908 | ctrl->set(avatar->getClothesColor( (ETextureIndex)te_index ) ); | 1014 | ctrl->set(avatar->getClothesColor( (ETextureIndex)te_index ) ); |
909 | } | 1015 | } |
910 | } | 1016 | } |
1017 | |||
1018 | for (std::map<std::string, S32>::iterator iter = mInvisibilityList.begin(); | ||
1019 | iter != mInvisibilityList.end(); ++iter) | ||
1020 | { | ||
1021 | std::string name = iter->first; | ||
1022 | ETextureIndex te = (ETextureIndex)iter->second; | ||
1023 | childSetVisible(name, is_copyable && is_modifiable && is_complete); | ||
1024 | childSetEnabled(name, is_copyable && is_modifiable && is_complete); | ||
1025 | LLCheckBoxCtrl* ctrl = getChild<LLCheckBoxCtrl>(name); | ||
1026 | if (ctrl) | ||
1027 | { | ||
1028 | ctrl->set(textureIsInvisible(te)); | ||
1029 | } | ||
1030 | } | ||
911 | } | 1031 | } |
912 | else | 1032 | else |
913 | { | 1033 | { |
@@ -915,16 +1035,7 @@ void LLPanelEditWearable::draw() | |||
915 | childSetVisible("title_not_worn", TRUE); | 1035 | childSetVisible("title_not_worn", TRUE); |
916 | childSetTextArg("title_not_worn", "[DESC]", std::string(LLWearable::typeToTypeLabel( mType ))); | 1036 | childSetTextArg("title_not_worn", "[DESC]", std::string(LLWearable::typeToTypeLabel( mType ))); |
917 | 1037 | ||
918 | for( std::map<std::string, S32>::iterator iter = mTextureList.begin(); | 1038 | hideTextureControls(); |
919 | iter != mTextureList.end(); ++iter ) | ||
920 | { | ||
921 | childSetVisible(iter->first, FALSE ); | ||
922 | } | ||
923 | for( std::map<std::string, S32>::iterator iter = mColorList.begin(); | ||
924 | iter != mColorList.end(); ++iter ) | ||
925 | { | ||
926 | childSetVisible(iter->first, FALSE ); | ||
927 | } | ||
928 | } | 1039 | } |
929 | 1040 | ||
930 | childSetVisible("icon", has_wearable && is_modifiable); | 1041 | childSetVisible("icon", has_wearable && is_modifiable); |
@@ -932,11 +1043,34 @@ void LLPanelEditWearable::draw() | |||
932 | LLPanel::draw(); | 1043 | LLPanel::draw(); |
933 | } | 1044 | } |
934 | 1045 | ||
1046 | void LLPanelEditWearable::hideTextureControls() | ||
1047 | { | ||
1048 | for (std::map<std::string, S32>::iterator iter = mTextureList.begin(); | ||
1049 | iter != mTextureList.end(); ++iter) | ||
1050 | { | ||
1051 | childSetVisible(iter->first, FALSE); | ||
1052 | } | ||
1053 | for (std::map<std::string, S32>::iterator iter = mColorList.begin(); | ||
1054 | iter != mColorList.end(); ++iter) | ||
1055 | { | ||
1056 | childSetVisible(iter->first, FALSE); | ||
1057 | } | ||
1058 | for (std::map<std::string, S32>::iterator iter = mInvisibilityList.begin(); | ||
1059 | iter != mInvisibilityList.end(); ++iter) | ||
1060 | { | ||
1061 | childSetVisible(iter->first, FALSE); | ||
1062 | } | ||
1063 | } | ||
1064 | |||
935 | void LLPanelEditWearable::setWearable(LLWearable* wearable, U32 perm_mask, BOOL is_complete) | 1065 | void LLPanelEditWearable::setWearable(LLWearable* wearable, U32 perm_mask, BOOL is_complete) |
936 | { | 1066 | { |
937 | if( wearable ) | 1067 | if( wearable ) |
938 | { | 1068 | { |
939 | setUIPermissions(perm_mask, is_complete); | 1069 | setUIPermissions(perm_mask, is_complete); |
1070 | if (mType == WT_ALPHA) | ||
1071 | { | ||
1072 | initPreviousTextureList(); | ||
1073 | } | ||
940 | } | 1074 | } |
941 | } | 1075 | } |
942 | 1076 | ||
@@ -1029,6 +1163,11 @@ void LLPanelEditWearable::setUIPermissions(U32 perm_mask, BOOL is_complete) | |||
1029 | { | 1163 | { |
1030 | childSetVisible(iter->first, is_modifiable && is_complete ); | 1164 | childSetVisible(iter->first, is_modifiable && is_complete ); |
1031 | } | 1165 | } |
1166 | for (std::map<std::string, S32>::iterator iter = mInvisibilityList.begin(); | ||
1167 | iter != mInvisibilityList.end(); ++iter) | ||
1168 | { | ||
1169 | childSetVisible(iter->first, is_copyable && is_modifiable && is_complete); | ||
1170 | } | ||
1032 | } | 1171 | } |
1033 | 1172 | ||
1034 | ///////////////////////////////////////////////////////////////////// | 1173 | ///////////////////////////////////////////////////////////////////// |
@@ -1475,6 +1614,8 @@ LLFloaterCustomize::LLFloaterCustomize() | |||
1475 | factory_map["Undershirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERSHIRT) ) ); | 1614 | factory_map["Undershirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERSHIRT) ) ); |
1476 | factory_map["Underpants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERPANTS) ) ); | 1615 | factory_map["Underpants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERPANTS) ) ); |
1477 | factory_map["Skirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SKIRT) ) ); | 1616 | factory_map["Skirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SKIRT) ) ); |
1617 | factory_map["Alpha"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_ALPHA))); | ||
1618 | factory_map["Tattoo"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_TATTOO))); | ||
1478 | 1619 | ||
1479 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_customize.xml", &factory_map); | 1620 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_customize.xml", &factory_map); |
1480 | } | 1621 | } |
@@ -1506,6 +1647,8 @@ BOOL LLFloaterCustomize::postBuild() | |||
1506 | childSetTabChangeCallback("customize tab container", "Undershirt", onTabChanged, (void*)WT_UNDERSHIRT, onTabPrecommit ); | 1647 | childSetTabChangeCallback("customize tab container", "Undershirt", onTabChanged, (void*)WT_UNDERSHIRT, onTabPrecommit ); |
1507 | childSetTabChangeCallback("customize tab container", "Underpants", onTabChanged, (void*)WT_UNDERPANTS, onTabPrecommit ); | 1648 | childSetTabChangeCallback("customize tab container", "Underpants", onTabChanged, (void*)WT_UNDERPANTS, onTabPrecommit ); |
1508 | childSetTabChangeCallback("customize tab container", "Skirt", onTabChanged, (void*)WT_SKIRT, onTabPrecommit ); | 1649 | childSetTabChangeCallback("customize tab container", "Skirt", onTabChanged, (void*)WT_SKIRT, onTabPrecommit ); |
1650 | childSetTabChangeCallback("customize tab container", "Alpha", onTabChanged, (void*)WT_ALPHA, onTabPrecommit); | ||
1651 | childSetTabChangeCallback("customize tab container", "Tattoo", onTabChanged, (void*)WT_TATTOO, onTabPrecommit); | ||
1509 | 1652 | ||
1510 | // Remove underwear panels for teens | 1653 | // Remove underwear panels for teens |
1511 | if (gAgent.isTeen()) | 1654 | if (gAgent.isTeen()) |
@@ -1532,6 +1675,7 @@ void LLFloaterCustomize::open() | |||
1532 | LLFloater::open(); | 1675 | LLFloater::open(); |
1533 | // childShowTab depends on gFloaterCustomize being defined and therefore must be called after the constructor. - Nyx | 1676 | // childShowTab depends on gFloaterCustomize being defined and therefore must be called after the constructor. - Nyx |
1534 | childShowTab("customize tab container", "Shape", true); | 1677 | childShowTab("customize tab container", "Shape", true); |
1678 | setCurrentWearableType(WT_SHAPE); | ||
1535 | } | 1679 | } |
1536 | 1680 | ||
1537 | //////////////////////////////////////////////////////////////////////////// | 1681 | //////////////////////////////////////////////////////////////////////////// |
@@ -2136,6 +2280,66 @@ void LLFloaterCustomize::initWearablePanels() | |||
2136 | 2280 | ||
2137 | panel->addColorSwatch( TEX_LOWER_UNDERPANTS, "Color/Tint" ); | 2281 | panel->addColorSwatch( TEX_LOWER_UNDERPANTS, "Color/Tint" ); |
2138 | } | 2282 | } |
2283 | |||
2284 | ///////////////////////////////////////// | ||
2285 | // Alpha | ||
2286 | panel = mWearablePanelList[WT_ALPHA]; | ||
2287 | |||
2288 | if (panel) | ||
2289 | { | ||
2290 | part = new LLSubpart(); | ||
2291 | part->mTargetJoint = "mPelvis"; | ||
2292 | part->mEditGroup = "alpha"; | ||
2293 | part->mTargetOffset.setVec(0.f, 0.f, 0.1f); | ||
2294 | part->mCameraOffset.setVec(-2.5f, 0.5f, 0.8f); | ||
2295 | panel->addSubpart(LLStringUtil::null, SUBPART_ALPHA, part); | ||
2296 | |||
2297 | panel->addTextureDropTarget(TEX_LOWER_ALPHA, "Lower Alpha", | ||
2298 | LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID")), | ||
2299 | TRUE); | ||
2300 | panel->addTextureDropTarget(TEX_UPPER_ALPHA, "Upper Alpha", | ||
2301 | LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID")), | ||
2302 | TRUE); | ||
2303 | panel->addTextureDropTarget(TEX_HEAD_ALPHA, "Head Alpha", | ||
2304 | LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID")), | ||
2305 | TRUE); | ||
2306 | panel->addTextureDropTarget(TEX_EYES_ALPHA, "Eye Alpha", | ||
2307 | LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID")), | ||
2308 | TRUE); | ||
2309 | panel->addTextureDropTarget(TEX_HAIR_ALPHA, "Hair Alpha", | ||
2310 | LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID")), | ||
2311 | TRUE); | ||
2312 | |||
2313 | panel->addInvisibilityCheckbox(TEX_LOWER_ALPHA, "lower alpha texture invisible"); | ||
2314 | panel->addInvisibilityCheckbox(TEX_UPPER_ALPHA, "upper alpha texture invisible"); | ||
2315 | panel->addInvisibilityCheckbox(TEX_HEAD_ALPHA, "head alpha texture invisible"); | ||
2316 | panel->addInvisibilityCheckbox(TEX_EYES_ALPHA, "eye alpha texture invisible"); | ||
2317 | panel->addInvisibilityCheckbox(TEX_HAIR_ALPHA, "hair alpha texture invisible"); | ||
2318 | } | ||
2319 | |||
2320 | ///////////////////////////////////////// | ||
2321 | // Tattoo | ||
2322 | panel = mWearablePanelList[WT_TATTOO]; | ||
2323 | |||
2324 | if (panel) | ||
2325 | { | ||
2326 | part = new LLSubpart(); | ||
2327 | part->mTargetJoint = "mPelvis"; | ||
2328 | part->mEditGroup = "tattoo"; | ||
2329 | part->mTargetOffset.setVec(0.f, 0.f, 0.1f); | ||
2330 | part->mCameraOffset.setVec(-2.5f, 0.5f, 0.8f); | ||
2331 | panel->addSubpart(LLStringUtil::null, SUBPART_TATTOO, part); | ||
2332 | |||
2333 | panel->addTextureDropTarget(TEX_LOWER_TATTOO, "Lower Tattoo", | ||
2334 | LLUUID::null, | ||
2335 | TRUE); | ||
2336 | panel->addTextureDropTarget(TEX_UPPER_TATTOO, "Upper Tattoo", | ||
2337 | LLUUID::null, | ||
2338 | TRUE); | ||
2339 | panel->addTextureDropTarget(TEX_HEAD_TATTOO, "Head Tattoo", | ||
2340 | LLUUID::null, | ||
2341 | TRUE); | ||
2342 | } | ||
2139 | } | 2343 | } |
2140 | 2344 | ||
2141 | //////////////////////////////////////////////////////////////////////////// | 2345 | //////////////////////////////////////////////////////////////////////////// |
@@ -2204,7 +2408,8 @@ BOOL LLFloaterCustomize::isDirty() const | |||
2204 | // static | 2408 | // static |
2205 | void LLFloaterCustomize::onTabPrecommit( void* userdata, bool from_click ) | 2409 | void LLFloaterCustomize::onTabPrecommit( void* userdata, bool from_click ) |
2206 | { | 2410 | { |
2207 | if (gFloaterCustomize && gFloaterCustomize->getCurrentWearableType() != (EWearableType)(intptr_t) userdata) | 2411 | EWearableType type = (EWearableType)(intptr_t) userdata; |
2412 | if (type != WT_INVALID && gFloaterCustomize && gFloaterCustomize->getCurrentWearableType() != type) | ||
2208 | { | 2413 | { |
2209 | gFloaterCustomize->askToSaveIfDirty(onCommitChangeTab, userdata); | 2414 | gFloaterCustomize->askToSaveIfDirty(onCommitChangeTab, userdata); |
2210 | } | 2415 | } |
@@ -2219,7 +2424,10 @@ void LLFloaterCustomize::onTabPrecommit( void* userdata, bool from_click ) | |||
2219 | void LLFloaterCustomize::onTabChanged( void* userdata, bool from_click ) | 2424 | void LLFloaterCustomize::onTabChanged( void* userdata, bool from_click ) |
2220 | { | 2425 | { |
2221 | EWearableType wearable_type = (EWearableType) (intptr_t)userdata; | 2426 | EWearableType wearable_type = (EWearableType) (intptr_t)userdata; |
2222 | LLFloaterCustomize::setCurrentWearableType( wearable_type ); | 2427 | if (wearable_type != WT_INVALID) |
2428 | { | ||
2429 | LLFloaterCustomize::setCurrentWearableType(wearable_type); | ||
2430 | } | ||
2223 | } | 2431 | } |
2224 | 2432 | ||
2225 | void LLFloaterCustomize::onClose(bool app_quitting) | 2433 | void LLFloaterCustomize::onClose(bool app_quitting) |