diff options
Diffstat (limited to 'linden/indra/newview/llinventoryview.cpp')
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 520 |
1 files changed, 404 insertions, 116 deletions
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index f9dd70d..52c3b7e 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "llradiogroup.h" | 44 | #include "llradiogroup.h" |
45 | #include "llspinctrl.h" | 45 | #include "llspinctrl.h" |
46 | #include "lltextbox.h" | 46 | #include "lltextbox.h" |
47 | #include "llcombobox.h" | ||
47 | #include "llui.h" | 48 | #include "llui.h" |
48 | 49 | ||
49 | #include "llfirstuse.h" | 50 | #include "llfirstuse.h" |
@@ -181,18 +182,19 @@ void LLInventoryViewFinder::updateElementsFromFilter() | |||
181 | 182 | ||
182 | // update the ui elements | 183 | // update the ui elements |
183 | LLFloater::setTitle(mFilter->getName()); | 184 | LLFloater::setTitle(mFilter->getName()); |
184 | childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); | 185 | |
185 | 186 | childSetValue("check_animation", (S32) (filter_types & LLInventoryType::NIT_ANIMATION)); | |
186 | childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); | 187 | childSetValue("check_bodypart", (S32) (filter_types & LLInventoryType::NIT_BODYPART)); |
187 | childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); | 188 | childSetValue("check_calling_card", (S32) (filter_types & LLInventoryType::NIT_CALLCARD)); |
188 | childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); | 189 | childSetValue("check_clothing", (S32) (filter_types & LLInventoryType::NIT_CLOTHING)); |
189 | childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); | 190 | childSetValue("check_gesture", (S32) (filter_types & LLInventoryType::NIT_GESTURE)); |
190 | childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); | 191 | childSetValue("check_landmark", (S32) (filter_types & LLInventoryType::NIT_LANDMARK)); |
191 | childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); | 192 | childSetValue("check_notecard", (S32) (filter_types & LLInventoryType::NIT_NOTECARD)); |
192 | childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); | 193 | childSetValue("check_object", (S32) (filter_types & LLInventoryType::NIT_OBJECT)); |
193 | childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); | 194 | childSetValue("check_script", (S32) (filter_types & LLInventoryType::NIT_SCRIPT_LSL2)); |
194 | childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); | 195 | childSetValue("check_sound", (S32) (filter_types & LLInventoryType::NIT_SOUND)); |
195 | childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); | 196 | childSetValue("check_texture", (S32) (filter_types & LLInventoryType::NIT_TEXTURE)); |
197 | childSetValue("check_snapshot", (S32) (filter_types & LLInventoryType::NIT_SNAPSHOT)); | ||
196 | childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); | 198 | childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); |
197 | childSetValue("check_since_logoff", mFilter->isSinceLogoff()); | 199 | childSetValue("check_since_logoff", mFilter->isSinceLogoff()); |
198 | mSpinSinceHours->set((F32)(hours % 24)); | 200 | mSpinSinceHours->set((F32)(hours % 24)); |
@@ -206,26 +208,31 @@ void LLInventoryViewFinder::draw() | |||
206 | 208 | ||
207 | if (!childGetValue("check_animation")) | 209 | if (!childGetValue("check_animation")) |
208 | { | 210 | { |
209 | filter &= ~(0x1 << LLInventoryType::IT_ANIMATION); | 211 | filter &= ~(LLInventoryType::NIT_ANIMATION); |
210 | filtered_by_all_types = FALSE; | 212 | filtered_by_all_types = FALSE; |
211 | } | 213 | } |
212 | 214 | ||
215 | if (!childGetValue("check_bodypart")) | ||
216 | { | ||
217 | filter &= ~(LLInventoryType::NIT_BODYPART); | ||
218 | filtered_by_all_types = FALSE; | ||
219 | } | ||
213 | 220 | ||
214 | if (!childGetValue("check_calling_card")) | 221 | if (!childGetValue("check_calling_card")) |
215 | { | 222 | { |
216 | filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD); | 223 | filter &= ~(LLInventoryType::NIT_CALLCARD); |
217 | filtered_by_all_types = FALSE; | 224 | filtered_by_all_types = FALSE; |
218 | } | 225 | } |
219 | 226 | ||
220 | if (!childGetValue("check_clothing")) | 227 | if (!childGetValue("check_clothing")) |
221 | { | 228 | { |
222 | filter &= ~(0x1 << LLInventoryType::IT_WEARABLE); | 229 | filter &= ~(LLInventoryType::NIT_CLOTHING); |
223 | filtered_by_all_types = FALSE; | 230 | filtered_by_all_types = FALSE; |
224 | } | 231 | } |
225 | 232 | ||
226 | if (!childGetValue("check_gesture")) | 233 | if (!childGetValue("check_gesture")) |
227 | { | 234 | { |
228 | filter &= ~(0x1 << LLInventoryType::IT_GESTURE); | 235 | filter &= ~(LLInventoryType::NIT_GESTURE); |
229 | filtered_by_all_types = FALSE; | 236 | filtered_by_all_types = FALSE; |
230 | } | 237 | } |
231 | 238 | ||
@@ -233,52 +240,53 @@ void LLInventoryViewFinder::draw() | |||
233 | 240 | ||
234 | 241 | ||
235 | { | 242 | { |
236 | filter &= ~(0x1 << LLInventoryType::IT_LANDMARK); | 243 | filter &= ~(LLInventoryType::NIT_LANDMARK); |
237 | filtered_by_all_types = FALSE; | 244 | filtered_by_all_types = FALSE; |
238 | } | 245 | } |
239 | 246 | ||
240 | if (!childGetValue("check_notecard")) | 247 | if (!childGetValue("check_notecard")) |
241 | { | 248 | { |
242 | filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); | 249 | filter &= ~(LLInventoryType::NIT_NOTECARD); |
243 | filtered_by_all_types = FALSE; | 250 | filtered_by_all_types = FALSE; |
244 | } | 251 | } |
245 | 252 | ||
246 | if (!childGetValue("check_object")) | 253 | if (!childGetValue("check_object")) |
247 | { | 254 | { |
248 | filter &= ~(0x1 << LLInventoryType::IT_OBJECT); | 255 | filter &= ~(LLInventoryType::NIT_OBJECT); |
249 | filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT); | ||
250 | filtered_by_all_types = FALSE; | 256 | filtered_by_all_types = FALSE; |
251 | } | 257 | } |
252 | 258 | ||
253 | if (!childGetValue("check_script")) | 259 | if (!childGetValue("check_script")) |
254 | { | 260 | { |
255 | filter &= ~(0x1 << LLInventoryType::IT_LSL); | 261 | filter &= ~(LLInventoryType::NIT_SCRIPT_LSL2); |
256 | filtered_by_all_types = FALSE; | 262 | filtered_by_all_types = FALSE; |
257 | } | 263 | } |
258 | 264 | ||
259 | if (!childGetValue("check_sound")) | 265 | if (!childGetValue("check_sound")) |
260 | { | 266 | { |
261 | filter &= ~(0x1 << LLInventoryType::IT_SOUND); | 267 | filter &= ~(LLInventoryType::NIT_SOUND); |
262 | filtered_by_all_types = FALSE; | 268 | filtered_by_all_types = FALSE; |
263 | } | 269 | } |
264 | 270 | ||
265 | if (!childGetValue("check_texture")) | 271 | if (!childGetValue("check_texture")) |
266 | { | 272 | { |
267 | filter &= ~(0x1 << LLInventoryType::IT_TEXTURE); | 273 | filter &= ~(LLInventoryType::NIT_TEXTURE); |
268 | filtered_by_all_types = FALSE; | 274 | filtered_by_all_types = FALSE; |
269 | } | 275 | } |
270 | 276 | ||
271 | if (!childGetValue("check_snapshot")) | 277 | if (!childGetValue("check_snapshot")) |
272 | { | 278 | { |
273 | filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT); | 279 | filter &= ~(LLInventoryType::NIT_SNAPSHOT); |
274 | filtered_by_all_types = FALSE; | 280 | filtered_by_all_types = FALSE; |
275 | } | 281 | } |
276 | 282 | ||
283 | /* | ||
277 | if (!filtered_by_all_types) | 284 | if (!filtered_by_all_types) |
278 | { | 285 | { |
279 | // don't include folders in filter, unless I've selected everything | 286 | // don't include folders in filter, unless I've selected everything |
280 | filter &= ~(0x1 << LLInventoryType::IT_CATEGORY); | 287 | filter &= ~(LLInventoryType::NIT_CATEGORY); |
281 | } | 288 | } |
289 | */ | ||
282 | 290 | ||
283 | // update the panel, panel will update the filter | 291 | // update the panel, panel will update the filter |
284 | mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? | 292 | mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? |
@@ -344,6 +352,7 @@ void LLInventoryViewFinder::selectAllTypes(void* user_data) | |||
344 | if(!self) return; | 352 | if(!self) return; |
345 | 353 | ||
346 | self->childSetValue("check_animation", TRUE); | 354 | self->childSetValue("check_animation", TRUE); |
355 | self->childSetValue("check_bodypart", TRUE); | ||
347 | self->childSetValue("check_calling_card", TRUE); | 356 | self->childSetValue("check_calling_card", TRUE); |
348 | self->childSetValue("check_clothing", TRUE); | 357 | self->childSetValue("check_clothing", TRUE); |
349 | self->childSetValue("check_gesture", TRUE); | 358 | self->childSetValue("check_gesture", TRUE); |
@@ -389,6 +398,7 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data) | |||
389 | 398 | ||
390 | 399 | ||
391 | self->childSetValue("check_animation", FALSE); | 400 | self->childSetValue("check_animation", FALSE); |
401 | self->childSetValue("check_bodypart", FALSE); | ||
392 | self->childSetValue("check_calling_card", FALSE); | 402 | self->childSetValue("check_calling_card", FALSE); |
393 | self->childSetValue("check_clothing", FALSE); | 403 | self->childSetValue("check_clothing", FALSE); |
394 | self->childSetValue("check_gesture", FALSE); | 404 | self->childSetValue("check_gesture", FALSE); |
@@ -549,6 +559,12 @@ void LLInventoryView::init(LLInventoryModel* inventory) | |||
549 | mSearchEditor->setSearchCallback(onSearchEdit, this); | 559 | mSearchEditor->setSearchCallback(onSearchEdit, this); |
550 | } | 560 | } |
551 | 561 | ||
562 | mQuickFilterCombo = getChild<LLComboBox>("Quick Filter"); | ||
563 | if (mQuickFilterCombo) | ||
564 | { | ||
565 | mQuickFilterCombo->setCommitCallback(onQuickFilterCommit); | ||
566 | } | ||
567 | |||
552 | sActiveViews.put(this); | 568 | sActiveViews.put(this); |
553 | 569 | ||
554 | gInventory.addObserver(this); | 570 | gInventory.addObserver(this); |
@@ -617,6 +633,11 @@ void LLInventoryView::draw() | |||
617 | { | 633 | { |
618 | mSearchEditor->setText(mActivePanel->getFilterSubString()); | 634 | mSearchEditor->setText(mActivePanel->getFilterSubString()); |
619 | } | 635 | } |
636 | if (mActivePanel && mQuickFilterCombo) | ||
637 | { | ||
638 | refreshQuickFilter( mQuickFilterCombo ); | ||
639 | } | ||
640 | |||
620 | LLFloater::draw(); | 641 | LLFloater::draw(); |
621 | } | 642 | } |
622 | 643 | ||
@@ -922,16 +943,9 @@ void LLInventoryView::onClearSearch(void* user_data) | |||
922 | LLInventoryView* self = (LLInventoryView*)user_data; | 943 | LLInventoryView* self = (LLInventoryView*)user_data; |
923 | if(!self) return; | 944 | if(!self) return; |
924 | 945 | ||
925 | LLFloater *finder = self->getFinder(); | ||
926 | if (self->mActivePanel) | 946 | if (self->mActivePanel) |
927 | { | 947 | { |
928 | self->mActivePanel->setFilterSubString(LLStringUtil::null); | 948 | self->mActivePanel->setFilterSubString(LLStringUtil::null); |
929 | self->mActivePanel->setFilterTypes(0xffffffff); | ||
930 | } | ||
931 | |||
932 | if (finder) | ||
933 | { | ||
934 | LLInventoryViewFinder::selectAllTypes(finder); | ||
935 | } | 949 | } |
936 | 950 | ||
937 | // re-open folders that were initially open | 951 | // re-open folders that were initially open |
@@ -981,6 +995,241 @@ void LLInventoryView::onSearchEdit(const std::string& search_string, void* user_ | |||
981 | } | 995 | } |
982 | 996 | ||
983 | 997 | ||
998 | //static | ||
999 | void LLInventoryView::onQuickFilterCommit(LLUICtrl* ctrl, void* user_data) | ||
1000 | { | ||
1001 | |||
1002 | LLComboBox* quickfilter = (LLComboBox*)ctrl; | ||
1003 | |||
1004 | |||
1005 | LLInventoryView* view = (LLInventoryView*)(quickfilter->getParent()); | ||
1006 | if (!view->mActivePanel) | ||
1007 | { | ||
1008 | return; | ||
1009 | } | ||
1010 | |||
1011 | |||
1012 | std::string item_type = quickfilter->getSimple(); | ||
1013 | U32 filter_type; | ||
1014 | |||
1015 | if (view->getString("filter_type_animation") == item_type) | ||
1016 | { | ||
1017 | filter_type = LLInventoryType::NIT_ANIMATION; | ||
1018 | } | ||
1019 | |||
1020 | else if (view->getString("filter_type_bodypart") == item_type) | ||
1021 | { | ||
1022 | filter_type = LLInventoryType::NIT_BODYPART; | ||
1023 | } | ||
1024 | |||
1025 | else if (view->getString("filter_type_callingcard") == item_type) | ||
1026 | { | ||
1027 | filter_type = LLInventoryType::NIT_CALLCARD; | ||
1028 | } | ||
1029 | |||
1030 | else if (view->getString("filter_type_clothing") == item_type) | ||
1031 | { | ||
1032 | filter_type = LLInventoryType::NIT_CLOTHING; | ||
1033 | } | ||
1034 | |||
1035 | else if (view->getString("filter_type_gesture") == item_type) | ||
1036 | { | ||
1037 | filter_type = LLInventoryType::NIT_GESTURE; | ||
1038 | } | ||
1039 | |||
1040 | else if (view->getString("filter_type_landmark") == item_type) | ||
1041 | { | ||
1042 | filter_type = LLInventoryType::NIT_LANDMARK; | ||
1043 | } | ||
1044 | |||
1045 | else if (view->getString("filter_type_notecard") == item_type) | ||
1046 | { | ||
1047 | filter_type = LLInventoryType::NIT_NOTECARD; | ||
1048 | } | ||
1049 | |||
1050 | else if (view->getString("filter_type_object") == item_type) | ||
1051 | { | ||
1052 | filter_type = LLInventoryType::NIT_OBJECT; | ||
1053 | } | ||
1054 | |||
1055 | else if (view->getString("filter_type_script") == item_type) | ||
1056 | { | ||
1057 | filter_type = LLInventoryType::NIT_SCRIPT_LSL2; | ||
1058 | } | ||
1059 | |||
1060 | else if (view->getString("filter_type_sound") == item_type) | ||
1061 | { | ||
1062 | filter_type = LLInventoryType::NIT_SOUND; | ||
1063 | } | ||
1064 | |||
1065 | else if (view->getString("filter_type_texture") == item_type) | ||
1066 | { | ||
1067 | filter_type = LLInventoryType::NIT_TEXTURE; | ||
1068 | } | ||
1069 | |||
1070 | else if (view->getString("filter_type_snapshot") == item_type) | ||
1071 | { | ||
1072 | filter_type = LLInventoryType::NIT_SNAPSHOT; | ||
1073 | } | ||
1074 | |||
1075 | else if (view->getString("filter_type_custom") == item_type) | ||
1076 | { | ||
1077 | // When they select custom, show the floater then return | ||
1078 | if( !(view->filtersVisible(view)) ) | ||
1079 | { | ||
1080 | view->toggleFindOptions(); | ||
1081 | } | ||
1082 | return; | ||
1083 | } | ||
1084 | |||
1085 | else if (view->getString("filter_type_all") == item_type) | ||
1086 | { | ||
1087 | // Show all types | ||
1088 | filter_type = 0xffffffff; | ||
1089 | } | ||
1090 | |||
1091 | else | ||
1092 | { | ||
1093 | llwarns << "Ignoring unknown filter: " << item_type << llendl; | ||
1094 | return; | ||
1095 | } | ||
1096 | |||
1097 | view->mActivePanel->setFilterTypes( filter_type ); | ||
1098 | |||
1099 | // Start fetching inventory in the background, so we have | ||
1100 | // some items to show the user. | ||
1101 | gInventory.startBackgroundFetch(); | ||
1102 | |||
1103 | // Update the Inventory window text | ||
1104 | view->setFilterTextFromFilter(); | ||
1105 | |||
1106 | // Force the filters window to update itself, if it's open. | ||
1107 | LLInventoryViewFinder* finder = view->getFinder(); | ||
1108 | if( finder ) | ||
1109 | { | ||
1110 | finder->updateElementsFromFilter(); | ||
1111 | } | ||
1112 | |||
1113 | // llinfos << "Quick Filter: " << item_type << llendl; | ||
1114 | |||
1115 | } | ||
1116 | |||
1117 | |||
1118 | |||
1119 | //static | ||
1120 | void LLInventoryView::refreshQuickFilter(LLUICtrl* ctrl) | ||
1121 | { | ||
1122 | |||
1123 | LLInventoryView* view = (LLInventoryView*)(ctrl->getParent()); | ||
1124 | if (!view->mActivePanel) | ||
1125 | { | ||
1126 | return; | ||
1127 | } | ||
1128 | |||
1129 | LLComboBox* quickfilter = view->getChild<LLComboBox>("Quick Filter"); | ||
1130 | if (!quickfilter) | ||
1131 | { | ||
1132 | return; | ||
1133 | } | ||
1134 | |||
1135 | |||
1136 | U32 filter_type = view->mActivePanel->getFilterTypes(); | ||
1137 | filter_type &= LLInventoryType::NIT_ALL; | ||
1138 | |||
1139 | |||
1140 | //llinfos << "filter_type: " << filter_type << llendl; | ||
1141 | |||
1142 | std::string selection; | ||
1143 | |||
1144 | |||
1145 | if (filter_type == LLInventoryType::NIT_ALL) | ||
1146 | { | ||
1147 | selection = view->getString("filter_type_all"); | ||
1148 | } | ||
1149 | |||
1150 | else if (filter_type == LLInventoryType::NIT_NONE) | ||
1151 | { | ||
1152 | selection = view->getString("filter_type_custom"); | ||
1153 | } | ||
1154 | |||
1155 | else if (filter_type == (filter_type & LLInventoryType::NIT_ANIMATION)) | ||
1156 | { | ||
1157 | selection = view->getString("filter_type_animation"); | ||
1158 | } | ||
1159 | |||
1160 | else if (filter_type == (filter_type & LLInventoryType::NIT_BODYPART)) | ||
1161 | { | ||
1162 | selection = view->getString("filter_type_bodypart"); | ||
1163 | } | ||
1164 | |||
1165 | else if (filter_type == (filter_type & LLInventoryType::NIT_CALLCARD)) | ||
1166 | { | ||
1167 | selection = view->getString("filter_type_callingcard"); | ||
1168 | } | ||
1169 | |||
1170 | else if (filter_type == (filter_type & LLInventoryType::NIT_CLOTHING)) | ||
1171 | { | ||
1172 | selection = view->getString("filter_type_clothing"); | ||
1173 | } | ||
1174 | |||
1175 | else if (filter_type == (filter_type & LLInventoryType::NIT_GESTURE)) | ||
1176 | { | ||
1177 | selection = view->getString("filter_type_gesture"); | ||
1178 | } | ||
1179 | |||
1180 | else if (filter_type == (filter_type & LLInventoryType::NIT_LANDMARK)) | ||
1181 | { | ||
1182 | selection = view->getString("filter_type_landmark"); | ||
1183 | } | ||
1184 | |||
1185 | else if (filter_type == (filter_type & LLInventoryType::NIT_NOTECARD)) | ||
1186 | { | ||
1187 | selection = view->getString("filter_type_notecard"); | ||
1188 | } | ||
1189 | |||
1190 | else if (filter_type == (filter_type & LLInventoryType::NIT_OBJECT)) | ||
1191 | { | ||
1192 | selection = view->getString("filter_type_object"); | ||
1193 | } | ||
1194 | |||
1195 | else if (filter_type == (filter_type & LLInventoryType::NIT_SCRIPT_LSL2)) | ||
1196 | { | ||
1197 | selection = view->getString("filter_type_script"); | ||
1198 | } | ||
1199 | |||
1200 | else if (filter_type == (filter_type & LLInventoryType::NIT_SOUND)) | ||
1201 | { | ||
1202 | selection = view->getString("filter_type_sound"); | ||
1203 | } | ||
1204 | |||
1205 | else if (filter_type == (filter_type & LLInventoryType::NIT_TEXTURE)) | ||
1206 | { | ||
1207 | selection = view->getString("filter_type_texture"); | ||
1208 | } | ||
1209 | |||
1210 | else if (filter_type == (filter_type & LLInventoryType::NIT_SNAPSHOT)) | ||
1211 | { | ||
1212 | selection = view->getString("filter_type_snapshot"); | ||
1213 | } | ||
1214 | |||
1215 | else | ||
1216 | { | ||
1217 | selection = view->getString("filter_type_custom"); | ||
1218 | } | ||
1219 | |||
1220 | |||
1221 | // Select the chosen item by label text | ||
1222 | BOOL result = quickfilter->setSimple( (selection) ); | ||
1223 | |||
1224 | if( !result ) | ||
1225 | { | ||
1226 | llinfos << "The item didn't exist: " << selection << llendl; | ||
1227 | } | ||
1228 | |||
1229 | } | ||
1230 | |||
1231 | |||
1232 | |||
984 | // static | 1233 | // static |
985 | // BOOL LLInventoryView::incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward) | 1234 | // BOOL LLInventoryView::incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward) |
986 | // { | 1235 | // { |
@@ -1079,124 +1328,163 @@ BOOL LLInventoryView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | |||
1079 | 1328 | ||
1080 | return handled; | 1329 | return handled; |
1081 | } | 1330 | } |
1331 | |||
1082 | std::string get_item_icon_name(LLAssetType::EType asset_type, | 1332 | std::string get_item_icon_name(LLAssetType::EType asset_type, |
1083 | LLInventoryType::EType inventory_type, | 1333 | LLInventoryType::EType inv_type, |
1084 | U32 attachment_point, | 1334 | U32 flags, |
1085 | BOOL item_is_multi ) | 1335 | BOOL item_is_multi ) |
1336 | { | ||
1337 | return get_item_icon_name( calc_ntype(inv_type, asset_type, flags), | ||
1338 | item_is_multi ); | ||
1339 | } | ||
1340 | |||
1341 | std::string get_item_icon_name(LLInventoryType::NType inv_ntype, | ||
1342 | BOOL item_is_multi ) | ||
1086 | { | 1343 | { |
1087 | EInventoryIcon idx = OBJECT_ICON_NAME; | 1344 | EInventoryIcon idx = OBJECT_ICON_NAME; |
1088 | if ( item_is_multi ) | 1345 | |
1089 | { | 1346 | switch( inv_ntype ) |
1090 | idx = OBJECT_MULTI_ICON_NAME; | ||
1091 | } | ||
1092 | |||
1093 | switch(asset_type) | ||
1094 | { | 1347 | { |
1095 | case LLAssetType::AT_TEXTURE: | 1348 | // BODY PARTS |
1096 | if(LLInventoryType::IT_SNAPSHOT == inventory_type) | ||
1097 | { | ||
1098 | idx = SNAPSHOT_ICON_NAME; | ||
1099 | } | ||
1100 | else | ||
1101 | { | ||
1102 | idx = TEXTURE_ICON_NAME; | ||
1103 | } | ||
1104 | break; | ||
1105 | 1349 | ||
1106 | case LLAssetType::AT_SOUND: | 1350 | case LLInventoryType::NIT_SHAPE: |
1107 | idx = SOUND_ICON_NAME; | ||
1108 | break; | ||
1109 | case LLAssetType::AT_CALLINGCARD: | ||
1110 | if(attachment_point!= 0) | ||
1111 | { | ||
1112 | idx = CALLINGCARD_ONLINE_ICON_NAME; | ||
1113 | } | ||
1114 | else | ||
1115 | { | ||
1116 | idx = CALLINGCARD_OFFLINE_ICON_NAME; | ||
1117 | } | ||
1118 | break; | ||
1119 | case LLAssetType::AT_LANDMARK: | ||
1120 | if(attachment_point!= 0) | ||
1121 | { | ||
1122 | idx = LANDMARK_VISITED_ICON_NAME; | ||
1123 | } | ||
1124 | else | ||
1125 | { | ||
1126 | idx = LANDMARK_ICON_NAME; | ||
1127 | } | ||
1128 | break; | ||
1129 | case LLAssetType::AT_SCRIPT: | ||
1130 | case LLAssetType::AT_LSL_TEXT: | ||
1131 | case LLAssetType::AT_LSL_BYTECODE: | ||
1132 | idx = SCRIPT_ICON_NAME; | ||
1133 | break; | ||
1134 | case LLAssetType::AT_CLOTHING: | ||
1135 | idx = CLOTHING_ICON_NAME; | ||
1136 | case LLAssetType::AT_BODYPART : | ||
1137 | if(LLAssetType::AT_BODYPART == asset_type) | ||
1138 | { | ||
1139 | idx = BODYPART_ICON_NAME; | ||
1140 | } | ||
1141 | switch(attachment_point) | ||
1142 | { | ||
1143 | case WT_SHAPE: | ||
1144 | idx = BODYPART_SHAPE_ICON_NAME; | 1351 | idx = BODYPART_SHAPE_ICON_NAME; |
1145 | break; | 1352 | break; |
1146 | case WT_SKIN: | 1353 | case LLInventoryType::NIT_SKIN: |
1147 | idx = BODYPART_SKIN_ICON_NAME; | 1354 | idx = BODYPART_SKIN_ICON_NAME; |
1148 | break; | 1355 | break; |
1149 | case WT_HAIR: | 1356 | case LLInventoryType::NIT_HAIR: |
1150 | idx = BODYPART_HAIR_ICON_NAME; | 1357 | idx = BODYPART_HAIR_ICON_NAME; |
1151 | break; | 1358 | break; |
1152 | case WT_EYES: | 1359 | case LLInventoryType::NIT_EYES: |
1153 | idx = BODYPART_EYES_ICON_NAME; | 1360 | idx = BODYPART_EYES_ICON_NAME; |
1154 | break; | 1361 | break; |
1155 | case WT_SHIRT: | 1362 | |
1363 | case LLInventoryType::NIT_BODYPART: | ||
1364 | idx = BODYPART_ICON_NAME; | ||
1365 | break; | ||
1366 | |||
1367 | |||
1368 | // CLOTHING | ||
1369 | |||
1370 | case LLInventoryType::NIT_SHIRT: | ||
1156 | idx = CLOTHING_SHIRT_ICON_NAME; | 1371 | idx = CLOTHING_SHIRT_ICON_NAME; |
1157 | break; | 1372 | break; |
1158 | case WT_PANTS: | 1373 | case LLInventoryType::NIT_PANTS: |
1159 | idx = CLOTHING_PANTS_ICON_NAME; | 1374 | idx = CLOTHING_PANTS_ICON_NAME; |
1160 | break; | 1375 | break; |
1161 | case WT_SHOES: | 1376 | case LLInventoryType::NIT_SHOES: |
1162 | idx = CLOTHING_SHOES_ICON_NAME; | 1377 | idx = CLOTHING_SHOES_ICON_NAME; |
1163 | break; | 1378 | break; |
1164 | case WT_SOCKS: | 1379 | case LLInventoryType::NIT_SOCKS: |
1165 | idx = CLOTHING_SOCKS_ICON_NAME; | 1380 | idx = CLOTHING_SOCKS_ICON_NAME; |
1166 | break; | 1381 | break; |
1167 | case WT_JACKET: | 1382 | case LLInventoryType::NIT_JACKET: |
1168 | idx = CLOTHING_JACKET_ICON_NAME; | 1383 | idx = CLOTHING_JACKET_ICON_NAME; |
1169 | break; | 1384 | break; |
1170 | case WT_GLOVES: | 1385 | case LLInventoryType::NIT_GLOVES: |
1171 | idx = CLOTHING_GLOVES_ICON_NAME; | 1386 | idx = CLOTHING_GLOVES_ICON_NAME; |
1172 | break; | 1387 | break; |
1173 | case WT_UNDERSHIRT: | 1388 | case LLInventoryType::NIT_UNDERSHIRT: |
1174 | idx = CLOTHING_UNDERSHIRT_ICON_NAME; | 1389 | idx = CLOTHING_UNDERSHIRT_ICON_NAME; |
1175 | break; | 1390 | break; |
1176 | case WT_UNDERPANTS: | 1391 | case LLInventoryType::NIT_UNDERPANTS: |
1177 | idx = CLOTHING_UNDERPANTS_ICON_NAME; | 1392 | idx = CLOTHING_UNDERPANTS_ICON_NAME; |
1178 | break; | 1393 | break; |
1179 | case WT_SKIRT: | 1394 | case LLInventoryType::NIT_SKIRT: |
1180 | idx = CLOTHING_SKIRT_ICON_NAME; | 1395 | idx = CLOTHING_SKIRT_ICON_NAME; |
1181 | break; | 1396 | break; |
1397 | |||
1398 | case LLInventoryType::NIT_CLOTHING: | ||
1399 | idx = CLOTHING_ICON_NAME; | ||
1400 | break; | ||
1401 | |||
1402 | |||
1403 | // TEXTURES / SNAPSHOTS | ||
1404 | |||
1405 | case LLInventoryType::NIT_SNAPSHOT: | ||
1406 | idx = SNAPSHOT_ICON_NAME; | ||
1407 | break; | ||
1408 | case LLInventoryType::NIT_TEXTURE: | ||
1409 | case LLInventoryType::NIT_IMAGE: | ||
1410 | idx = TEXTURE_ICON_NAME; | ||
1411 | break; | ||
1412 | |||
1413 | |||
1414 | // CALLING CARDS | ||
1415 | |||
1416 | case LLInventoryType::NIT_CALLCARD_ON: | ||
1417 | idx = CALLINGCARD_ONLINE_ICON_NAME; | ||
1418 | break; | ||
1419 | case LLInventoryType::NIT_CALLCARD_OFF: | ||
1420 | case LLInventoryType::NIT_CALLCARD: | ||
1421 | idx = CALLINGCARD_OFFLINE_ICON_NAME; | ||
1422 | break; | ||
1423 | |||
1424 | |||
1425 | // LANDMARKS | ||
1426 | |||
1427 | case LLInventoryType::NIT_LANDMARK_USED: | ||
1428 | idx = LANDMARK_VISITED_ICON_NAME; | ||
1429 | break; | ||
1430 | case LLInventoryType::NIT_LANDMARK_UNUSED: | ||
1431 | case LLInventoryType::NIT_LANDMARK: | ||
1432 | idx = LANDMARK_ICON_NAME; | ||
1433 | break; | ||
1434 | |||
1435 | |||
1436 | // SOUNDS | ||
1437 | |||
1438 | case LLInventoryType::NIT_SOUND: | ||
1439 | idx = SOUND_ICON_NAME; | ||
1440 | break; | ||
1441 | |||
1442 | |||
1443 | // ANIMATIONS | ||
1444 | |||
1445 | case LLInventoryType::NIT_ANIMATION: | ||
1446 | idx = ANIMATION_ICON_NAME; | ||
1447 | break; | ||
1448 | |||
1449 | |||
1450 | // GESTURES | ||
1451 | |||
1452 | case LLInventoryType::NIT_GESTURE: | ||
1453 | idx = GESTURE_ICON_NAME; | ||
1454 | break; | ||
1455 | |||
1456 | |||
1457 | // NOTECARD | ||
1458 | |||
1459 | case LLInventoryType::NIT_NOTECARD: | ||
1460 | idx = NOTECARD_ICON_NAME; | ||
1461 | break; | ||
1462 | |||
1463 | |||
1464 | // SCRIPTS | ||
1465 | |||
1466 | case LLInventoryType::NIT_SCRIPT_LSL2: | ||
1467 | idx = SCRIPT_ICON_NAME; | ||
1468 | break; | ||
1469 | |||
1470 | |||
1471 | // OBJECTS | ||
1472 | |||
1473 | case LLInventoryType::NIT_OBJECT: | ||
1474 | if( item_is_multi ) | ||
1475 | { | ||
1476 | idx = OBJECT_MULTI_ICON_NAME; | ||
1477 | } | ||
1478 | else | ||
1479 | { | ||
1480 | idx = OBJECT_ICON_NAME; | ||
1481 | } | ||
1482 | break; | ||
1483 | |||
1182 | default: | 1484 | default: |
1183 | // no-op, go with choice above | ||
1184 | break; | 1485 | break; |
1185 | } | ||
1186 | break; | ||
1187 | case LLAssetType::AT_NOTECARD: | ||
1188 | idx = NOTECARD_ICON_NAME; | ||
1189 | break; | ||
1190 | case LLAssetType::AT_ANIMATION: | ||
1191 | idx = ANIMATION_ICON_NAME; | ||
1192 | break; | ||
1193 | case LLAssetType::AT_GESTURE: | ||
1194 | idx = GESTURE_ICON_NAME; | ||
1195 | break; | ||
1196 | default: | ||
1197 | break; | ||
1198 | } | 1486 | } |
1199 | 1487 | ||
1200 | return ICON_NAME[idx]; | 1488 | return ICON_NAME[idx]; |
1201 | } | 1489 | } |
1202 | 1490 | ||