Esempio n. 1
0
 private int Compare_Desc(SortCompareData lp, SortCompareData rp)
 {
     if (rp.sortingData == lp.sortingData)
     {
         if (rp.GetUniqID() > lp.GetUniqID())
         {
             return(1);
         }
         if (rp.GetUniqID() < lp.GetUniqID())
         {
             return(-1);
         }
         if (rp.GetTableID() > lp.GetTableID())
         {
             return(1);
         }
         if (rp.GetTableID() < lp.GetTableID())
         {
             return(-1);
         }
         return(0);
     }
     if (rp.sortingData > lp.sortingData)
     {
         return(1);
     }
     return(-1);
 }
    protected void SendUseItem()
    {
        GameSection.StayEvent();
        ItemInfo itemInfo = data.GetItemData() as ItemInfo;

        if (itemInfo != null && itemInfo.tableData != null)
        {
            if (itemInfo.tableData.id == 7500101 || itemInfo.tableData.id == 7500102)
            {
                MonoBehaviourSingleton <InventoryManager> .I.SendInventoryAutoItem(data.GetUniqID().ToString(), delegate(bool is_success)
                {
                    GameSection.ResumeEvent(is_success, null);
                });
            }
            else
            {
                MonoBehaviourSingleton <InventoryManager> .I.SendInventoryUseItem(data.GetUniqID().ToString(), delegate(bool is_success)
                {
                    if (is_success && FieldManager.IsValidInGame() && MonoBehaviourSingleton <CoopNetworkManager> .IsValid())
                    {
                        MonoBehaviourSingleton <CoopNetworkManager> .I.UpdateBoost();
                    }
                    GameSection.ResumeEvent(is_success, null);
                });
            }
        }
    }
 public void OnQuery_YES()
 {
     if (num >= item.GetNum())
     {
         GameSection.ChangeEvent("CLOSE_DETAIL", null);
     }
     if (item is ItemSortData)
     {
         GameSection.StayEvent();
         SendItem(delegate(bool b)
         {
             GameSection.ResumeEvent(b, null);
         });
     }
     else if (item is EquipItemSortData)
     {
         GameSection.StayEvent();
         sellConfirm(delegate(bool b)
         {
             if (!b)
             {
                 Debug.LogWarning((object)"sellConfirm = false");
                 GameSection.ResumeEvent(false, null);
             }
             else
             {
                 GameSection.ChangeStayEvent("NON_STACK_SELL", null);
                 SendEquip(new List <string>
                 {
                     item.GetUniqID().ToString()
                 }, delegate(bool is_success)
                 {
                     GameSection.ResumeEvent(is_success, null);
                 });
             }
         });
     }
     else if (item is SkillItemSortData)
     {
         GameSection.ChangeEvent("NON_STACK_SELL", null);
         List <string> list = new List <string>();
         list.Add(item.GetUniqID().ToString());
         GameSection.StayEvent();
         SendSkill(list, delegate(bool b)
         {
             GameSection.ResumeEvent(b, null);
         });
     }
     else if (item is AbilityItemSortData)
     {
         GameSection.StayEvent();
         List <string> list2 = new List <string>();
         list2.Add(item.GetUniqID().ToString());
         SendAbilityItem(list2, delegate(bool is_success)
         {
             GameSection.ResumeEvent(is_success, null);
         });
     }
 }
 protected void OnQuery_ItemDetailEquipSetExtConfirm_YES()
 {
     if (equipSetExtEventData == null)
     {
         Log.Error(LOG.OUTGAME, "EQUIP_SET_EXT data is NULL");
         GameSection.StopEvent();
     }
     else
     {
         GameSection.SetEventData(equipSetExtEventData);
         GameSection.StayEvent();
         MonoBehaviourSingleton <InventoryManager> .I.SendInventoryEquipSetExt(data.GetUniqID().ToString(), delegate(bool is_success)
         {
             if (is_success)
             {
                 if (MonoBehaviourSingleton <StatusManager> .IsValid())
                 {
                     MonoBehaviourSingleton <StatusManager> .I.ResetEquipSetInfo();
                 }
                 MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(NOTIFY_FLAG.UPDATE_EQUIP_SET_INFO);
             }
             GameSection.ResumeEvent(is_success, null);
         });
     }
 }
    protected override void OnQuery_TRY_ON()
    {
        bool flag = GameSceneEvent.current.eventName == "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 smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithGrowData>();

                    smithData.selectEquipData = MonoBehaviourSingleton <InventoryManager> .I.equipItemInventory.Find(uniqID);
                }
                base.OnQuery_TRY_ON();
                if (flag)
                {
                    GameSection.ChangeEvent("SELECT_ITEM", null);
                    OnQuery_SELECT_ITEM();
                }
            }
        }
    }
 private bool IsEnableSelect(SortCompareData item)
 {
     if (item == null)
     {
         return(false);
     }
     return(!item.IsFavorite() && item.GetUniqID() != skillItem.uniqueID);
 }
Esempio n. 7
0
 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);
 }
    public void OnQuery_ItemDetailLithographSellIncludeRareConfirm_YES()
    {
        List <string> list  = new List <string>();
        List <int>    list2 = new List <int>();

        list.Add(item.GetUniqID().ToString());
        list2.Add(num);
        if (num >= item.GetNum())
        {
            GameSection.ChangeEvent("CLOSE_DETAIL", null);
        }
        GameSection.StayEvent();
        MonoBehaviourSingleton <ItemExchangeManager> .I.SendInventorySellItem(list, list2, delegate(bool is_success)
        {
            GameSection.ResumeEvent(is_success, null);
        });
    }
	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();
		}
	}
    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 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);
            }
        });
    }
    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();
                }
            }
        }
    }
 public override void Initialize()
 {
     data = (GameSection.GetEventData() as SortCompareData);
     GameSaveData.instance.RemoveNewIconAndSave(ITEM_ICON_TYPE.USE_ITEM, data.GetUniqID());
     base.Initialize();
 }
Esempio n. 14
0
        public override ItemIcon CreateIcon(object[] data)
        {
            SortCompareData sortCompareData = data[0] as SortCompareData;
            Transform       parent          = data[1] as Transform;
            int             event_data      = (int)data[2];
            bool            is_new          = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(ITEM_ICON_TYPE.ITEM, sortCompareData.GetUniqID());

            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(sortCompareData.GetTableID());

            ItemStorageTop.SHOW_INVENTORY_MODE sHOW_INVENTORY_MODE = (ItemStorageTop.SHOW_INVENTORY_MODE)(int) data[3];
            if (sHOW_INVENTORY_MODE != ItemStorageTop.SHOW_INVENTORY_MODE.SMALL)
            {
                return(ItemIconDetail.CreateMaterialIcon(sortCompareData.GetIconType(), sortCompareData.GetIconID(), sortCompareData.GetRarity(), itemData, sHOW_INVENTORY_MODE == ItemStorageTop.SHOW_INVENTORY_MODE.MAIN_STATUS, parent, sortCompareData.GetNum(), sortCompareData.GetName(), "SELECT", event_data, -1, false, is_new));
            }
            return(ItemIconDetailSmall.CreateSmallMaterialIcon(sortCompareData.GetIconType(), sortCompareData.GetIconID(), sortCompareData.GetRarity(), parent, sortCompareData.GetNum(), sortCompareData.GetName(), "SELECT", event_data, -1, false, is_new, 0, 0, ItemIconDetail.ICON_STATUS.NONE));
        }
Esempio n. 15
0
    protected override void UpdateInventoryUI()
    {
        SetupEnableInventoryUI();
        bool reset = false;
        int  num   = inventory.datas.Length;

        if (preInventoryDataSize != num)
        {
            reset = true;
            preInventoryDataSize = num;
        }
        SetDynamicList((Enum)inventoryUI, (string)null, num, reset, (Func <int, bool>) delegate(int i)
        {
            SortCompareData sortCompareData2 = inventory.datas[i];
            if (sortCompareData2 == null || !sortCompareData2.IsPriority(inventory.sortSettings.orderTypeAsc))
            {
                return(false);
            }
            SkillItemInfo skillItemInfo2 = sortCompareData2.GetItemData() as SkillItemInfo;
            if (skillItemInfo2 == null)
            {
                return(false);
            }
            if (!skillItemInfo2.IsLevelMax())
            {
                return(true);
            }
            return(skillItemInfo2.IsEnableExceed());
        }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
        {
            SortCompareData sortCompareData = inventory.datas[i];
            if (sortCompareData != null && sortCompareData.IsPriority(inventory.sortSettings.orderTypeAsc))
            {
                SkillItemInfo skillItemInfo = sortCompareData.GetItemData() as SkillItemInfo;
                if (skillItemInfo != null && (!skillItemInfo.IsLevelMax() || skillItemInfo.IsExistNextExceed()))
                {
                    ITEM_ICON_TYPE iconType = sortCompareData.GetIconType();
                    bool is_new             = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, sortCompareData.GetUniqID());
                    bool isShowEnableExceed = skillItemInfo.IsEnableExceed() && skillItemInfo.exceedCnt == 0;
                    bool isValidExceed      = skillItemInfo.IsEnableExceed();
                    ItemIcon itemIcon       = CreateItemIconDetail(iconType, sortCompareData.GetIconID(), sortCompareData.GetRarity(), sortCompareData as SkillItemSortData, base.IsShowMainStatus, t, "SELECT", i, is_new, 100, selectIndex == i, sortCompareData.IsEquipping(), isValidExceed, isShowEnableExceed);
                    itemIcon.SetItemID(sortCompareData.GetTableID());
                    itemIcon.SetButtonColor(inventory.datas[i].IsPriority(inventory.sortSettings.orderTypeAsc), true);
                    SetLongTouch(itemIcon.transform, "DETAIL", i);
                }
            }
        });
    }
Esempio n. 16
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);
    }
 protected virtual void UpdateInventoryUI()
 {
     SetupEnableInventoryUI();
     SetDynamicList((Enum)inventoryUI, (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_recycle)
     {
         SortCompareData sortCompareData = inventory.datas[i];
         if (sortCompareData != null && sortCompareData.IsPriority(inventory.sortSettings.orderTypeAsc))
         {
             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, IsShowMainStatus, t, "SELECT", i, is_new, 100, selectIndex == i, sortCompareData.IsEquipping(), sortCompareData.IsExceeded(), false);
             itemIcon.SetItemID(sortCompareData.GetTableID());
             itemIcon.SetButtonColor(inventory.datas[i].IsPriority(inventory.sortSettings.orderTypeAsc), true);
             SetLongTouch(itemIcon.transform, "DETAIL", i);
         }
     });
 }