public static int SetDropData(List <SortCompareData> drop_ary, int start_ary_index, List <QuestCompleteReward.QuestItem> drop_data, REWARD_CATEGORY category = REWARD_CATEGORY.DROP) { int num = start_ary_index; QuestCompleteReward.QuestItem[] ary = drop_data.ToArray(); int i = 0; for (int num2 = ary.Length; i < num2; i++) { SortCompareData sortCompareData = null; if (num > 0 && category != REWARD_CATEGORY.BREAK) { sortCompareData = drop_ary.Find((SortCompareData _data) => _data != null && _data.GetTableID() == (uint)ary[i].questId && _data is QuestSortData); } if (sortCompareData == null) { QuestItemInfo item = new QuestItemInfo(); item.tableID = (uint)ary[i].questId; QuestData quest_list = new QuestData(); item.infoData = new QuestInfoData(Singleton <QuestTable> .I.GetQuestData(item.tableID), quest_list, null); item.infoData.questData.num = ary[i].num; if (MonoBehaviourSingleton <InventoryManager> .I.IsHaveingItem(item.tableID)) { MonoBehaviourSingleton <InventoryManager> .I.ForAllItemInventory(delegate(ItemInfo inventory_item) { if (inventory_item.tableID == item.tableID && inventory_item.num == item.infoData.questData.num) { item.uniqueID = inventory_item.uniqueID; } }); } QuestSortData questSortData = new QuestSortData(); questSortData.SetItem(item); questSortData.SetCategory(category); drop_ary.Add(questSortData); num++; } else { QuestSortData questSortData2 = sortCompareData as QuestSortData; questSortData2.itemData.infoData.questData.num += ary[i].num; } } return(num); }
protected override void OnQueryDetail() { int num = (int)GameSection.GetEventData(); SortCompareData sortCompareData = localInventoryEquipData[num]; if (sortCompareData == null) { GameSection.StopEvent(); } else { ulong uniqID = sortCompareData.GetUniqID(); if (uniqID != 0L) { SmithManager.SmithGrowData smithData = MonoBehaviourSingleton<SmithManager>.I.GetSmithData<SmithManager.SmithGrowData>(); smithData.selectEquipData = MonoBehaviourSingleton<InventoryManager>.I.equipItemInventory.Find(uniqID); } base.OnQueryDetail(); } }
public void Load(SortCompareData data, Transform parent, int layer, int sex_id, int face_id, Action _callback = null) { if (data is EquipItemSortData || data is SmithCreateSortData) { LoadEquip(data.GetTableID(), parent, layer, sex_id, face_id, _callback); } else if (data is ItemSortData) { LoadItem(data.GetTableID(), parent, layer, _callback); } else if (data is SkillItemSortData) { LoadSkillItem(data.GetTableID(), parent, layer, _callback); } else { Clear(); } }
private int Compare(SortCompareData lp, SortCompareData rp) { if (lp.sortingData == rp.sortingData) { if (lp.GetUniqID() > rp.GetUniqID()) { return(1); } if (lp.GetUniqID() < rp.GetUniqID()) { return(-1); } return(0); } if (lp.sortingData > rp.sortingData) { return(1); } return(-1); }
private void _SendEquipSkill() { SortCompareData sortCompareData = inventory.datas[selectIndex]; int exceedSkillSlotNo = slotIndex; if (equipItem.IsExceedSkillSlot(exceedSkillSlotNo)) { exceedSkillSlotNo = equipItem.GetExceedSkillSlotNo(exceedSkillSlotNo); } isSelfSectionChange = true; GameSection.StayEvent(); MonoBehaviourSingleton <StatusManager> .I.SendSetSkill(equipItem.uniqueID, sortCompareData.GetUniqID(), exceedSkillSlotNo, MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo(), delegate(bool is_success) { if (!is_success) { isSelfSectionChange = false; } GameSection.ResumeEvent(is_success, null); }); }
protected virtual void DrawIcon() { SortCompareData[] sell_data_ary = sellData.ToArray(); int sELL_SELECT_MAX = MonoBehaviourSingleton <UserInfoManager> .I.userInfo.constDefine.SELL_SELECT_MAX; SetGrid(UI.GRD_ICON, null, sELL_SELECT_MAX, false, delegate(int i, Transform t, bool is_recycle) { if (i < sell_data_ary.Length) { int enemy_icon_id = 0; int enemy_icon_id2 = 0; bool is_equipping = false; SortCompareData sortCompareData = sell_data_ary[i]; if (sortCompareData is ItemSortData) { ItemSortData itemSortData = sortCompareData as ItemSortData; enemy_icon_id = itemSortData.itemData.tableData.enemyIconID; enemy_icon_id2 = itemSortData.itemData.tableData.enemyIconID2; } else if (sortCompareData is SkillItemSortData) { SkillItemSortData skillItemSortData = sortCompareData as SkillItemSortData; is_equipping = skillItemSortData.IsEquipping(); } else if (sortCompareData is AbilityItemSortData) { enemy_icon_id = (sortCompareData as AbilityItemSortData).itemData.GetItemTableData().enemyIconID; enemy_icon_id2 = (sortCompareData as AbilityItemSortData).itemData.GetItemTableData().enemyIconID2; } GET_TYPE getType = sell_data_ary[i].GetGetType(); ItemIcon itemIcon = ItemIcon.Create(sell_data_ary[i].GetIconType(), sell_data_ary[i].GetIconID(), sell_data_ary[i].GetRarity(), t, sell_data_ary[i].GetIconElement(), sell_data_ary[i].GetIconMagiEnableType(), GetTargetIconNum(sell_data_ary, i), null, 0, false, -1, false, null, is_equipping, enemy_icon_id, enemy_icon_id2, false, getType); itemIcon.SetRewardBG(isShowIconBG()); Transform ctrl = GetCtrl(UI.SCR_ICON); SetMaterialInfo(itemIcon.transform, sell_data_ary[i].GetMaterialType(), sell_data_ary[i].GetTableID(), ctrl); } else { SetActive(t, false); } }); }
public override void UpdateUI() { UpdateAnchors(); base.UpdateUI(); SetToggle((Enum)UI.TGL_CHANGE_INVENTORY, showInventoryMode != ItemStorageTop.SHOW_INVENTORY_MODE.SMALL); inventory = new InGameUseItemInventory(); SetDynamicList((Enum)SelectListTarget(showInventoryMode), (string)null, inventory.datas.Length, false, (Func <int, bool>) delegate(int i) { SortCompareData sortCompareData2 = inventory.datas[i]; if (sortCompareData2 == null || !sortCompareData2.IsPriority(inventory.sortSettings.orderTypeAsc)) { return(false); } return(true); }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycre) { SortCompareData sortCompareData = inventory.datas[i]; ItemIcon itemIcon = inventory.CreateIcon(new object[4] { sortCompareData, t, i, showInventoryMode }); if (itemIcon != null) { itemIcon.toggleSelectFrame.onChange.Clear(); itemIcon.toggleSelectFrame.onChange.Add(new EventDelegate(this, "IconToggleChange")); SetEvent(itemIcon.transform, "DETAIL", i); SetLongTouch(itemIcon.transform, "DETAIL", i); } }); UIPanel component = GetCtrl(UI.SCR_INVENTORY).GetComponent <UIPanel>(); component.Refresh(); if (isInActiveRotate && MonoBehaviourSingleton <ScreenOrientationManager> .IsValid()) { Reposition(MonoBehaviourSingleton <ScreenOrientationManager> .I.isPortrait); } isInActiveRotate = false; }
protected override void InitLocalInventory() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); SortBase.TYPE selectCreateEquipItemType = smithData.selectCreateEquipItemType; switch (selectCreateEquipItemType) { case SortBase.TYPE.WEAPON_ALL: localInventoryEquipData = SortCompareData.CreateSortDataAry <SmithCreateItemInfo, SmithCreateSortData>(pickupWeapon, sortSettings, null); break; case SortBase.TYPE.ARMOR_ALL: localInventoryEquipData = SortCompareData.CreateSortDataAry <SmithCreateItemInfo, SmithCreateSortData>(pickupArmor, sortSettings, null); break; default: localInventoryEquipData = sortSettings.CreateSortAry <SmithCreateItemInfo, SmithCreateSortData>(Singleton <CreateEquipItemTable> .I.GetCreateEquipItemDataAry(SortBaseTypeToEquipmentType(selectCreateEquipItemType))); break; } SelectingInventoryFirst(); }
protected override void OnQuery_TRY_ON() { if (localInventoryEquipData != null && localInventoryEquipData.Length != 0) { selectInventoryIndex = (int)GameSection.GetEventData(); SortCompareData sortCompareData = localInventoryEquipData[selectInventoryIndex]; if (sortCompareData != null) { ulong uniqID = sortCompareData.GetUniqID(); if (uniqID != 0L) { SmithManager.SmithGrowData smithGrowData = MonoBehaviourSingleton <SmithManager> .I.CreateSmithData <SmithManager.SmithGrowData>(); smithGrowData.selectEquipData = MonoBehaviourSingleton <InventoryManager> .I.equipItemInventory.Find(uniqID); GameSection.ChangeEvent("SELECT_ITEM", null); OnQuery_SELECT_ITEM(); } } } }
protected virtual void OnCloseSort() { SortSettings sortSettings = (SortSettings)GameSection.GetEventData(); if (sortSettings != null) { SortCompareData sortCompareData = null; if (selectIndex >= 0) { sortCompareData = inventory.datas[selectIndex]; } if (inventory.Sort(sortSettings)) { if (sortCompareData != null) { selectIndex = GetSelectItemIndex(sortCompareData.GetItemData() as SkillItemInfo); } SetDirty(UI.GRD_INVENTORY); RefreshUI(); } } }
public static int SetDropData(List <SortCompareData> drop_ary, int start_ary_index, List <QuestCompleteReward.EquipItem> drop_data, REWARD_CATEGORY category = REWARD_CATEGORY.DROP) { int num = start_ary_index; QuestCompleteReward.EquipItem[] ary = drop_data.ToArray(); int i = 0; for (int num2 = ary.Length; i < num2; i++) { SortCompareData sortCompareData = null; if (num > 0 && category != REWARD_CATEGORY.BREAK) { sortCompareData = drop_ary.Find((SortCompareData _data) => _data != null && _data.GetTableID() == (uint)ary[i].equipItemId && _data is RewardEquipItemSortData); } if (sortCompareData == null) { EquipItem equipItem = new EquipItem(); equipItem.uniqId = "0"; equipItem.equipItemId = ary[i].equipItemId; equipItem.level = ary[i].lv; equipItem.exceed = 0; equipItem.is_locked = 0; equipItem.price = 0; EquipItemInfo item = new EquipItemInfo(equipItem); RewardEquipItemSortData rewardEquipItemSortData = new RewardEquipItemSortData(); rewardEquipItemSortData.SetItem(item); rewardEquipItemSortData.SetCategory(category); rewardEquipItemSortData.rewardNum = ary[i].num; drop_ary.Add(rewardEquipItemSortData); num++; } else { RewardEquipItemSortData rewardEquipItemSortData2 = sortCompareData as RewardEquipItemSortData; rewardEquipItemSortData2.rewardNum += ary[i].num; } } return(num); }
protected override void LocalInventory() { SetupEnableInventoryUI(); if (localInventoryEquipData != null) { SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel()); SetDynamicList((Enum)InventoryUI, (string)null, localInventoryEquipData.Length, false, (Func <int, bool>) delegate(int i) { SortCompareData sortCompareData = localInventoryEquipData[i]; if (sortCompareData == null || !sortCompareData.IsPriority(sortSettings.orderTypeAsc)) { return(false); } return(true); }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle) { uint tableID = localInventoryEquipData[i].GetTableID(); if (tableID == 0) { SetActive(t, false); } else { SetActive(t, true); EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData(tableID); EquipItemSortData equipItemSortData = localInventoryEquipData[i] as EquipItemSortData; EquipItemInfo equip = equipItemSortData.GetItemData() as EquipItemInfo; ITEM_ICON_TYPE iconType = equipItemSortData.GetIconType(); bool is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, equipItemSortData.GetUniqID()); SkillSlotUIData[] skillSlotData = GetSkillSlotData(equip); ItemIcon itemIcon = CreateEquipAbilityIconDetail(getType: equipItemSortData.GetGetType(), icon_type: iconType, icon_id: equipItemData.GetIconID(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex), rarity: equipItemData.rarity, item_data: equipItemSortData, skill_slot_data: skillSlotData, is_show_main_status: base.IsShowMainStatus, parent: t, event_name: "TRY_ON", event_data: i, icon_status: equipItemSortData.GetIconStatus(), is_new: is_new, toggle_group: -1, is_select: false, equip_index: -1); itemIcon.SetItemID(equipItemSortData.GetTableID()); itemIcon.SetButtonColor(localInventoryEquipData[i].IsPriority(sortSettings.orderTypeAsc), true); SetLongTouch(itemIcon.transform, "DETAIL", i); } }); } }
protected override void ToDetail() { SaveCurrentScrollPosition(); int num = (int)GameSection.GetEventData(); sellItemData.Clear(); SortCompareData sortCompareData = inventories[(int)tab].datas[num]; if (!sortCompareData.CanSale()) { if (sortCompareData.IsFavorite()) { GameSection.ChangeEvent("NOT_SELL_FAVORITE", null); } else if (sortCompareData.IsEquipping()) { GameSection.ChangeEvent("NOT_SELL_EQUIPPING", null); } else { GameSection.ChangeEvent("CAN_NOT_SELL", null); } } else if (!MonoBehaviourSingleton <UserInfoManager> .I.CheckTutorialBit(TUTORIAL_MENU_BIT.SKILL_EQUIP) && sortCompareData.GetTableID() == 10000000) { GameSection.ChangeEvent("NOT_SELL_DEFAULT_WEAPON", null); } else if (tab == TAB_MODE.MATERIAL) { GameSection.ChangeEvent("SELECT", sortCompareData); } else { sellItemData.Add(inventories[(int)tab].datas[num]); GameSection.ChangeEvent("EQUIP_SELECT", null); OnQuery_SELL(); } }
protected override void LocalInventory() { SetupEnableInventoryUI(); if (localInventoryEquipData != null) { SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel()); SetDynamicList((Enum)InventoryUI, (string)null, localInventoryEquipData.Length, false, (Func <int, bool>) delegate(int i) { SortCompareData sortCompareData = localInventoryEquipData[i]; if (sortCompareData == null || !sortCompareData.IsPriority(sortSettings.orderTypeAsc)) { return(false); } return(true); }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle) { uint tableID = localInventoryEquipData[i].GetTableID(); if (tableID == 0) { SetActive(t, false); } else { SetActive(t, true); EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData(tableID); EquipItemSortData equipItemSortData = localInventoryEquipData[i] as EquipItemSortData; EquipItemInfo equip = equipItemSortData.GetItemData() as EquipItemInfo; ITEM_ICON_TYPE iconType = equipItemSortData.GetIconType(); bool is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, equipItemSortData.GetUniqID()); SkillSlotUIData[] skillSlotData = GetSkillSlotData(equip); ItemIcon itemIcon = CreateItemIconDetail(equipItemSortData, skillSlotData, IsShowMainStatus, t, "TRY_ON", i, equipItemSortData.GetIconStatus(), is_new, -1, false, -1); itemIcon.SetItemID(equipItemSortData.GetTableID()); itemIcon.SetButtonColor(localInventoryEquipData[i].IsPriority(sortSettings.orderTypeAsc), true); SetLongTouch(itemIcon.transform, "DETAIL", i); } }); } }
public override void Initialize() { object[] array = GameSection.GetEventData() as object[]; item = (array[0] as SortCompareData); num = (int)array[1]; List <SortCompareData> list = new List <SortCompareData>(); list.Add(item); if (MonoBehaviourSingleton <GameSceneManager> .I.GetHierarchyList().Exists((GameSectionHierarchy.HierarchyData x) => x.section.get_name() == "ItemStorageSell")) { GameSection.SetEventData(new object[3] { ItemStorageTop.TAB_MODE.MATERIAL, list, GO_BACK.SELL }); } else { GameSection.SetEventData(new object[3] { ItemStorageTop.TAB_MODE.MATERIAL, list, GO_BACK.TOP }); } base.Initialize(); m_isRareConfirm = false; list.ForEach(delegate(SortCompareData sort_data) { if (!m_isRareConfirm && GameDefine.IsRareLithograph(sort_data.GetRarity())) { m_isRareConfirm = true; } }); }
protected virtual int GetTargetIconNum(SortCompareData[] sell_data_ary, int i) { SortCompareData sortCompareData = sell_data_ary[i]; return(sortCompareData.GetNum()); }
public override void Initialize() { iconData = (SortCompareData)GameSection.GetEventData(); base.Initialize(); }
protected override void UpdateInventoryUI() { int find_index = -1; if (equipSkillItem != null) { find_index = Array.FindIndex(inventory.datas, (SortCompareData data) => data.GetUniqID() == equipSkillItem.uniqueID); if (find_index > -1 && (inventory.datas[find_index] == null || !inventory.datas[find_index].IsPriority(inventory.sortSettings.orderTypeAsc))) { find_index = -1; } } SetupEnableInventoryUI(); SetDynamicList((Enum)inventoryUI, (string)null, inventory.datas.Length + 2, false, (Func <int, bool>) delegate(int i) { if (i == 0) { return(!isVisibleEmptySkill && find_index >= 0); } bool flag = false; bool flag2 = true; int num2 = i - 1; if (find_index >= 0) { if (num2 == 0) { flag = true; } else { num2--; } } if (!flag && (num2 >= inventory.datas.Length || (find_index >= 0 && num2 == find_index))) { flag2 = false; } if (flag2) { SortCompareData sortCompareData2 = inventory.datas[num2]; if (sortCompareData2 == null || !sortCompareData2.IsPriority(inventory.sortSettings.orderTypeAsc)) { flag2 = false; } } return(flag2); }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle) { if (i == 0) { if (!isVisibleEmptySkill) { CreateRemoveIcon(t, "SELECT", -1, 100, selectIndex == -1, base.sectionData.GetText("STR_DETACH")); } } else { int num = i - 1; if (find_index >= 0) { num = ((num != 0) ? (num - 1) : find_index); } SetActive(t, true); SortCompareData sortCompareData = inventory.datas[num]; SkillItemInfo skillItemInfo = sortCompareData.GetItemData() as SkillItemInfo; ITEM_ICON_TYPE iconType = sortCompareData.GetIconType(); bool is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, sortCompareData.GetUniqID()); ItemIcon itemIcon = CreateItemIconDetail(iconType, sortCompareData.GetIconID(), sortCompareData.GetRarity(), sortCompareData as SkillItemSortData, base.IsShowMainStatus, t, "SELECT", num, is_new, 100, selectIndex == num, skillItemInfo.IsCurrentEquipSetAttached, sortCompareData.IsExceeded(), false); itemIcon.SetItemID(sortCompareData.GetTableID()); SetLongTouch(itemIcon.transform, "DETAIL", num); } }); }
public override void Initialize() { data = (GameSection.GetEventData() as SortCompareData); GameSaveData.instance.RemoveNewIconAndSave(ITEM_ICON_TYPE.USE_ITEM, data.GetUniqID()); base.Initialize(); }
protected override void OnDecision() { List <GameSectionHistory.HistoryData> historyList = MonoBehaviourSingleton <GameSceneManager> .I.GetHistoryList(); string sectionName = historyList[historyList.Count - 2].sectionName; bool flag = sectionName == "ItemDetailSkillDialog" || sectionName == "ItemDetailSkill"; if (selectIndex == -1) { if (equipSkillItem == null) { GameSection.BackSection(); } else { GameSection.ChangeEvent("DETACH", null); SendDetachEquipSkill(); } } else { SortCompareData sortCompareData = inventory.datas[selectIndex]; if (equipSkillItem != null && equipSkillItem.uniqueID == sortCompareData.GetUniqID()) { GameSection.BackSection(); } else { EquipItemInfo equipItemInfo = null; SkillItemInfo skillItemInfo = sortCompareData.GetItemData() as SkillItemInfo; if (skillItemInfo.IsCurrentEquipSetAttached) { EquipSetSkillData equipSetSkillData = skillItemInfo.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo()); equipItemInfo = MonoBehaviourSingleton <InventoryManager> .I.equipItemInventory.Find(equipSetSkillData.equipItemUniqId); } if (equipSkillItem != null) { if (!skillItemInfo.IsCurrentEquipSetAttached) { GameSection.ChangeEvent((!flag) ? "EQUIP" : "EQUIP_DETAIL", null); CheckSendEquipSkill(); } else { GameSection.ChangeEvent((!flag) ? "STEAL" : "STEAL_DETAIL", new object[5] { equipSkillItem.tableData.name, equipSkillItem.level.ToString(), equipItemInfo.tableData.name, sortCompareData.GetName(), sortCompareData.GetLevel().ToString() }); } } else if (skillItemInfo.IsCurrentEquipSetAttached) { GameSection.ChangeEvent((!flag) ? "REPLACE" : "REPLACE_DETAIL", new object[3] { equipItemInfo.tableData.name, sortCompareData.GetName(), sortCompareData.GetLevel().ToString() }); } else { GameSection.ChangeEvent((!flag) ? "EQUIP" : "EQUIP_DETAIL", null); CheckSendEquipSkill(); } } } }
protected override void LocalInventory() { SetupEnableInventoryUI(); SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel()); if (localInventoryEquipData != null) { SortBase.TYPE tYPE = TranslateInventoryType(selectTypeIndex); bool _is_pickup = tYPE == SortBase.TYPE.WEAPON_ALL || tYPE == SortBase.TYPE.ARMOR_ALL; SetDynamicList((Enum)InventoryUI, string.Empty, localInventoryEquipData.Length, false, (Func <int, bool>) delegate(int check_index) { SmithCreateItemInfo smithCreateItemInfo = localInventoryEquipData[check_index].GetItemData() as SmithCreateItemInfo; if (smithCreateItemInfo == null) { return(false); } if (!MonoBehaviourSingleton <InventoryManager> .I.IsHaveingKeyMaterial(smithCreateItemInfo.smithCreateTableData.needKeyOrder, smithCreateItemInfo.smithCreateTableData.needMaterial)) { return(false); } if ((int)smithCreateItemInfo.smithCreateTableData.researchLv > MonoBehaviourSingleton <UserInfoManager> .I.userStatus.researchLv) { return(false); } if (localInventoryEquipData[check_index].GetTableID() == 0) { return(false); } SortCompareData sortCompareData = localInventoryEquipData[check_index]; if (sortCompareData == null || !sortCompareData.IsPriority(sortSettings.orderTypeAsc)) { return(false); } return(true); }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle) { SmithCreateItemInfo create_info = localInventoryEquipData[i].GetItemData() as SmithCreateItemInfo; uint tableID = localInventoryEquipData[i].GetTableID(); if (tableID == 0) { SetActive(t, false); } else { SetActive(t, true); SmithCreateSortData smithCreateSortData = localInventoryEquipData[i] as SmithCreateSortData; if (smithCreateSortData != null && smithCreateSortData.IsPriority(sortSettings.orderTypeAsc)) { EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData(tableID); ITEM_ICON_TYPE iconType = localInventoryEquipData[i].GetIconType(); SkillSlotUIData[] skillSlotData = GetSkillSlotData(equipItemData, 0); bool flag = false; flag = MonoBehaviourSingleton <SmithManager> .I.NeedSmithBadge(create_info, _is_pickup); ItemIcon itemIcon = CreateSmithCreateItemIconDetail(getType: smithCreateSortData.GetGetType(), icon_type: iconType, icon_id: equipItemData.GetIconID(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex), rarity: equipItemData.rarity, item_data: smithCreateSortData, skill_slot_data: skillSlotData, is_show_main_status: base.IsShowMainStatus, parent: t, event_name: "SELECT_ITEM", event_data: i, icon_status: smithCreateSortData.GetIconStatus(), is_new: flag, toggle_group: -1, is_select: false); itemIcon.SetItemID(smithCreateSortData.GetTableID()); itemIcon.SetButtonColor(localInventoryEquipData[i].IsPriority(sortSettings.orderTypeAsc), true); SetLongTouch(itemIcon.transform, "DETAIL", i); } } }); } }
protected override void LocalInventory() { SetupEnableInventoryUI(); if (localInventoryEquipData != null) { SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel()); bool created_remove_btn = false; EquipItemInfo equipping_item = GetCompareItemData(); int find_index = -1; if (equipping_item != null) { find_index = Array.FindIndex(localInventoryEquipData, (SortCompareData data) => data.GetUniqID() == equipping_item.uniqueID); if (find_index > -1 && (localInventoryEquipData[find_index] == null || !localInventoryEquipData[find_index].IsPriority(sortSettings.orderTypeAsc))) { find_index = -1; } } created_remove_btn = IsCreateRemoveButton(); SetDynamicList((Enum)InventoryUI, (string)null, localInventoryEquipData.Length + 2, false, (Func <int, bool>) delegate(int i) { if (created_remove_btn && i == 0) { return(true); } bool flag2 = false; bool flag3 = true; int num3 = i; if (created_remove_btn) { num3--; } if (find_index >= 0) { if (num3 == 0) { flag2 = true; } else { num3--; } } if (!flag2 && (num3 >= localInventoryEquipData.Length || (find_index >= 0 && num3 == find_index))) { flag3 = false; } if (flag3) { SortCompareData sortCompareData = localInventoryEquipData[num3]; if (sortCompareData == null || !sortCompareData.IsPriority(sortSettings.orderTypeAsc)) { flag3 = false; } } return(flag3); }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle) { if (i == 0 && created_remove_btn) { CreateRemoveIcon(t, "TRY_ON", -1, 100, selectInventoryIndex == -1, base.sectionData.GetText("STR_DETACH")); } else { int num = i; if (created_remove_btn) { num--; } bool flag = false; if (find_index >= 0) { if (num == 0) { num = find_index; flag = true; } else { num--; } } SetActive(t, true); EquipItemSortData equipItemSortData = localInventoryEquipData[num] as EquipItemSortData; EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData(equipItemSortData.GetTableID()); int num2 = selectEquipSetData.EquippingIndexOf(equipItemSortData.equipData); bool is_select = num == selectInventoryIndex; ITEM_ICON_TYPE iconType = equipItemSortData.GetIconType(); SkillSlotUIData[] skillSlotData = GetSkillSlotData(equipItemSortData.GetItemData() as EquipItemInfo); bool is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, equipItemSortData.GetUniqID()); ItemIcon itemIcon; if (IsNotEquip(num2 == -1, flag)) { itemIcon = CreateItemIconDetail(equipItemSortData, skillSlotData, base.IsShowMainStatus, t, "TRY_ON", num, ItemIconDetail.ICON_STATUS.NONE, is_new, 100, is_select, -1); } else { int equip_index = -1; if (num2 > -1 || flag) { equip_index = (equipItemData.IsWeapon() ? (num2 + 1) : 0); } if (equipItemSortData != null && equipping_item != null && equipItemSortData.GetUniqID() == equipping_item.uniqueID) { equipItemSortData.SetItem(equipping_item); } itemIcon = CreateItemIconDetail(equipItemSortData, skillSlotData, base.IsShowMainStatus, t, "TRY_ON", num, ItemIconDetail.ICON_STATUS.NONE, is_new, 100, is_select, equip_index); } if (itemIcon != null) { itemIcon.SetItemID(equipItemSortData.GetTableID()); } SetLongTouch(itemIcon.transform, "DETAIL", num); } }); } }
public override void Initialize() { //IL_03bb: Unknown result type (might be due to invalid IL or missing references) gameEventData = (GameSection.GetEventData() as object[]); callSection = (CURRENT_SECTION)(int)gameEventData[0]; eventData = gameEventData[1]; localEquipSetData = gameEventData.OfType <StatusEquip.LocalEquipSetData>().FirstOrDefault(); switch (callSection) { case CURRENT_SECTION.STATUS_TOP: case CURRENT_SECTION.STATUS_EQUIP: case CURRENT_SECTION.STATUS_AVATAR: case CURRENT_SECTION.EQUIP_SET_DETAIL_STATUS: { EquipItemInfo equipItemInfo3 = eventData as EquipItemInfo; if (equipItemInfo3 != null) { detailItemData = equipItemInfo3; equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemInfo); } break; } case CURRENT_SECTION.ITEM_STORAGE: case CURRENT_SECTION.SMITH_SELL: { SortCompareData sortCompareData = eventData as SortCompareData; if (sortCompareData != null) { EquipItemInfo equipItemInfo4 = (EquipItemInfo)(detailItemData = (sortCompareData.GetItemData() as EquipItemInfo)); equipAttachSkill = GetSkillSlotData(equipItemInfo4); MonoBehaviourSingleton <StatusManager> .I.SetSelectEquipItem(equipItemInfo4); } break; } case CURRENT_SECTION.QUEST_ROOM: { EquipItemInfo equipItemInfo = eventData as EquipItemInfo; if (equipItemInfo != null) { detailItemData = equipItemInfo; equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemInfo); } if (gameEventData.Length > 2) { sex = (int)gameEventData[2]; faceID = (int)gameEventData[3]; } break; } case CURRENT_SECTION.QUEST_RESULT: { EquipItemAndSkillData equipItemAndSkillData = eventData as EquipItemAndSkillData; if (equipItemAndSkillData != null) { detailItemData = equipItemAndSkillData.equipItemInfo; equipAttachSkill = equipItemAndSkillData.skillSlotUIData; } if (gameEventData.Length > 2) { sex = (int)gameEventData[2]; faceID = (int)gameEventData[3]; } break; } case CURRENT_SECTION.SMITH_EVOLVE: case CURRENT_SECTION.SMITH_GROW: { EquipItemInfo equipItemInfo2 = eventData as EquipItemInfo; if (equipItemInfo2 != null) { detailItemData = equipItemInfo2; equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemInfo); } break; } case CURRENT_SECTION.SMITH_CREATE: case CURRENT_SECTION.GACHA_EQUIP_PREVIEW: detailItemData = eventData; equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemTable.EquipItemData, 0); break; case CURRENT_SECTION.EQUIP_LIST: detailItemData = eventData; equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemTable.EquipItemData, 0); for (int i = 0; i < equipAttachSkill.Length; i++) { equipAttachSkill[i].slotData.skill_id = 0u; } break; } if (detailItemData != null) { EquipItemInfo equipItemInfo5 = detailItemData as EquipItemInfo; if (equipItemInfo5 != null) { GameSaveData.instance.RemoveNewIconAndSave(ItemIcon.GetItemIconType(equipItemInfo5.tableData.type), equipItemInfo5.uniqueID); } } if (sex == -1) { sex = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex; } Transform ctrl = GetCtrl(UI.BTN_GRAPH); if (ctrl != null) { int num = -1; EquipItemInfo equipItemInfo6 = detailItemData as EquipItemInfo; if (equipItemInfo6 != null) { num = equipItemInfo6.tableData.damageDistanceId; } else { EquipItemTable.EquipItemData equipItemData = detailItemData as EquipItemTable.EquipItemData; if (equipItemData != null) { num = equipItemData.damageDistanceId; } } bool active = num >= 0; ctrl.get_gameObject().SetActive(active); } base.Initialize(); }
public override void UpdateUI() { if (inventory == null) { inventory = new ItemStorageTop.AbilityItemInventory(); } SetActive((Enum)UI.OBJ_BTN_SELL_MODE, !isSellMode); SetActive((Enum)UI.OBJ_SELL_MODE_ROOT, isSellMode); SetLabelText((Enum)UI.LBL_MAX_HAVE_NUM, MonoBehaviourSingleton <UserInfoManager> .I.userStatus.maxAbilityItem.ToString()); SetLabelText((Enum)UI.LBL_NOW_HAVE_NUM, inventory.datas.Length.ToString()); SetActive((Enum)UI.GRD_INVENTORY, false); SetActive((Enum)UI.GRD_INVENTORY_SMALL, false); SetLabelText((Enum)UI.LBL_SORT, inventory.sortSettings.GetSortLabel()); SetToggle((Enum)UI.TGL_ICON_ASC, inventory.sortSettings.orderTypeAsc); if (isSellMode) { SetLabelText((Enum)UI.LBL_MAX_SELECT_NUM, MonoBehaviourSingleton <UserInfoManager> .I.userInfo.constDefine.SELL_SELECT_MAX.ToString()); SetLabelText((Enum)UI.LBL_SELECT_NUM, sellItemData.Count.ToString()); int num = 0; foreach (AbilityItemSortData sellItemDatum in sellItemData) { num += sellItemDatum.itemData.GetItemTableData().price; } SetLabelText((Enum)UI.LBL_TOTAL, num.ToString()); } UI currentInventoryRoot = GetCurrentInventoryRoot(); SetActive((Enum)currentInventoryRoot, true); SetDynamicList((Enum)currentInventoryRoot, (string)null, inventory.datas.Length, false, (Func <int, bool>) delegate(int i) { SortCompareData sortCompareData = inventory.datas[i]; if (sortCompareData == null || !sortCompareData.IsPriority(inventory.sortSettings.orderTypeAsc)) { return(false); } return(true); }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycre) { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) SmithUseAbilityItemList smithUseAbilityItemList = this; AbilityItemSortData abilityItem = inventory.datas[i] as AbilityItemSortData; int num2 = sellItemData.FindIndex((AbilityItemSortData x) => x.GetUniqID() == abilityItem.GetUniqID()); ItemIcon itemIcon = CreateIcon(abilityItem, t, i); if (itemIcon != null) { itemIcon.SetUniqID(abilityItem.GetUniqID()); bool flag = abilityItem.itemData.GetItemTableData().rarity <= equipItemInfo.tableData.rarity; itemIcon.SetGrayout(!flag); if (itemIcon is ItemIconDetail) { (itemIcon as ItemIconDetail).setupperMaterial.SetDescription(abilityItem.itemData.GetDescription()); (itemIcon as ItemIconDetail).setupperMaterial.SetActiveInfo(1); } itemIcon.textLabel.get_gameObject().SetActive(true); if (isSellMode) { itemIcon.selectFrame.get_gameObject().SetActive(num2 >= 0); if (num2 >= 0) { if (itemIcon is ItemIconDetail) { (itemIcon as ItemIconDetail).setupperEquip.SetupSelectNumberSprite(num2 + 1); } else { (itemIcon as ItemIconDetailSmall).SetupSelectNumberSprite(num2 + 1); } } } SetEvent(itemIcon.transform, (!flag) ? "LESS_RARITY" : "SELECT_ITEM", abilityItem); } }); SetToggle((Enum)UI.TGL_CHANGE_INVENTORY, currentShowInventoryMode != SHOW_INVENTORY_MODE.SMALL); UpdateAnchors(); base.UpdateUI(); }
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); }