diff options
author | Jacek Antonelli | 2008-12-10 18:06:05 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-10 18:06:05 -0600 |
commit | c367383dae246884d1c9ed4ee2b2d184e6b2f72c (patch) | |
tree | 265dff690f52c7d67e18e52776723109cae5987b /linden/indra/newview | |
parent | Clearing search shouldn't clear filter type. (diff) | |
download | meta-impy-c367383dae246884d1c9ed4ee2b2d184e6b2f72c.zip meta-impy-c367383dae246884d1c9ed4ee2b2d184e6b2f72c.tar.gz meta-impy-c367383dae246884d1c9ed4ee2b2d184e6b2f72c.tar.bz2 meta-impy-c367383dae246884d1c9ed4ee2b2d184e6b2f72c.tar.xz |
Use NType to find inventory icon name (part 1 of 2).
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 125 | ||||
-rw-r--r-- | linden/indra/newview/llinventoryview.h | 3 |
2 files changed, 14 insertions, 114 deletions
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 7ea06a0..e218202 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -1328,124 +1328,21 @@ BOOL LLInventoryView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | |||
1328 | 1328 | ||
1329 | return handled; | 1329 | return handled; |
1330 | } | 1330 | } |
1331 | |||
1331 | std::string get_item_icon_name(LLAssetType::EType asset_type, | 1332 | std::string get_item_icon_name(LLAssetType::EType asset_type, |
1332 | LLInventoryType::EType inventory_type, | 1333 | LLInventoryType::EType inv_type, |
1333 | U32 attachment_point, | 1334 | U32 flags, |
1334 | 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 ) | ||
1335 | { | 1343 | { |
1336 | EInventoryIcon idx = OBJECT_ICON_NAME; | 1344 | EInventoryIcon idx = OBJECT_ICON_NAME; |
1337 | if ( item_is_multi ) | ||
1338 | { | ||
1339 | idx = OBJECT_MULTI_ICON_NAME; | ||
1340 | } | ||
1341 | |||
1342 | switch(asset_type) | ||
1343 | { | ||
1344 | case LLAssetType::AT_TEXTURE: | ||
1345 | if(LLInventoryType::IT_SNAPSHOT == inventory_type) | ||
1346 | { | ||
1347 | idx = SNAPSHOT_ICON_NAME; | ||
1348 | } | ||
1349 | else | ||
1350 | { | ||
1351 | idx = TEXTURE_ICON_NAME; | ||
1352 | } | ||
1353 | break; | ||
1354 | 1345 | ||
1355 | case LLAssetType::AT_SOUND: | ||
1356 | idx = SOUND_ICON_NAME; | ||
1357 | break; | ||
1358 | case LLAssetType::AT_CALLINGCARD: | ||
1359 | if(attachment_point!= 0) | ||
1360 | { | ||
1361 | idx = CALLINGCARD_ONLINE_ICON_NAME; | ||
1362 | } | ||
1363 | else | ||
1364 | { | ||
1365 | idx = CALLINGCARD_OFFLINE_ICON_NAME; | ||
1366 | } | ||
1367 | break; | ||
1368 | case LLAssetType::AT_LANDMARK: | ||
1369 | if(attachment_point!= 0) | ||
1370 | { | ||
1371 | idx = LANDMARK_VISITED_ICON_NAME; | ||
1372 | } | ||
1373 | else | ||
1374 | { | ||
1375 | idx = LANDMARK_ICON_NAME; | ||
1376 | } | ||
1377 | break; | ||
1378 | case LLAssetType::AT_SCRIPT: | ||
1379 | case LLAssetType::AT_LSL_TEXT: | ||
1380 | case LLAssetType::AT_LSL_BYTECODE: | ||
1381 | idx = SCRIPT_ICON_NAME; | ||
1382 | break; | ||
1383 | case LLAssetType::AT_CLOTHING: | ||
1384 | idx = CLOTHING_ICON_NAME; | ||
1385 | case LLAssetType::AT_BODYPART : | ||
1386 | if(LLAssetType::AT_BODYPART == asset_type) | ||
1387 | { | ||
1388 | idx = BODYPART_ICON_NAME; | ||
1389 | } | ||
1390 | switch(attachment_point) | ||
1391 | { | ||
1392 | case WT_SHAPE: | ||
1393 | idx = BODYPART_SHAPE_ICON_NAME; | ||
1394 | break; | ||
1395 | case WT_SKIN: | ||
1396 | idx = BODYPART_SKIN_ICON_NAME; | ||
1397 | break; | ||
1398 | case WT_HAIR: | ||
1399 | idx = BODYPART_HAIR_ICON_NAME; | ||
1400 | break; | ||
1401 | case WT_EYES: | ||
1402 | idx = BODYPART_EYES_ICON_NAME; | ||
1403 | break; | ||
1404 | case WT_SHIRT: | ||
1405 | idx = CLOTHING_SHIRT_ICON_NAME; | ||
1406 | break; | ||
1407 | case WT_PANTS: | ||
1408 | idx = CLOTHING_PANTS_ICON_NAME; | ||
1409 | break; | ||
1410 | case WT_SHOES: | ||
1411 | idx = CLOTHING_SHOES_ICON_NAME; | ||
1412 | break; | ||
1413 | case WT_SOCKS: | ||
1414 | idx = CLOTHING_SOCKS_ICON_NAME; | ||
1415 | break; | ||
1416 | case WT_JACKET: | ||
1417 | idx = CLOTHING_JACKET_ICON_NAME; | ||
1418 | break; | ||
1419 | case WT_GLOVES: | ||
1420 | idx = CLOTHING_GLOVES_ICON_NAME; | ||
1421 | break; | ||
1422 | case WT_UNDERSHIRT: | ||
1423 | idx = CLOTHING_UNDERSHIRT_ICON_NAME; | ||
1424 | break; | ||
1425 | case WT_UNDERPANTS: | ||
1426 | idx = CLOTHING_UNDERPANTS_ICON_NAME; | ||
1427 | break; | ||
1428 | case WT_SKIRT: | ||
1429 | idx = CLOTHING_SKIRT_ICON_NAME; | ||
1430 | break; | ||
1431 | default: | ||
1432 | // no-op, go with choice above | ||
1433 | break; | ||
1434 | } | ||
1435 | break; | ||
1436 | case LLAssetType::AT_NOTECARD: | ||
1437 | idx = NOTECARD_ICON_NAME; | ||
1438 | break; | ||
1439 | case LLAssetType::AT_ANIMATION: | ||
1440 | idx = ANIMATION_ICON_NAME; | ||
1441 | break; | ||
1442 | case LLAssetType::AT_GESTURE: | ||
1443 | idx = GESTURE_ICON_NAME; | ||
1444 | break; | ||
1445 | default: | ||
1446 | break; | ||
1447 | } | ||
1448 | |||
1449 | return ICON_NAME[idx]; | 1346 | return ICON_NAME[idx]; |
1450 | } | 1347 | } |
1451 | 1348 | ||
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index cce30aa..80e5768 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h | |||
@@ -348,6 +348,9 @@ std::string get_item_icon_name(LLAssetType::EType asset_type, | |||
348 | U32 attachment_point, | 348 | U32 attachment_point, |
349 | BOOL item_is_multi ); | 349 | BOOL item_is_multi ); |
350 | 350 | ||
351 | std::string get_item_icon_name(LLInventoryType::NType inv_ntype, | ||
352 | BOOL item_is_multi ); | ||
353 | |||
351 | LLUIImagePtr get_item_icon(LLAssetType::EType asset_type, | 354 | LLUIImagePtr get_item_icon(LLAssetType::EType asset_type, |
352 | LLInventoryType::EType inventory_type, | 355 | LLInventoryType::EType inventory_type, |
353 | U32 attachment_point, | 356 | U32 attachment_point, |