Ejemplo n.º 1
0
    public override void UpdateUI()
    {
        base.UpdateUI();
        QuestItemInfo questItem = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem(questInfo.questData.tableData.questID);

        SetActive((Enum)UI.OBJ_REWARD_ICON_ROOT, false);
        if (questItem != null && questItem.sellItems != null && questItem.sellItems.Count > 0)
        {
            int         num   = 0;
            int         count = questItem.sellItems.Count;
            REWARD_TYPE type;
            uint        num2;
            while (true)
            {
                if (num >= count)
                {
                    return;
                }
                QuestItem.SellItem sellItem = questItem.sellItems[num];
                type = (REWARD_TYPE)sellItem.type;
                num2 = (materialId = (uint)sellItem.itemId);
                if (sellItem.num <= 0)
                {
                    break;
                }
                int num3 = -1;
                SetActive((Enum)UI.OBJ_REWARD_ICON_ROOT, true);
                ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon(type, num2, FindCtrl(root, UI.OBJ_MATERIAL_ICON_ROOT), num3, "EQUIP_LIST", 0, false, -1, false, null, false, true, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                num++;
            }
            Log.Error(LOG.OUTGAME, "QuestItem sold get item num is zero. type={0},itemId={1}", type, num2);
        }
    }
Ejemplo n.º 2
0
    public override void UpdateUI()
    {
        UI[] array = new UI[3]
        {
            UI.OBJ_MISSION_INFO_1,
            UI.OBJ_MISSION_INFO_2,
            UI.OBJ_MISSION_INFO_3
        };
        UI[] array2 = new UI[3]
        {
            UI.OBJ_TOP_CROWN_1,
            UI.OBJ_TOP_CROWN_2,
            UI.OBJ_TOP_CROWN_3
        };
        UI[] array3 = new UI[3]
        {
            UI.LBL_MISSION_INFO_1,
            UI.LBL_MISSION_INFO_2,
            UI.LBL_MISSION_INFO_3
        };
        UI[] array4 = new UI[3]
        {
            UI.SPR_MISSION_INFO_CROWN_1,
            UI.SPR_MISSION_INFO_CROWN_2,
            UI.SPR_MISSION_INFO_CROWN_3
        };
        UI[] array5 = new UI[3]
        {
            UI.SPR_CROWN_1,
            UI.SPR_CROWN_2,
            UI.SPR_CROWN_3
        };
        QuestInfoData info      = questInfo;
        QUEST_TYPE    questType = info.questData.tableData.questType;
        int           num       = 0;

        SetFontStyle((Enum)UI.STR_MISSION, 2);
        SetFontStyle((Enum)UI.STR_TREASURE, 2);
        SetFontStyle((Enum)UI.STR_SELL, 2);
        string text = null;

        switch (questType)
        {
        default:
            text = "STR_QUEST_TYPE_NORMAL";
            break;

        case QUEST_TYPE.ORDER:
            text = "STR_QUEST_TYPE_ORDER";
            break;

        case QUEST_TYPE.EVENT:
            text = "STR_QUEST_TYPE_EVENT";
            break;

        case QUEST_TYPE.STORY:
            text = "STR_QUEST_TYPE_STORY";
            break;
        }
        SetText((Enum)UI.LBL_QUEST_TYPE, text);
        SetLabelText((Enum)UI.LBL_QUEST_NUM, string.Format(base.sectionData.GetText("QUEST_NUMBER"), info.questData.tableData.locationNumber, info.questData.tableData.questNumber));
        SetLabelText((Enum)UI.LBL_QUEST_NAME, info.questData.tableData.questText);
        int num2 = (int)info.questData.tableData.limitTime;

        SetLabelText((Enum)UI.LBL_LIMIT_TIME, $"{num2 / 60:D2}:{num2 % 60:D2}");
        SetActive((Enum)UI.LBL_GUILD_REQUEST_NEED_POINT, false);
        SetActive((Enum)UI.STR_MISSION_EMPTY, false);
        if (!info.isExistMission)
        {
            SetActive((Enum)UI.OBJ_MISSION_INFO_ROOT, false);
        }
        else
        {
            SetActive((Enum)UI.OBJ_MISSION_INFO_ROOT, true);
            int i = 0;
            for (int num3 = info.missionData.Length; i < num3; i++)
            {
                SetActive((Enum)array[i], info.missionData[i] != null);
                SetActive((Enum)array2[i], info.missionData[i] != null);
                if (info.missionData[i] != null)
                {
                    SetActive((Enum)array4[i], info.missionData[i].state >= CLEAR_STATUS.CLEAR);
                    SetActive((Enum)array5[i], info.missionData[i].state >= CLEAR_STATUS.CLEAR);
                    SetLabelText((Enum)array3[i], info.missionData[i].tableData.missionText);
                }
            }
        }
        if (questType == QUEST_TYPE.ORDER)
        {
            SetActive((Enum)UI.OBJ_SELL_ITEM, true);
            QuestItemInfo quest_item = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem(info.questData.tableData.questID);

            if (quest_item != null && quest_item.sellItems != null && quest_item.sellItems.Count > 0)
            {
                SetGrid(UI.GRD_REWARD_SELL, string.Empty, quest_item.sellItems.Count, false, delegate(int i_2, Transform t_2, bool is_recycle_2)
                {
                    QuestItem.SellItem sellItem = quest_item.sellItems[i_2];
                    REWARD_TYPE type2           = (REWARD_TYPE)sellItem.type;
                    uint itemId = (uint)sellItem.itemId;
                    if (sellItem.num <= 0)
                    {
                        Log.Error(LOG.OUTGAME, "QuestItem sold get item num is zero. type={0},itemId={1}", type2, itemId);
                    }
                    else
                    {
                        int num4           = -1;
                        ItemIcon itemIcon4 = ItemIcon.CreateRewardItemIcon(type2, itemId, t_2, num4, null, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                        SetMaterialInfo(itemIcon4.transform, type2, itemId, null);
                    }
                });
            }
            SetActive((Enum)UI.OBJ_TOP_CROWN_ROOT, false);
        }
        SetActive((Enum)UI.OBJ_TREASURE, true);
        SetGrid(UI.GRD_REWARD_QUEST, string.Empty, 5, false, delegate(int i_2, Transform t_2, bool is_recycle_2)
        {
            if (info.questData.reward != null && info.questData.reward.Length > i_2)
            {
                REWARD_TYPE type   = (REWARD_TYPE)info.questData.reward[i_2].type;
                uint id            = (uint)info.questData.reward[i_2].id;
                ItemIcon itemIcon3 = ItemIcon.CreateRewardItemIcon(type, id, t_2, -1, null, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                SetMaterialInfo(itemIcon3.transform, type, id, null);
            }
        });
        EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)info.questData.tableData.GetMainEnemyID());

        if (enemyData != null)
        {
            int         iconId   = enemyData.iconId;
            RARITY_TYPE?rarity   = (info.questData.tableData.questType != QUEST_TYPE.ORDER) ? null : new RARITY_TYPE?(info.questData.tableData.rarity);
            ItemIcon    itemIcon = ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, iconId, rarity, GetCtrl(UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
            itemIcon.SetEnableCollider(false);
            ItemIcon itemIcon2 = ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, iconId, rarity, GetCtrl(UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
            itemIcon2.SetEnableCollider(false);
        }
        SetActive((Enum)UI.SPR_ELEMENT_ROOT, false);
        if (enemyData != null)
        {
            SetActive((Enum)UI.SPR_ELEMENT_ROOT_2, true);
            SetElementSprite((Enum)UI.SPR_ELEMENT_2, (int)enemyData.element);
            SetActive((Enum)UI.STR_NON_ELEMENT_2, enemyData.element == ELEMENT_TYPE.MAX);
            SetElementSprite((Enum)UI.SPR_WEAK_ELEMENT_2, (int)enemyData.weakElement);
            SetActive((Enum)UI.STR_NON_WEAK_ELEMENT_2, enemyData.weakElement == ELEMENT_TYPE.MAX);
        }
        else
        {
            SetActive((Enum)UI.SPR_ELEMENT_ROOT_2, false);
            SetActive((Enum)UI.STR_NON_WEAK_ELEMENT_2, false);
        }
        ShowInfo(questType, isShowDropInfo);
        SetActive((Enum)UI.TWN_DIFFICULT_STAR, false);
        num = (MonoBehaviourSingleton <QuestManager> .I.GetClearStatusQuestEnemySpecies(info.questData.tableData.questID)?.questStatus ?? 1);
        SetClearStatus((CLEAR_STATUS)num);
        if (!MonoBehaviourSingleton <UserInfoManager> .I.isGuildRequestOpen)
        {
            SetActive((Enum)UI.BTN_GUILD_REQUEST, false);
        }
    }