aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatercustomize.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llfloatercustomize.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llfloatercustomize.cpp')
-rw-r--r--linden/indra/newview/llfloatercustomize.cpp377
1 files changed, 184 insertions, 193 deletions
diff --git a/linden/indra/newview/llfloatercustomize.cpp b/linden/indra/newview/llfloatercustomize.cpp
index f4baa9f..535ef52 100644
--- a/linden/indra/newview/llfloatercustomize.cpp
+++ b/linden/indra/newview/llfloatercustomize.cpp
@@ -73,7 +73,7 @@
73#include "llviewermessage.h" 73#include "llviewermessage.h"
74#include "llimagejpeg.h" 74#include "llimagejpeg.h"
75#include "llviewercontrol.h" 75#include "llviewercontrol.h"
76#include "llvieweruictrlfactory.h" 76#include "lluictrlfactory.h"
77 77
78#include "llfilepicker.h" 78#include "llfilepicker.h"
79 79
@@ -141,7 +141,7 @@ public:
141 mCommitCallback( commit_cb ), 141 mCommitCallback( commit_cb ),
142 mCallbackUserData( userdata ) 142 mCallbackUserData( userdata )
143 { 143 {
144 gUICtrlFactory->buildFloater(this, "floater_wearable_save_as.xml"); 144 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_wearable_save_as.xml");
145 145
146 childSetAction("Save", LLWearableSaveAsDialog::onSave, this ); 146 childSetAction("Save", LLWearableSaveAsDialog::onSave, this );
147 childSetAction("Cancel", LLWearableSaveAsDialog::onCancel, this ); 147 childSetAction("Cancel", LLWearableSaveAsDialog::onCancel, this );
@@ -151,7 +151,7 @@ public:
151 virtual void startModal() 151 virtual void startModal()
152 { 152 {
153 LLModalDialog::startModal(); 153 LLModalDialog::startModal();
154 LLLineEditor* edit = LLUICtrlFactory::getLineEditorByName(this, "name ed"); 154 LLLineEditor* edit = getChild<LLLineEditor>("name ed");
155 if (!edit) return; 155 if (!edit) return;
156 edit->setFocus(TRUE); 156 edit->setFocus(TRUE);
157 edit->selectAll(); 157 edit->selectAll();
@@ -209,7 +209,7 @@ public:
209 mCommitCallback( commit_cb ), 209 mCommitCallback( commit_cb ),
210 mCallbackUserData( userdata ) 210 mCallbackUserData( userdata )
211 { 211 {
212 gUICtrlFactory->buildFloater(this, "floater_new_outfit_dialog.xml"); 212 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_new_outfit_dialog.xml");
213 213
214 // Build list of check boxes 214 // Build list of check boxes
215 for( S32 i = 0; i < WT_COUNT; i++ ) 215 for( S32 i = 0; i < WT_COUNT; i++ )
@@ -453,10 +453,10 @@ LLPanelEditWearable::LLPanelEditWearable( EWearableType type )
453BOOL LLPanelEditWearable::postBuild() 453BOOL LLPanelEditWearable::postBuild()
454{ 454{
455 LLAssetType::EType asset_type = LLWearable::typeToAssetType( mType ); 455 LLAssetType::EType asset_type = LLWearable::typeToAssetType( mType );
456 LLUUID icon_id( gViewerArt.getString(asset_type == LLAssetType::AT_CLOTHING ? 456 LLString icon_name = (asset_type == LLAssetType::AT_CLOTHING ?
457 "inv_item_clothing.tga" : 457 "inv_item_clothing.tga" :
458 "inv_item_bodypart.tga" ) ); 458 "inv_item_skin.tga" );
459 childSetValue("icon", icon_id); 459 childSetValue("icon", icon_name);
460 460
461 childSetAction("Create New", LLPanelEditWearable::onBtnCreateNew, this ); 461 childSetAction("Create New", LLPanelEditWearable::onBtnCreateNew, this );
462 462
@@ -518,7 +518,7 @@ void LLPanelEditWearable::setSubpart( ESubpart subpart )
518 for (std::map<ESubpart, LLSubpart*>::iterator iter = mSubpartList.begin(); 518 for (std::map<ESubpart, LLSubpart*>::iterator iter = mSubpartList.begin();
519 iter != mSubpartList.end(); ++iter) 519 iter != mSubpartList.end(); ++iter)
520 { 520 {
521 LLButton* btn = LLUICtrlFactory::getButtonByName(this, iter->second->mButtonName); 521 LLButton* btn = getChild<LLButton>(iter->second->mButtonName);
522 if (btn) 522 if (btn)
523 { 523 {
524 btn->setToggleState( subpart == iter->first ); 524 btn->setToggleState( subpart == iter->first );
@@ -733,7 +733,7 @@ void LLPanelEditWearable::addTextureDropTarget( LLVOAvatar::ETextureIndex te, co
733 const LLUUID& default_image_id, BOOL allow_no_texture ) 733 const LLUUID& default_image_id, BOOL allow_no_texture )
734{ 734{
735 childSetCommitCallback(name, LLPanelEditWearable::onTextureCommit, this); 735 childSetCommitCallback(name, LLPanelEditWearable::onTextureCommit, this);
736 LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, name); 736 LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(name);
737 if (texture_ctrl) 737 if (texture_ctrl)
738 { 738 {
739 texture_ctrl->setDefaultImageAssetID(default_image_id); 739 texture_ctrl->setDefaultImageAssetID(default_image_id);
@@ -812,170 +812,167 @@ void LLPanelEditWearable::draw()
812 return; 812 return;
813 } 813 }
814 814
815 if( getVisible() ) 815 if( gFloaterCustomize->isFrontmost() && !gFocusMgr.getKeyboardFocus() )
816 { 816 {
817 if( gFloaterCustomize->isFrontmost() && !gFocusMgr.getKeyboardFocus() ) 817 // Route menu to this class
818 { 818 gEditMenuHandler = this;
819 // Route menu to this class 819 }
820 gEditMenuHandler = this;
821 }
822 820
823 LLWearable* wearable = gAgent.getWearable( mType ); 821 LLWearable* wearable = gAgent.getWearable( mType );
824 BOOL has_wearable = (wearable != NULL ); 822 BOOL has_wearable = (wearable != NULL );
825 BOOL is_dirty = isDirty(); 823 BOOL is_dirty = isDirty();
826 BOOL is_modifiable = FALSE; 824 BOOL is_modifiable = FALSE;
827 BOOL is_copyable = FALSE; 825 BOOL is_copyable = FALSE;
828 BOOL is_complete = FALSE; 826 BOOL is_complete = FALSE;
829 LLViewerInventoryItem* item; 827 LLViewerInventoryItem* item;
830 item = (LLViewerInventoryItem*)gAgent.getWearableInventoryItem(mType); 828 item = (LLViewerInventoryItem*)gAgent.getWearableInventoryItem(mType);
831 if(item) 829 if(item)
832 { 830 {
833 const LLPermissions& perm = item->getPermissions(); 831 const LLPermissions& perm = item->getPermissions();
834 is_modifiable = perm.allowModifyBy(gAgent.getID(), gAgent.getGroupID()); 832 is_modifiable = perm.allowModifyBy(gAgent.getID(), gAgent.getGroupID());
835 is_copyable = perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()); 833 is_copyable = perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID());
836 is_complete = item->isComplete(); 834 is_complete = item->isComplete();
837 } 835 }
838 836
839 childSetEnabled("Save", is_modifiable && is_complete && has_wearable && is_dirty); 837 childSetEnabled("Save", is_modifiable && is_complete && has_wearable && is_dirty);
840 childSetEnabled("Save As", is_copyable && is_complete && has_wearable); 838 childSetEnabled("Save As", is_copyable && is_complete && has_wearable);
841 childSetEnabled("Revert", has_wearable && is_dirty ); 839 childSetEnabled("Revert", has_wearable && is_dirty );
842 childSetEnabled("Take Off", has_wearable ); 840 childSetEnabled("Take Off", has_wearable );
843 childSetVisible("Take Off", mCanTakeOff ); 841 childSetVisible("Take Off", mCanTakeOff );
844 childSetVisible("Create New", !has_wearable ); 842 childSetVisible("Create New", !has_wearable );
845 843
846 childSetVisible("not worn instructions", !has_wearable ); 844 childSetVisible("not worn instructions", !has_wearable );
847 childSetVisible("no modify instructions", has_wearable && !is_modifiable); 845 childSetVisible("no modify instructions", has_wearable && !is_modifiable);
848 846
849 for (std::map<ESubpart, LLSubpart*>::iterator iter = mSubpartList.begin(); 847 for (std::map<ESubpart, LLSubpart*>::iterator iter = mSubpartList.begin();
850 iter != mSubpartList.end(); ++iter) 848 iter != mSubpartList.end(); ++iter)
849 {
850 if( has_wearable && is_complete && is_modifiable )
851 { 851 {
852 if( has_wearable && is_complete && is_modifiable ) 852 childSetEnabled(iter->second->mButtonName, iter->second->mSex & avatar->getSex() );
853 {
854 childSetEnabled(iter->second->mButtonName, iter->second->mSex & avatar->getSex() );
855 }
856 else
857 {
858 childSetEnabled(iter->second->mButtonName, FALSE );
859 }
860 } 853 }
854 else
855 {
856 childSetEnabled(iter->second->mButtonName, FALSE );
857 }
858 }
861 859
862 childSetVisible("square", !is_modifiable); 860 childSetVisible("square", !is_modifiable);
863 861
864 childSetVisible("title", FALSE); 862 childSetVisible("title", FALSE);
865 childSetVisible("title_no_modify", FALSE); 863 childSetVisible("title_no_modify", FALSE);
866 childSetVisible("title_not_worn", FALSE); 864 childSetVisible("title_not_worn", FALSE);
867 childSetVisible("title_loading", FALSE); 865 childSetVisible("title_loading", FALSE);
868 866
869 childSetVisible("path", FALSE); 867 childSetVisible("path", FALSE);
868
869 if(has_wearable && !is_modifiable)
870 {
871 // *TODO:Translate
872 childSetVisible("title_no_modify", TRUE);
873 childSetTextArg("title_no_modify", "[DESC]", LLString(LLWearable::typeToTypeLabel( mType )));
870 874
871 if(has_wearable && !is_modifiable) 875 for( std::map<LLString, S32>::iterator iter = mTextureList.begin();
876 iter != mTextureList.end(); ++iter )
872 { 877 {
873 // *TODO:Translate 878 childSetVisible(iter->first, FALSE );
874 childSetVisible("title_no_modify", TRUE);
875 childSetTextArg("title_no_modify", "[DESC]", LLString(LLWearable::typeToTypeLabel( mType )));
876
877 for( std::map<LLString, S32>::iterator iter = mTextureList.begin();
878 iter != mTextureList.end(); ++iter )
879 {
880 childSetVisible(iter->first, FALSE );
881 }
882 for( std::map<LLString, S32>::iterator iter = mColorList.begin();
883 iter != mColorList.end(); ++iter )
884 {
885 childSetVisible(iter->first, FALSE );
886 }
887 } 879 }
888 else if(has_wearable && !is_complete) 880 for( std::map<LLString, S32>::iterator iter = mColorList.begin();
881 iter != mColorList.end(); ++iter )
889 { 882 {
890 // *TODO:Translate 883 childSetVisible(iter->first, FALSE );
891 childSetVisible("title_loading", TRUE);
892 childSetTextArg("title_loading", "[DESC]", LLString(LLWearable::typeToTypeLabel( mType )));
893
894 LLString path;
895 const LLUUID& item_id = gAgent.getWearableItem( wearable->getType() );
896 gInventory.appendPath(item_id, path);
897 childSetVisible("path", TRUE);
898 childSetTextArg("path", "[PATH]", path);
899
900 for( std::map<LLString, S32>::iterator iter = mTextureList.begin();
901 iter != mTextureList.end(); ++iter )
902 {
903 childSetVisible(iter->first, FALSE );
904 }
905 for( std::map<LLString, S32>::iterator iter = mColorList.begin();
906 iter != mColorList.end(); ++iter )
907 {
908 childSetVisible(iter->first, FALSE );
909 }
910 } 884 }
911 else if(has_wearable && is_modifiable) 885 }
886 else if(has_wearable && !is_complete)
887 {
888 // *TODO:Translate
889 childSetVisible("title_loading", TRUE);
890 childSetTextArg("title_loading", "[DESC]", LLString(LLWearable::typeToTypeLabel( mType )));
891
892 LLString path;
893 const LLUUID& item_id = gAgent.getWearableItem( wearable->getType() );
894 gInventory.appendPath(item_id, path);
895 childSetVisible("path", TRUE);
896 childSetTextArg("path", "[PATH]", path);
897
898 for( std::map<LLString, S32>::iterator iter = mTextureList.begin();
899 iter != mTextureList.end(); ++iter )
912 { 900 {
913 childSetVisible("title", TRUE); 901 childSetVisible(iter->first, FALSE );
914 childSetTextArg("title", "[DESC]", wearable->getName() ); 902 }
903 for( std::map<LLString, S32>::iterator iter = mColorList.begin();
904 iter != mColorList.end(); ++iter )
905 {
906 childSetVisible(iter->first, FALSE );
907 }
908 }
909 else if(has_wearable && is_modifiable)
910 {
911 childSetVisible("title", TRUE);
912 childSetTextArg("title", "[DESC]", wearable->getName() );
915 913
916 LLString path; 914 LLString path;
917 const LLUUID& item_id = gAgent.getWearableItem( wearable->getType() ); 915 const LLUUID& item_id = gAgent.getWearableItem( wearable->getType() );
918 gInventory.appendPath(item_id, path); 916 gInventory.appendPath(item_id, path);
919 childSetVisible("path", TRUE); 917 childSetVisible("path", TRUE);
920 childSetTextArg("path", "[PATH]", path); 918 childSetTextArg("path", "[PATH]", path);
921 919
922 for( std::map<LLString, S32>::iterator iter = mTextureList.begin(); 920 for( std::map<LLString, S32>::iterator iter = mTextureList.begin();
923 iter != mTextureList.end(); ++iter ) 921 iter != mTextureList.end(); ++iter )
922 {
923 LLString name = iter->first;
924 LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(name);
925 S32 te_index = iter->second;
926 childSetVisible(name, is_copyable && is_modifiable && is_complete );
927 if (texture_ctrl)
924 { 928 {
925 LLString name = iter->first; 929 const LLTextureEntry* te = avatar->getTE(te_index);
926 LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, name); 930 if( te && (te->getID() != IMG_DEFAULT_AVATAR) )
927 S32 te_index = iter->second;
928 childSetVisible(name, is_copyable && is_modifiable && is_complete );
929 if (texture_ctrl)
930 { 931 {
931 const LLTextureEntry* te = avatar->getTE(te_index); 932 texture_ctrl->setImageAssetID( te->getID() );
932 if( te && (te->getID() != IMG_DEFAULT_AVATAR) )
933 {
934 texture_ctrl->setImageAssetID( te->getID() );
935 }
936 else
937 {
938 texture_ctrl->setImageAssetID( LLUUID::null );
939 }
940 } 933 }
941 } 934 else
942
943 for( std::map<LLString, S32>::iterator iter = mColorList.begin();
944 iter != mColorList.end(); ++iter )
945 {
946 LLString name = iter->first;
947 S32 te_index = iter->second;
948 childSetVisible(name, is_modifiable && is_complete );
949 childSetEnabled(name, is_modifiable && is_complete );
950 LLColorSwatchCtrl* ctrl = LLViewerUICtrlFactory::getColorSwatchByName(this, name);
951 if (ctrl)
952 { 935 {
953 ctrl->set(avatar->getClothesColor( (LLVOAvatar::ETextureIndex)te_index ) ); 936 texture_ctrl->setImageAssetID( LLUUID::null );
954 } 937 }
955 } 938 }
956 } 939 }
957 else
958 {
959 // *TODO:Translate
960 childSetVisible("title_not_worn", TRUE);
961 childSetTextArg("title_not_worn", "[DESC]", LLString(LLWearable::typeToTypeLabel( mType )));
962 940
963 for( std::map<LLString, S32>::iterator iter = mTextureList.begin(); 941 for( std::map<LLString, S32>::iterator iter = mColorList.begin();
964 iter != mTextureList.end(); ++iter ) 942 iter != mColorList.end(); ++iter )
965 { 943 {
966 childSetVisible(iter->first, FALSE ); 944 LLString name = iter->first;
967 } 945 S32 te_index = iter->second;
968 for( std::map<LLString, S32>::iterator iter = mColorList.begin(); 946 childSetVisible(name, is_modifiable && is_complete );
969 iter != mColorList.end(); ++iter ) 947 childSetEnabled(name, is_modifiable && is_complete );
948 LLColorSwatchCtrl* ctrl = getChild<LLColorSwatchCtrl>(name);
949 if (ctrl)
970 { 950 {
971 childSetVisible(iter->first, FALSE ); 951 ctrl->set(avatar->getClothesColor( (LLVOAvatar::ETextureIndex)te_index ) );
972 } 952 }
973 } 953 }
974 954 }
975 childSetVisible("icon", has_wearable && is_modifiable); 955 else
956 {
957 // *TODO:Translate
958 childSetVisible("title_not_worn", TRUE);
959 childSetTextArg("title_not_worn", "[DESC]", LLString(LLWearable::typeToTypeLabel( mType )));
976 960
977 LLPanel::draw(); 961 for( std::map<LLString, S32>::iterator iter = mTextureList.begin();
962 iter != mTextureList.end(); ++iter )
963 {
964 childSetVisible(iter->first, FALSE );
965 }
966 for( std::map<LLString, S32>::iterator iter = mColorList.begin();
967 iter != mColorList.end(); ++iter )
968 {
969 childSetVisible(iter->first, FALSE );
970 }
978 } 971 }
972
973 childSetVisible("icon", has_wearable && is_modifiable);
974
975 LLPanel::draw();
979} 976}
980 977
981void LLPanelEditWearable::setWearable(LLWearable* wearable, U32 perm_mask, BOOL is_complete) 978void LLPanelEditWearable::setWearable(LLWearable* wearable, U32 perm_mask, BOOL is_complete)
@@ -1153,7 +1150,7 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLString& name,
1153 mParam(param), 1150 mParam(param),
1154 mAllowModify(allow_modify) 1151 mAllowModify(allow_modify)
1155{ 1152{
1156 gUICtrlFactory->buildPanel(this, "panel_scrolling_param.xml"); 1153 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_scrolling_param.xml");
1157 1154
1158 S32 pos_x = 2 * LLPANEL_BORDER_WIDTH; 1155 S32 pos_x = 2 * LLPANEL_BORDER_WIDTH;
1159 S32 pos_y = 3 * LLPANEL_BORDER_WIDTH + SLIDERCTRL_HEIGHT; 1156 S32 pos_y = 3 * LLPANEL_BORDER_WIDTH + SLIDERCTRL_HEIGHT;
@@ -1177,7 +1174,7 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLString& name,
1177 childSetValue("min param text", min_name); 1174 childSetValue("min param text", min_name);
1178 childSetValue("max param text", max_name); 1175 childSetValue("max param text", max_name);
1179 1176
1180 LLButton* less = LLUICtrlFactory::getButtonByName(this, "less"); 1177 LLButton* less = getChild<LLButton>("less");
1181 if (less) 1178 if (less)
1182 { 1179 {
1183 less->setMouseDownCallback( LLScrollingPanelParam::onHintMinMouseDown ); 1180 less->setMouseDownCallback( LLScrollingPanelParam::onHintMinMouseDown );
@@ -1186,7 +1183,7 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLString& name,
1186 less->setHeldDownDelay( PARAM_STEP_TIME_THRESHOLD ); 1183 less->setHeldDownDelay( PARAM_STEP_TIME_THRESHOLD );
1187 } 1184 }
1188 1185
1189 LLButton* more = LLUICtrlFactory::getButtonByName(this, "more"); 1186 LLButton* more = getChild<LLButton>("more");
1190 if (more) 1187 if (more)
1191 { 1188 {
1192 more->setMouseDownCallback( LLScrollingPanelParam::onHintMaxMouseDown ); 1189 more->setMouseDownCallback( LLScrollingPanelParam::onHintMaxMouseDown );
@@ -1244,42 +1241,39 @@ void LLScrollingPanelParam::draw()
1244 childSetVisible("less", mHintMin->getVisible()); 1241 childSetVisible("less", mHintMin->getVisible());
1245 childSetVisible("more", mHintMax->getVisible()); 1242 childSetVisible("more", mHintMax->getVisible());
1246 1243
1247 if( getVisible() ) 1244 // Draw all the children except for the labels
1248 { 1245 childSetVisible( "min param text", FALSE );
1249 // Draw all the children except for the labels 1246 childSetVisible( "max param text", FALSE );
1250 childSetVisible( "min param text", FALSE ); 1247 LLPanel::draw();
1251 childSetVisible( "max param text", FALSE );
1252 LLPanel::draw();
1253 1248
1254 // Draw the hints over the "less" and "more" buttons. 1249 // Draw the hints over the "less" and "more" buttons.
1255 glPushMatrix(); 1250 glPushMatrix();
1256 { 1251 {
1257 const LLRect& r = mHintMin->getRect(); 1252 const LLRect& r = mHintMin->getRect();
1258 F32 left = (F32)(r.mLeft + BTN_BORDER); 1253 F32 left = (F32)(r.mLeft + BTN_BORDER);
1259 F32 bot = (F32)(r.mBottom + BTN_BORDER); 1254 F32 bot = (F32)(r.mBottom + BTN_BORDER);
1260 glTranslatef(left, bot, 0.f); 1255 glTranslatef(left, bot, 0.f);
1261 mHintMin->draw(); 1256 mHintMin->draw();
1262 } 1257 }
1263 glPopMatrix(); 1258 glPopMatrix();
1264 1259
1265 glPushMatrix(); 1260 glPushMatrix();
1266 { 1261 {
1267 const LLRect& r = mHintMax->getRect(); 1262 const LLRect& r = mHintMax->getRect();
1268 F32 left = (F32)(r.mLeft + BTN_BORDER); 1263 F32 left = (F32)(r.mLeft + BTN_BORDER);
1269 F32 bot = (F32)(r.mBottom + BTN_BORDER); 1264 F32 bot = (F32)(r.mBottom + BTN_BORDER);
1270 glTranslatef(left, bot, 0.f); 1265 glTranslatef(left, bot, 0.f);
1271 mHintMax->draw(); 1266 mHintMax->draw();
1272 } 1267 }
1273 glPopMatrix(); 1268 glPopMatrix();
1274 1269
1275 1270
1276 // Draw labels on top of the buttons 1271 // Draw labels on top of the buttons
1277 childSetVisible( "min param text", TRUE ); 1272 childSetVisible( "min param text", TRUE );
1278 drawChild(getChild<LLView>("min param text"), BTN_BORDER, BTN_BORDER); 1273 drawChild(getChild<LLView>("min param text"), BTN_BORDER, BTN_BORDER);
1279 1274
1280 childSetVisible( "max param text", TRUE ); 1275 childSetVisible( "max param text", TRUE );
1281 drawChild(getChild<LLView>("max param text"), BTN_BORDER, BTN_BORDER); 1276 drawChild(getChild<LLView>("max param text"), BTN_BORDER, BTN_BORDER);
1282 }
1283} 1277}
1284 1278
1285// static 1279// static
@@ -1403,7 +1397,7 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint )
1403 // Make sure we're not taking the slider out of bounds 1397 // Make sure we're not taking the slider out of bounds
1404 // (this is where some simple UI limits are stored) 1398 // (this is where some simple UI limits are stored)
1405 F32 new_percent = weightToPercent(new_weight); 1399 F32 new_percent = weightToPercent(new_weight);
1406 LLSliderCtrl* slider = LLUICtrlFactory::getSliderByName(this, "param slider"); 1400 LLSliderCtrl* slider = getChild<LLSliderCtrl>("param slider");
1407 if (slider) 1401 if (slider)
1408 { 1402 {
1409 if (slider->getMinValue() < new_percent 1403 if (slider->getMinValue() < new_percent
@@ -1438,7 +1432,7 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata )
1438 // step a fraction in the negative directiona 1432 // step a fraction in the negative directiona
1439 F32 new_weight = current_weight - (range / 10.f); 1433 F32 new_weight = current_weight - (range / 10.f);
1440 F32 new_percent = self->weightToPercent(new_weight); 1434 F32 new_percent = self->weightToPercent(new_weight);
1441 LLSliderCtrl* slider = LLUICtrlFactory::getSliderByName(self, "param slider"); 1435 LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
1442 if (slider) 1436 if (slider)
1443 { 1437 {
1444 if (slider->getMinValue() < new_percent 1438 if (slider->getMinValue() < new_percent
@@ -1476,7 +1470,7 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata )
1476 // step a fraction in the negative direction 1470 // step a fraction in the negative direction
1477 F32 new_weight = current_weight + (range / 10.f); 1471 F32 new_weight = current_weight + (range / 10.f);
1478 F32 new_percent = self->weightToPercent(new_weight); 1472 F32 new_percent = self->weightToPercent(new_weight);
1479 LLSliderCtrl* slider = LLUICtrlFactory::getSliderByName(self, "param slider"); 1473 LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
1480 if (slider) 1474 if (slider)
1481 { 1475 {
1482 if (slider->getMinValue() < new_percent 1476 if (slider->getMinValue() < new_percent
@@ -1559,7 +1553,7 @@ LLFloaterCustomize::LLFloaterCustomize()
1559 factory_map["Underpants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERPANTS) ) ); 1553 factory_map["Underpants"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_UNDERPANTS) ) );
1560 factory_map["Skirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SKIRT) ) ); 1554 factory_map["Skirt"] = LLCallbackMap(createWearablePanel, (void*)(new WearablePanelData(this, WT_SKIRT) ) );
1561 1555
1562 gUICtrlFactory->buildFloater(this, "floater_customize.xml", &factory_map); 1556 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_customize.xml", &factory_map);
1563 1557
1564} 1558}
1565 1559
@@ -1590,7 +1584,7 @@ BOOL LLFloaterCustomize::postBuild()
1590 // Remove underwear panels for teens 1584 // Remove underwear panels for teens
1591 if (gAgent.isTeen()) 1585 if (gAgent.isTeen())
1592 { 1586 {
1593 LLTabContainer* tab_container = LLUICtrlFactory::getTabContainerByName(this, "customize tab container"); 1587 LLTabContainer* tab_container = getChild<LLTabContainer>("customize tab container");
1594 if (tab_container) 1588 if (tab_container)
1595 { 1589 {
1596 LLPanel* panel; 1590 LLPanel* panel;
@@ -2123,18 +2117,15 @@ void LLFloaterCustomize::draw()
2123 2117
2124 // only do this if we are in the customize avatar mode 2118 // only do this if we are in the customize avatar mode
2125 // and not transitioning into or out of it 2119 // and not transitioning into or out of it
2126 if( getVisible() ) 2120 // *TODO: This is a sort of expensive call, which only needs
2127 { 2121 // to be called when the tabs change or an inventory item
2128 // *TODO: This is a sort of expensive call, which only needs 2122 // arrives. Figure out some way to avoid this if possible.
2129 // to be called when the tabs change or an inventory item 2123 updateInventoryUI();
2130 // arrives. Figure out some way to avoid this if possible.
2131 updateInventoryUI();
2132 2124
2133 LLScrollingPanelParam::sUpdateDelayFrames = 0; 2125 LLScrollingPanelParam::sUpdateDelayFrames = 0;
2134 2126
2135 childSetEnabled("Save All", isDirty() ); 2127 childSetEnabled("Save All", isDirty() );
2136 LLFloater::draw(); 2128 LLFloater::draw();
2137 }
2138} 2129}
2139 2130
2140BOOL LLFloaterCustomize::isDirty() const 2131BOOL LLFloaterCustomize::isDirty() const
@@ -2179,7 +2170,7 @@ const S32 HEADER_HEIGHT = 3 * (LINE_HEIGHT + LLFLOATER_VPAD) + (2 * LLPANEL_BORD
2179void LLFloaterCustomize::initScrollingPanelList() 2170void LLFloaterCustomize::initScrollingPanelList()
2180{ 2171{
2181 LLScrollableContainerView* scroll_container = 2172 LLScrollableContainerView* scroll_container =
2182 LLUICtrlFactory::getScrollableContainerByName(this, "panel_container"); 2173 getChild<LLScrollableContainerView>("panel_container");
2183 // LLScrollingPanelList's do not import correctly 2174 // LLScrollingPanelList's do not import correctly
2184// mScrollingPanelList = LLUICtrlFactory::getScrollingPanelList(this, "panel_list"); 2175// mScrollingPanelList = LLUICtrlFactory::getScrollingPanelList(this, "panel_list");
2185 mScrollingPanelList = new LLScrollingPanelList("panel_list", LLRect()); 2176 mScrollingPanelList = new LLScrollingPanelList("panel_list", LLRect());