diff options
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 131 | ||||
-rw-r--r-- | linden/indra/newview/llinventoryview.h | 7 | ||||
-rw-r--r-- | linden/indra/newview/llpanelgroupnotices.cpp | 6 |
3 files changed, 141 insertions, 3 deletions
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 7be1542..e6041c4 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -1585,6 +1585,137 @@ std::string get_item_icon_name(LLInventoryType::NType inv_ntype, | |||
1585 | return ICON_NAME[idx]; | 1585 | return ICON_NAME[idx]; |
1586 | } | 1586 | } |
1587 | 1587 | ||
1588 | std::string get_item_icon_name(LLAssetType::EType asset_type, | ||
1589 | LLInventoryType::NType inv_ntype, | ||
1590 | U32 flags, | ||
1591 | BOOL item_is_multi) | ||
1592 | { | ||
1593 | EInventoryIcon idx = OBJECT_ICON_NAME; | ||
1594 | if ( item_is_multi ) | ||
1595 | { | ||
1596 | idx = OBJECT_MULTI_ICON_NAME; | ||
1597 | } | ||
1598 | |||
1599 | switch(asset_type) | ||
1600 | { | ||
1601 | case LLAssetType::AT_TEXTURE: | ||
1602 | if(LLInventoryType::NIT_SNAPSHOT == inv_ntype) | ||
1603 | { | ||
1604 | idx = SNAPSHOT_ICON_NAME; | ||
1605 | } | ||
1606 | else | ||
1607 | { | ||
1608 | idx = TEXTURE_ICON_NAME; | ||
1609 | } | ||
1610 | break; | ||
1611 | |||
1612 | case LLAssetType::AT_SOUND: | ||
1613 | idx = SOUND_ICON_NAME; | ||
1614 | break; | ||
1615 | case LLAssetType::AT_CALLINGCARD: | ||
1616 | if(flags != 0) | ||
1617 | { | ||
1618 | idx = CALLINGCARD_ONLINE_ICON_NAME; | ||
1619 | } | ||
1620 | else | ||
1621 | { | ||
1622 | idx = CALLINGCARD_OFFLINE_ICON_NAME; | ||
1623 | } | ||
1624 | break; | ||
1625 | case LLAssetType::AT_LANDMARK: | ||
1626 | if(flags!= 0) | ||
1627 | { | ||
1628 | idx = LANDMARK_VISITED_ICON_NAME; | ||
1629 | } | ||
1630 | else | ||
1631 | { | ||
1632 | idx = LANDMARK_ICON_NAME; | ||
1633 | } | ||
1634 | break; | ||
1635 | case LLAssetType::AT_SCRIPT: | ||
1636 | case LLAssetType::AT_LSL_TEXT: | ||
1637 | case LLAssetType::AT_LSL_BYTECODE: | ||
1638 | idx = SCRIPT_ICON_NAME; | ||
1639 | break; | ||
1640 | case LLAssetType::AT_CLOTHING: | ||
1641 | idx = CLOTHING_ICON_NAME; | ||
1642 | switch(LLInventoryItem::II_FLAGS_WEARABLES_MASK & flags) | ||
1643 | { | ||
1644 | case WT_SHIRT: | ||
1645 | idx = CLOTHING_SHIRT_ICON_NAME; | ||
1646 | break; | ||
1647 | case WT_PANTS: | ||
1648 | idx = CLOTHING_PANTS_ICON_NAME; | ||
1649 | break; | ||
1650 | case WT_SHOES: | ||
1651 | idx = CLOTHING_SHOES_ICON_NAME; | ||
1652 | break; | ||
1653 | case WT_SOCKS: | ||
1654 | idx = CLOTHING_SOCKS_ICON_NAME; | ||
1655 | break; | ||
1656 | case WT_JACKET: | ||
1657 | idx = CLOTHING_JACKET_ICON_NAME; | ||
1658 | break; | ||
1659 | case WT_GLOVES: | ||
1660 | idx = CLOTHING_GLOVES_ICON_NAME; | ||
1661 | break; | ||
1662 | case WT_UNDERSHIRT: | ||
1663 | idx = CLOTHING_UNDERSHIRT_ICON_NAME; | ||
1664 | break; | ||
1665 | case WT_UNDERPANTS: | ||
1666 | idx = CLOTHING_UNDERPANTS_ICON_NAME; | ||
1667 | break; | ||
1668 | case WT_SKIRT: | ||
1669 | idx = CLOTHING_SKIRT_ICON_NAME; | ||
1670 | break; | ||
1671 | case WT_ALPHA: | ||
1672 | idx = CLOTHING_ALPHA_ICON_NAME; | ||
1673 | break; | ||
1674 | case WT_TATTOO: | ||
1675 | idx = CLOTHING_TATTOO_ICON_NAME; | ||
1676 | break; | ||
1677 | default: | ||
1678 | // no-op, go with choice above | ||
1679 | break; | ||
1680 | } | ||
1681 | break; | ||
1682 | case LLAssetType::AT_BODYPART: | ||
1683 | idx = BODYPART_ICON_NAME; | ||
1684 | switch(LLInventoryItem::II_FLAGS_WEARABLES_MASK & flags) | ||
1685 | { | ||
1686 | case WT_SHAPE: | ||
1687 | idx = BODYPART_SHAPE_ICON_NAME; | ||
1688 | break; | ||
1689 | case WT_SKIN: | ||
1690 | idx = BODYPART_SKIN_ICON_NAME; | ||
1691 | break; | ||
1692 | case WT_HAIR: | ||
1693 | idx = BODYPART_HAIR_ICON_NAME; | ||
1694 | break; | ||
1695 | case WT_EYES: | ||
1696 | idx = BODYPART_EYES_ICON_NAME; | ||
1697 | break; | ||
1698 | default: | ||
1699 | // no-op, go with choice above | ||
1700 | break; | ||
1701 | } | ||
1702 | break; | ||
1703 | case LLAssetType::AT_NOTECARD: | ||
1704 | idx = NOTECARD_ICON_NAME; | ||
1705 | break; | ||
1706 | case LLAssetType::AT_ANIMATION: | ||
1707 | idx = ANIMATION_ICON_NAME; | ||
1708 | break; | ||
1709 | case LLAssetType::AT_GESTURE: | ||
1710 | idx = GESTURE_ICON_NAME; | ||
1711 | break; | ||
1712 | default: | ||
1713 | break; | ||
1714 | } | ||
1715 | |||
1716 | return ICON_NAME[idx]; | ||
1717 | } | ||
1718 | |||
1588 | LLUIImagePtr get_item_icon(LLAssetType::EType asset_type, | 1719 | LLUIImagePtr get_item_icon(LLAssetType::EType asset_type, |
1589 | LLInventoryType::EType inventory_type, | 1720 | LLInventoryType::EType inventory_type, |
1590 | U32 attachment_point, | 1721 | U32 attachment_point, |
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index 495a340..2650ed8 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h | |||
@@ -391,6 +391,13 @@ std::string get_item_icon_name(LLAssetType::EType asset_type, | |||
391 | std::string get_item_icon_name(LLInventoryType::NType inv_ntype, | 391 | std::string get_item_icon_name(LLInventoryType::NType inv_ntype, |
392 | BOOL item_is_multi ); | 392 | BOOL item_is_multi ); |
393 | 393 | ||
394 | // Uses NType only. For when we don't know an asset's inventory type or have no way of finding that information. | ||
395 | // Sends a default inv_ntype to use if there are multiple NTypes for an asset type. | ||
396 | std::string get_item_icon_name(LLAssetType::EType asset_type, | ||
397 | LLInventoryType::NType inv_ntype, | ||
398 | U32 flags, | ||
399 | BOOL item_is_multi); | ||
400 | |||
394 | LLUIImagePtr get_item_icon(LLAssetType::EType asset_type, | 401 | LLUIImagePtr get_item_icon(LLAssetType::EType asset_type, |
395 | LLInventoryType::EType inventory_type, | 402 | LLInventoryType::EType inventory_type, |
396 | U32 attachment_point, | 403 | U32 attachment_point, |
diff --git a/linden/indra/newview/llpanelgroupnotices.cpp b/linden/indra/newview/llpanelgroupnotices.cpp index e07259f..3d5cd3e 100644 --- a/linden/indra/newview/llpanelgroupnotices.cpp +++ b/linden/indra/newview/llpanelgroupnotices.cpp | |||
@@ -320,7 +320,7 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item) | |||
320 | }; | 320 | }; |
321 | 321 | ||
322 | std::string icon_name = get_item_icon_name(inv_item->getType(), | 322 | std::string icon_name = get_item_icon_name(inv_item->getType(), |
323 | inv_item->getInventoryType(), | 323 | inv_item->getNInventoryType(), |
324 | inv_item->getFlags(), | 324 | inv_item->getFlags(), |
325 | item_is_multi ); | 325 | item_is_multi ); |
326 | 326 | ||
@@ -479,7 +479,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) | |||
479 | { | 479 | { |
480 | std::string icon_name = get_item_icon_name( | 480 | std::string icon_name = get_item_icon_name( |
481 | (LLAssetType::EType)asset_type, | 481 | (LLAssetType::EType)asset_type, |
482 | LLInventoryType::IT_NONE,FALSE, FALSE); | 482 | LLInventoryType::NIT_NONE,FALSE, FALSE); |
483 | row["columns"][0]["type"] = "icon"; | 483 | row["columns"][0]["type"] = "icon"; |
484 | row["columns"][0]["value"] = icon_name; | 484 | row["columns"][0]["value"] = icon_name; |
485 | } | 485 | } |
@@ -547,7 +547,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject, | |||
547 | mInventoryOffer = inventory_offer; | 547 | mInventoryOffer = inventory_offer; |
548 | 548 | ||
549 | std::string icon_name = get_item_icon_name(mInventoryOffer->mType, | 549 | std::string icon_name = get_item_icon_name(mInventoryOffer->mType, |
550 | LLInventoryType::IT_TEXTURE, | 550 | LLInventoryType::NIT_TEXTURE, |
551 | 0, FALSE); | 551 | 0, FALSE); |
552 | 552 | ||
553 | mViewInventoryIcon->setImage(icon_name); | 553 | mViewInventoryIcon->setImage(icon_name); |