Esempio n. 1
0
    public void AllBuild(int widthLength, Vector2 windowSize, GameWebAPI.RespDataWD_DungeonResult.Drop[] standardDrops, GameWebAPI.RespDataWD_DungeonStart.LuckDrop luckDrop, GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] ownerMultiDrops, GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] multiDrops, GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.LuckDrop[] multiLuckDrops, GameWebAPI.RespDataWD_DungeonResult.OptionDrop[] optionDrops, GameWebAPI.RespDataWD_DungeonResult.EventChipReward[] eventChipRewards)
    {
        Rect  listWindowViewRect = default(Rect);
        float num  = windowSize.x * 0.5f;
        float num2 = windowSize.y * 0.5f;

        listWindowViewRect.xMin    = -num;
        listWindowViewRect.xMax    = num;
        listWindowViewRect.yMin    = -num2;
        listWindowViewRect.yMax    = num2;
        base.ListWindowViewRect    = listWindowViewRect;
        this.fRecycleViewMaxY      = num2 * 1.5f;
        this.fRecycleViewMinY      = -num2 * 1.5f;
        this.PARTS_CT_MN           = widthLength;
        this.RecycleViewSectorSize = 4;
        int num3  = (standardDrops == null) ? 0 : standardDrops.Length;
        int num4  = (luckDrop == null) ? 0 : 1;
        int num5  = (ownerMultiDrops == null) ? 0 : ownerMultiDrops.Length;
        int num6  = (multiDrops == null) ? 0 : multiDrops.Length;
        int num7  = (multiLuckDrops == null) ? 0 : multiLuckDrops.Length;
        int num8  = (optionDrops == null) ? 0 : optionDrops.Length;
        int num9  = (eventChipRewards == null) ? 0 : eventChipRewards.Length;
        int num10 = num3 + num4 + num5 + num6 + num7 + num8 + num9;

        GUISelectPanelDropItemList.partsDataList = new List <GUIListDropItemParts.Data>();
        for (int i = 0; i < num3; i++)
        {
            GUIListDropItemParts.Data data = new GUIListDropItemParts.Data();
            data.assetCategoryId = (MasterDataMng.AssetCategory)standardDrops[i].assetCategoryId.ToInt32();
            data.assetNum        = standardDrops[i].assetNum;
            data.assetValue      = standardDrops[i].assetValue;
            data.dropBoxType     = (GUIListDropItemParts.BoxType)standardDrops[i].dropBoxType;
            data.dropType        = GUIListDropItemParts.DropType.Standard;
            GUISelectPanelDropItemList.partsDataList.Add(data);
        }
        if (num4 > 0)
        {
            GUIListDropItemParts.Data data2 = new GUIListDropItemParts.Data();
            data2.assetCategoryId = (MasterDataMng.AssetCategory)luckDrop.assetCategoryId.ToInt32();
            data2.assetNum        = luckDrop.assetNum;
            data2.assetValue      = luckDrop.assetValue;
            data2.dropBoxType     = (GUIListDropItemParts.BoxType)luckDrop.dropBoxType;
            data2.dropType        = GUIListDropItemParts.DropType.Luck;
            GUISelectPanelDropItemList.partsDataList.Add(data2);
        }
        for (int j = 0; j < num8; j++)
        {
            GUIListDropItemParts.Data data3 = new GUIListDropItemParts.Data();
            data3.assetCategoryId = (MasterDataMng.AssetCategory)optionDrops[j].assetCategoryId.ToInt32();
            data3.assetNum        = optionDrops[j].assetNum.ToInt32();
            data3.assetValue      = optionDrops[j].assetValue.ToInt32();
            data3.dropBoxType     = (GUIListDropItemParts.BoxType)optionDrops[j].subType.ToInt32();
            data3.dropType        = GUIListDropItemParts.DropType.Challenge;
            GUISelectPanelDropItemList.partsDataList.Add(data3);
        }
        for (int k = 0; k < num9; k++)
        {
            GUIListDropItemParts.Data data4 = new GUIListDropItemParts.Data();
            data4.assetCategoryId = (MasterDataMng.AssetCategory)eventChipRewards[k].assetCategoryId.ToInt32();
            data4.assetNum        = eventChipRewards[k].assetNum.ToInt32();
            data4.assetValue      = eventChipRewards[k].assetValue.ToInt32();
            data4.dropBoxType     = (GUIListDropItemParts.BoxType)eventChipRewards[k].dropBoxType.ToInt32();
            data4.dropType        = GUIListDropItemParts.DropType.EventChip;
            GUISelectPanelDropItemList.partsDataList.Add(data4);
        }
        for (int l = 0; l < num5; l++)
        {
            GUIListDropItemParts.Data data5 = new GUIListDropItemParts.Data();
            data5.assetCategoryId = (MasterDataMng.AssetCategory)ownerMultiDrops[l].assetCategoryId.ToInt32();
            data5.assetNum        = ownerMultiDrops[l].assetNum;
            data5.assetValue      = ownerMultiDrops[l].assetValue;
            data5.dropBoxType     = (GUIListDropItemParts.BoxType)ownerMultiDrops[l].dropBoxType;
            data5.dropType        = GUIListDropItemParts.DropType.Owner;
            GUISelectPanelDropItemList.partsDataList.Add(data5);
        }
        for (int m = 0; m < num6; m++)
        {
            GUIListDropItemParts.Data data6 = new GUIListDropItemParts.Data();
            data6.assetCategoryId = (MasterDataMng.AssetCategory)multiDrops[m].assetCategoryId.ToInt32();
            data6.assetNum        = multiDrops[m].assetNum;
            data6.assetValue      = multiDrops[m].assetValue;
            data6.dropBoxType     = (GUIListDropItemParts.BoxType)multiDrops[m].dropBoxType;
            data6.dropType        = GUIListDropItemParts.DropType.Multi;
            GUISelectPanelDropItemList.partsDataList.Add(data6);
        }
        for (int n = 0; n < num7; n++)
        {
            GUIListDropItemParts.Data data7 = new GUIListDropItemParts.Data();
            data7.assetCategoryId     = (MasterDataMng.AssetCategory)multiLuckDrops[n].assetCategoryId.ToInt32();
            data7.assetNum            = multiLuckDrops[n].assetNum;
            data7.assetValue          = multiLuckDrops[n].assetValue;
            data7.dropBoxType         = (GUIListDropItemParts.BoxType)multiLuckDrops[n].dropBoxType;
            data7.dropType            = GUIListDropItemParts.DropType.LuckMulti;
            data7.multiLuckDropUserId = multiLuckDrops[n].userId;
            GUISelectPanelDropItemList.partsDataList.Add(data7);
        }
        for (int num11 = 0; num11 < num10; num11++)
        {
            GUISelectPanelDropItemList.partsDataList[num11].index = num11;
        }
        base.initLocation          = true;
        this.RecycleViewSectorSize = 2;
        base.AllBuild(num10, true, 1f, 1f, null, null, false);
        if (base.scrollBar.activeInHierarchy)
        {
            this.boxCollider.size = new Vector3(this.boxCollider.size.x, this.boxCollider.size.y, 40f);
        }
    }
    private void ShowDrops()
    {
        this.skipCount = DropItemResult.SkipCount.Drops;
        GameWebAPI.RespDataWD_DungeonResult.Drop[]            array    = null;
        GameWebAPI.RespDataWD_DungeonStart.LuckDrop           luckDrop = null;
        GameWebAPI.RespDataWD_DungeonResult.OptionDrop[]      array2   = null;
        GameWebAPI.RespDataWD_DungeonResult.EventChipReward[] array3   = null;
        GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] array4 = null;
        GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] array5 = null;
        GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.LuckDrop[]   array6 = null;
        GameWebAPI.RespDataWD_DungeonStart respDataWD_DungeonStart = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonStart;
        if (respDataWD_DungeonStart != null)
        {
            luckDrop = respDataWD_DungeonStart.luckDrop;
            if (ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult != null)
            {
                array  = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult.dropReward;
                array2 = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult.optionDrop;
                array3 = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult.eventChipReward;
            }
        }
        GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
        if (respData_WorldMultiStartInfo != null)
        {
            array    = null;
            luckDrop = null;
            GameWebAPI.RespData_WorldMultiResultInfoLogic respData_WorldMultiResultInfoLogic = ClassSingleton <QuestData> .Instance.RespData_WorldMultiResultInfoLogic;
            if (respData_WorldMultiResultInfoLogic.dungeonReward != null)
            {
                array6 = respData_WorldMultiResultInfoLogic.dungeonReward.luckDrop;
                GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo2 = DataMng.Instance().RespData_WorldMultiStartInfo;
                bool flag = respData_WorldMultiStartInfo2.party[0].userId == DataMng.Instance().RespDataCM_Login.playerInfo.userId;
                if (flag)
                {
                    array4 = respData_WorldMultiResultInfoLogic.dungeonReward.ownerDropReward;
                }
                array5 = respData_WorldMultiResultInfoLogic.dungeonReward.multiReward;
            }
            array  = respData_WorldMultiResultInfoLogic.dropReward;
            array2 = respData_WorldMultiResultInfoLogic.optionDrop;
            array3 = respData_WorldMultiResultInfoLogic.eventChipReward;
        }
        List <DropItemTotalParts.Data> list = new List <DropItemTotalParts.Data>();

        if (array != null)
        {
            foreach (GameWebAPI.RespDataWD_DungeonResult.Drop drop in array)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = drop.assetCategoryId,
                    objectId        = drop.assetValue.ToString(),
                    num             = drop.assetNum
                });
            }
        }
        if (luckDrop != null)
        {
            list.Add(new DropItemTotalParts.Data
            {
                assetCategoryId = luckDrop.assetCategoryId,
                objectId        = luckDrop.assetValue.ToString(),
                num             = luckDrop.assetNum
            });
        }
        if (array4 != null)
        {
            foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward dropReward in array4)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = dropReward.assetCategoryId,
                    objectId        = dropReward.assetValue.ToString(),
                    num             = dropReward.assetNum
                });
            }
        }
        if (array5 != null)
        {
            foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward dropReward2 in array5)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = dropReward2.assetCategoryId,
                    objectId        = dropReward2.assetValue.ToString(),
                    num             = dropReward2.assetNum
                });
            }
        }
        if (array6 != null)
        {
            foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.LuckDrop luckDrop2 in array6)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = luckDrop2.assetCategoryId,
                    objectId        = luckDrop2.assetValue.ToString(),
                    num             = luckDrop2.assetNum
                });
            }
        }
        if (array2 != null)
        {
            foreach (GameWebAPI.RespDataWD_DungeonResult.OptionDrop optionDrop in array2)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = optionDrop.assetCategoryId,
                    objectId        = optionDrop.assetValue.ToString(),
                    num             = optionDrop.assetNum.ToInt32()
                });
            }
        }
        if (array3 != null)
        {
            foreach (GameWebAPI.RespDataWD_DungeonResult.EventChipReward eventChipReward in array3)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = eventChipReward.assetCategoryId,
                    objectId        = eventChipReward.assetValue.ToString(),
                    num             = eventChipReward.assetNum.ToInt32()
                });
            }
        }
        List <DropItemTotalParts.Data> list2 = new List <DropItemTotalParts.Data>();

        while (list.Count > 0)
        {
            DropItemTotalParts.Data data = list[0];
            int num = 0;
            foreach (DropItemTotalParts.Data data2 in list)
            {
                if (data.assetCategoryId == data2.assetCategoryId && data.objectId == data2.objectId)
                {
                    num += data2.num;
                }
            }
            DropItemTotalParts.Data newData = new DropItemTotalParts.Data();
            newData.assetCategoryId = data.assetCategoryId;
            newData.objectId        = data.objectId;
            newData.num             = num;
            list2.Add(newData);
            list = list.Where((DropItemTotalParts.Data x) => x.assetCategoryId != newData.assetCategoryId || x.objectId != newData.objectId).ToList <DropItemTotalParts.Data>();
        }
        this.dropItemTotalList = new DropItemTotalList(base.gameObject, list2.ToArray());
        this.dropItemTotalList.SetActive(false);
        this.dropItemList = new DropItemList(base.gameObject, 10, new Vector2(890f, 250f), array, luckDrop, array4, array5, array6, array2, array3);
        this.dropItemList.SetScrollBarPosX(550f);
        this.dropItemList.SetPosition(new Vector3(0f, 40f, 100f));
        if (this.clipingTextures != null)
        {
            foreach (UITexture uitexture in this.clipingTextures)
            {
                uitexture.depth = 0;
            }
        }
        IEnumerator routine = this.dropItemList.SetDrops(false, new Action(this.SetDropCallBack));

        this.coroutineDropInfo = AppCoroutine.Start(routine, false);
        if (this.lines != null)
        {
            foreach (GameObject gameObject in this.lines)
            {
                gameObject.SetActive(true);
            }
        }
        this.isUserMonsterRefresh = false;
        this.isChipMonsterRefresh = false;
        foreach (DropItemTotalParts.Data data3 in list2)
        {
            if (data3.assetCategoryId.ToInt32() == 1)
            {
                this.isUserMonsterRefresh = true;
            }
            if (data3.assetCategoryId.ToInt32() == 17)
            {
                this.isChipMonsterRefresh = true;
            }
        }
    }
    public DropItemList(GameObject parent, int widthLength, Vector2 windowSize, GameWebAPI.RespDataWD_DungeonResult.Drop[] standardDrops, GameWebAPI.RespDataWD_DungeonStart.LuckDrop luckDrop, GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] ownerMultiDrops, GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] multiDrops, GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.LuckDrop[] multiLuckDrops, GameWebAPI.RespDataWD_DungeonResult.OptionDrop[] optionDrops, GameWebAPI.RespDataWD_DungeonResult.EventChipReward[] eventChipRewards)
    {
        this.gameObject      = new GameObject();
        this.gameObject.name = "DropListBase";
        this.gameObject.transform.SetParent(parent.transform);
        this.gameObject.transform.localPosition = Vector3.zero;
        this.gameObject.transform.localScale    = Vector3.one;
        GameObject gameObject  = GUIManager.LoadCommonGUI("SelectListPanel/SelectListPanelDropItem", this.gameObject);
        GameObject gameObject2 = GUIManager.LoadCommonGUI("ListParts/ListParts_drop", this.gameObject);

        this.guiSelectPanelChipList             = gameObject.GetComponent <GUISelectPanelDropItemList>();
        this.guiSelectPanelChipList.selectParts = gameObject2;
        gameObject2.SetActive(false);
        this.guiSelectPanelChipList.AllBuild(widthLength, windowSize, standardDrops, luckDrop, ownerMultiDrops, multiDrops, multiLuckDrops, optionDrops, eventChipRewards);
    }
Esempio n. 4
0
 public static GameWebAPI.RespData_WorldMultiStartInfo.LuckDrop ExchangeMultiLuckDrop(GameWebAPI.RespDataWD_DungeonStart.LuckDrop soloPlayLuckDrop)
 {
     if (soloPlayLuckDrop == null)
     {
         return(null);
     }
     return(new GameWebAPI.RespData_WorldMultiStartInfo.LuckDrop
     {
         dropBoxType = soloPlayLuckDrop.dropBoxType,
         assetCategoryId = soloPlayLuckDrop.assetCategoryId,
         assetValue = soloPlayLuckDrop.assetValue,
         assetNum = soloPlayLuckDrop.assetNum,
         userId = string.Empty
     });
 }