Exemple #1
0
    private void SetDropItemIcon(SortCompareData[] dropItemList, Transform t_grid, int wave)
    {
        if (dropItemList != null)
        {
            string text = string.Format(StringTable.Get(STRING_CATEGORY.RUSH_WAVE, 10004400u), wave);
            SetLabelText(t_grid, UI.LBL_DROP_ITEM_WAVE, text);
            QuestTable.QuestTableData questData = Singleton <QuestTable> .I.GetQuestData((uint)MonoBehaviourSingleton <InGameManager> .I.GetRushQuestId(wave));

            string text2 = "Lv" + questData.GetMainEnemyLv().ToString() + Singleton <EnemyTable> .I.GetEnemyName((uint)questData.GetMainEnemyID());

            SetLabelText(t_grid, UI.LBL_BOSS_NAME, text2);
            SetGrid(t_grid, UI.GRD_DROP_ITEM, null, dropItemList.Length, true, delegate(int i, Transform o, bool is_recycle)
            {
                ItemIcon icon = null;
                if (i < dropItemList.Length)
                {
                    icon = CreateItemIcon(dropItemList[i], o, "DROP", i);
                }
                Transform val = SetPrefab(o, "QuestResultDropIconOpener", true);
                QuestResultDropIconOpener.Info info2 = new QuestResultDropIconOpener.Info
                {
                    IsRare   = ResultUtility.IsRare(dropItemList[i]),
                    IsBroken = ResultUtility.IsBreakReward(dropItemList[i])
                };
                val.GetComponent <QuestResultDropIconOpener>().Initialized(icon, info2, delegate(Transform t, QuestResultDropIconOpener.Info info, bool is_skip)
                {
                    string ui_effect_name = "ef_ui_dropitem_silver_01";
                    if (info.IsBroken)
                    {
                        ui_effect_name = "ef_ui_dropitem_red_01";
                    }
                    else if (info.IsRare)
                    {
                        ui_effect_name = "ef_ui_dropitem_gold_01";
                    }
                    SetVisibleWidgetOneShotEffect(GetCtrl(UI.OBJ_SCROLL_VIEW), t, ui_effect_name);
                });
            });
        }
    }
Exemple #2
0
    public override void UpdateUI()
    {
        SetActive((Enum)UI.BTN_NEXT, false);
        SetActive((Enum)UI.OBJ_BONUS_POINT_SHOP, false);
        SetGrid(UI.GRD_DROP_ITEM, null, dropItemIconData.Length, true, delegate(int i, Transform o, bool is_recycle)
        {
            //IL_0287: Unknown result type (might be due to invalid IL or missing references)
            //IL_028c: Unknown result type (might be due to invalid IL or missing references)
            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 (i < dropItemIconData.Length && dropItemIconData[i] != null)
            {
                iTEM_ICON_TYPE        = dropItemIconData[i].GetIconType();
                icon_id               = dropItemIconData[i].GetIconID();
                rarity                = dropItemIconData[i].GetRarity();
                element               = dropItemIconData[i].GetIconElement();
                magi_enable_icon_type = dropItemIconData[i].GetIconMagiEnableType();
                num = dropItemIconData[i].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 = dropItemIconData[i].GetUniqID();
                    if (uniqID != 0L)
                    {
                        is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iTEM_ICON_TYPE, dropItemIconData[i].GetUniqID());
                    }
                    break;
                }

            default:
                is_new = true;
                break;

            case ITEM_ICON_TYPE.NONE:
                break;
            }
            int enemy_icon_id = 0;
            if (iTEM_ICON_TYPE == ITEM_ICON_TYPE.ITEM)
            {
                ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(dropItemIconData[i].GetTableID());
                enemy_icon_id = itemData.enemyIconID;
            }
            ItemIcon itemIcon = null;
            if (dropItemIconData[i].GetIconType() == ITEM_ICON_TYPE.QUEST_ITEM)
            {
                itemIcon = ItemIcon.Create(new ItemIcon.ItemIconCreateParam
                {
                    icon_type = dropItemIconData[i].GetIconType(),
                    icon_id   = dropItemIconData[i].GetIconID(),
                    rarity    = new RARITY_TYPE?(dropItemIconData[i].GetRarity()),
                    parent    = o,
                    element   = dropItemIconData[i].GetIconElement(),
                    magi_enable_equip_type = dropItemIconData[i].GetIconMagiEnableType(),
                    num               = dropItemIconData[i].GetNum(),
                    enemy_icon_id     = enemy_icon_id,
                    questIconSizeType = ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_LIST
                });
            }
            else
            {
                GET_TYPE getType = dropItemIconData[i].GetGetType();
                itemIcon         = ItemIcon.Create(iTEM_ICON_TYPE, icon_id, rarity, o, element, magi_enable_icon_type, num, "DROP", i, is_new, -1, false, null, false, enemy_icon_id, 0, false, getType);
            }
            itemIcon.SetRewardBG(true);
            itemIcon.SetRewardCategoryInfo(dropItemIconData[i].GetCategory());
            SetMaterialInfo(itemIcon.transform, dropItemIconData[i].GetMaterialType(), dropItemIconData[i].GetTableID(), GetCtrl(UI.PNL_MATERIAL_INFO));
            itemIcon.transform.FindChild("MaterialInfo").get_gameObject().SetActive(false);
            Transform val = SetPrefab(o, "QuestResultDropIconOpener", true);
            QuestResultDropIconOpener.Info info2 = new QuestResultDropIconOpener.Info
            {
                IsRare   = ResultUtility.IsRare(dropItemIconData[i]),
                IsBroken = ResultUtility.IsBreakReward(dropItemIconData[i])
            };
            val.GetComponent <QuestResultDropIconOpener>().Initialized(itemIcon, info2, delegate(Transform t, QuestResultDropIconOpener.Info info, bool is_skip)
            {
                string ui_effect_name = "ef_ui_dropitem_silver_01";
                if (info.IsBroken)
                {
                    ui_effect_name = "ef_ui_dropitem_red_01";
                }
                else if (info.IsRare)
                {
                    ui_effect_name = "ef_ui_dropitem_gold_01";
                }
                SetVisibleWidgetOneShotEffect(GetCtrl(dropItemSCR), t, ui_effect_name);
            });
        });
        base.GetComponent <UITable>((Enum)UI.TBL_GUILD_REQUEST_RESULT).Reposition();
        TreasureStart();
    }