Esempio n. 1
0
    private ItemIcon CreateItemIcon(SortCompareData dropItem, Transform o, string event_name, int i)
    {
        ITEM_ICON_TYPE iTEM_ICON_TYPE        = ITEM_ICON_TYPE.NONE;
        RARITY_TYPE?   rarity                = null;
        ELEMENT_TYPE   element               = ELEMENT_TYPE.MAX;
        EQUIPMENT_TYPE?magi_enable_icon_type = null;
        int            icon_id               = -1;
        int            num = -1;

        if (dropItem != null)
        {
            iTEM_ICON_TYPE        = dropItem.GetIconType();
            icon_id               = dropItem.GetIconID();
            rarity                = dropItem.GetRarity();
            element               = dropItem.GetIconElement();
            magi_enable_icon_type = dropItem.GetIconMagiEnableType();
            num = dropItem.GetNum();
            if (num == 1)
            {
                num = -1;
            }
        }
        bool is_new = false;

        switch (iTEM_ICON_TYPE)
        {
        case ITEM_ICON_TYPE.ITEM:
        case ITEM_ICON_TYPE.QUEST_ITEM:
        {
            ulong uniqID = dropItem.GetUniqID();
            if (uniqID != 0L)
            {
                is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iTEM_ICON_TYPE, dropItem.GetUniqID());
            }
            break;
        }

        default:
            is_new = true;
            break;

        case ITEM_ICON_TYPE.NONE:
            break;
        }
        int enemy_icon_id  = 0;
        int enemy_icon_id2 = 0;

        if (iTEM_ICON_TYPE == ITEM_ICON_TYPE.ITEM)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(dropItem.GetTableID());

            enemy_icon_id  = itemData.enemyIconID;
            enemy_icon_id2 = itemData.enemyIconID2;
        }
        ItemIcon itemIcon = null;

        if (dropItem.GetIconType() == ITEM_ICON_TYPE.QUEST_ITEM)
        {
            ItemIcon.ItemIconCreateParam itemIconCreateParam = new ItemIcon.ItemIconCreateParam();
            itemIconCreateParam.icon_type = dropItem.GetIconType();
            itemIconCreateParam.icon_id   = dropItem.GetIconID();
            itemIconCreateParam.rarity    = dropItem.GetRarity();
            itemIconCreateParam.parent    = o;
            itemIconCreateParam.element   = dropItem.GetIconElement();
            itemIconCreateParam.magi_enable_equip_type = dropItem.GetIconMagiEnableType();
            itemIconCreateParam.num               = dropItem.GetNum();
            itemIconCreateParam.enemy_icon_id     = enemy_icon_id;
            itemIconCreateParam.enemy_icon_id2    = enemy_icon_id2;
            itemIconCreateParam.questIconSizeType = ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_LIST;
            itemIcon = ItemIcon.Create(itemIconCreateParam);
        }
        else
        {
            GET_TYPE getType = dropItem.GetGetType();
            itemIcon = ItemIcon.Create(iTEM_ICON_TYPE, icon_id, rarity, o, element, magi_enable_icon_type, num, event_name, i, is_new, -1, false, null, false, enemy_icon_id, enemy_icon_id2, false, getType);
        }
        itemIcon.SetRewardBG(true);
        itemIcon.SetRewardCategoryInfo(dropItem.GetCategory());
        Transform ctrl = GetCtrl(UI.PNL_MATERIAL_INFO);

        MaterialInfoButton.Set(itemIcon.transform, material_info_t, dropItem.GetMaterialType(), dropItem.GetTableID(), base.sectionData.sectionName, ctrl);
        return(itemIcon);
    }
    public override void UpdateUI()
    {
        SetLabelText((Enum)UI.LBL_ITEM_NAME, item.GetName());
        SetLabelText((Enum)UI.LBL_TOTAL, $"{price:N0}");
        int enemy_icon_id  = 0;
        int enemy_icon_id2 = 0;

        if (item is ItemSortData)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(item.GetTableID());

            if (itemData != null)
            {
                enemy_icon_id  = itemData.enemyIconID;
                enemy_icon_id2 = itemData.enemyIconID2;
            }
        }
        GET_TYPE getType  = item.GetGetType();
        ItemIcon itemIcon = ItemIcon.Create(item.GetIconType(), item.GetIconID(), item.GetRarity(), GetCtrl(UI.OBJ_ICON_ROOT), item.GetIconElement(), item.GetIconMagiEnableType(), num, null, -1, false, -1, false, null, false, enemy_icon_id, enemy_icon_id2, false, getType);

        itemIcon.SetRewardBG(true);
        base.UpdateUI();
    }
    public override void UpdateUI()
    {
        ItemInfo itemInfo = data.GetItemData() as ItemInfo;

        SetRenderItemModel(UI.TEX_MODEL, itemInfo.tableID);
        SetActive((Enum)UI.STR_SELL, data.CanSale());
        SetActive((Enum)UI.BTN_DETAIL_SELL, data.CanSale() && MonoBehaviourSingleton <ItemExchangeManager> .I.IsExchangeScene());
        SetLabelText((Enum)UI.LBL_NAME, data.GetName());
        SetLabelText((Enum)UI.LBL_HAVE_NUM, data.GetNum().ToString());
        SetLabelText((Enum)UI.LBL_DESCRIPTION, itemInfo.tableData.text);
        SetLabelText((Enum)UI.LBL_SELL, data.GetSalePrice().ToString());
        int num  = 0;
        int num2 = 0;

        num  = itemInfo.tableData.enemyIconID;
        num2 = itemInfo.tableData.enemyIconID2;
        GET_TYPE getType = data.GetGetType();

        ItemIcon.Create(data.GetIconType(), data.GetIconID(), data.GetRarity(), GetCtrl(UI.OBJ_ICON_ROOT), data.GetIconElement(), data.GetIconMagiEnableType(), -1, null, 0, false, -1, false, null, false, num, num2, false, getType);
    }