Ejemplo n.º 1
0
        public bool PlayLimitCheck(GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons dng, Action <int> actCallBackShort, Action <int> actCallBack, int usedCT = 0)
        {
            GameWebAPI.RespDataWD_GetDungeonInfo.PlayLimit playLimit = dng.playLimit;
            if (playLimit != null)
            {
                int num = int.Parse(playLimit.restCount);
                if (num <= 0)
                {
                    if (playLimit.recoveryFlg == "1")
                    {
                        if (playLimit.recoveryAssetCategoryId == 2)
                        {
                            int useStoneNum        = playLimit.recoveryAssetNum;
                            int hasStoneNum        = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.point;
                            CMD_ChangePOP_STONE cd = GUIMain.ShowCommonDialog(null, "CMD_ChangePOP_STONE", null) as CMD_ChangePOP_STONE;
                            cd.Title             = StringMaster.GetString("QuestPlayLimitNoneTitle");
                            cd.OnPushedYesAction = delegate()
                            {
                                if (hasStoneNum < useStoneNum)
                                {
                                    cd.SetCloseAction(delegate(int idx)
                                    {
                                        actCallBackShort(idx);
                                    });
                                    cd.ClosePanel(true);
                                }
                                else
                                {
                                    cd.SetCloseAction(delegate(int idx)
                                    {
                                        actCallBack(idx);
                                    });
                                    cd.ClosePanel(true);
                                }
                            };
                            cd.Info = string.Format(StringMaster.GetString("QuestPlayLimitNoneInfo"), useStoneNum, num, int.Parse(playLimit.recoveryCount));
                            cd.SetDigistone(hasStoneNum, useStoneNum);
                        }
                        else if (playLimit.recoveryAssetCategoryId == 6)
                        {
                            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(playLimit.recoveryAssetValue.ToString());
                            int useItemNum = playLimit.recoveryAssetNum;
                            int hasItemNum = Singleton <UserDataMng> .Instance.GetUserItemNumByItemId(playLimit.recoveryAssetValue);

                            CMD_ChangePOP cd = GUIMain.ShowCommonDialog(null, "CMD_ChangePOP", null) as CMD_ChangePOP;
                            cd.Title             = StringMaster.GetString("QuestPlayLimitNoneTitle");
                            cd.OnPushedYesAction = delegate()
                            {
                                if (hasItemNum < useItemNum)
                                {
                                    cd.SetCloseAction(delegate(int idx)
                                    {
                                        actCallBackShort(idx);
                                    });
                                    cd.ClosePanel(true);
                                }
                                else
                                {
                                    cd.SetCloseAction(delegate(int idx)
                                    {
                                        actCallBack(idx);
                                    });
                                    cd.ClosePanel(true);
                                }
                            };
                            cd.Info = string.Format(StringMaster.GetString("QuestPlayLimitNoneInfoItem"), new object[]
                            {
                                itemM.name,
                                useItemNum,
                                itemM.unitName,
                                num,
                                int.Parse(playLimit.recoveryCount)
                            });
                            cd.SetPoint(hasItemNum, useItemNum);
                            if (itemM.img != null && itemM.img.Length > 0)
                            {
                                cd.SetTextureIcon(itemM.img[0]);
                            }
                        }
                        else
                        {
                            Debug.LogError("===================================回数制限DNG: サポートされてないAsssetCategoryID");
                        }
                    }
                    else
                    {
                        CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                        cmd_ModalMessage.Title = StringMaster.GetString("QuestPlayLimitTitle");
                        cmd_ModalMessage.Info  = StringMaster.GetString("QuestPlayLimitZeroInfo");
                    }
                    return(false);
                }
                if (usedCT > 0)
                {
                    this.SetPlayLimitNumCont(dng, usedCT);
                }
            }
            return(true);
        }
    private void OnPushedButton(ExchangeItem exchangeItem)
    {
        int num = 0;

        foreach (string a in this.itemDictionary.Keys)
        {
            string assetCategoryId = exchangeItem.exchangeItemData.assetCategoryId;
            string assetValue      = exchangeItem.exchangeItemData.assetValue;
            string text            = assetCategoryId + assetValue;
            if (this.itemDictionary.ContainsKey(text) && a == text && this.itemDictionary[text] == assetValue)
            {
                break;
            }
            num++;
        }
        string text2 = this.exchangeConsumeItemName[num];

        this.consumeNum = (int.Parse(exchangeItem.exchangeConsumeNum) * exchangeItem.numCounter).ToString();
        string text3 = (this.exchangeConsumeItemInfo == null) ? string.Empty : this.exchangeConsumeItemInfo.unitName;

        MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory) int.Parse(exchangeItem.exchangeItemData.assetCategoryId);
        CMD_ClearingHouse.IconType  iconType      = CMD_ClearingHouse.IconType.NON;
        switch (assetCategory)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            text3    = StringMaster.GetString("ConsumeUnitMonster");
            iconType = CMD_ClearingHouse.IconType.NON;
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
            iconType = CMD_ClearingHouse.IconType.SPRITE;
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            text3    = string.Empty;
            iconType = CMD_ClearingHouse.IconType.SPRITE;
            break;

        case MasterDataMng.AssetCategory.TIP:
            text3    = string.Empty;
            iconType = CMD_ClearingHouse.IconType.SPRITE;
            break;

        case MasterDataMng.AssetCategory.ITEM:
            iconType = CMD_ClearingHouse.IconType.TEXTURE;
            break;

        case MasterDataMng.AssetCategory.GATHA_TICKET:
            text3    = StringMaster.GetString("ConsumeUnitTicket");
            iconType = CMD_ClearingHouse.IconType.NON;
            break;

        case MasterDataMng.AssetCategory.MEAT:
            iconType = CMD_ClearingHouse.IconType.SPRITE;
            break;

        case MasterDataMng.AssetCategory.SOUL:
            text3    = StringMaster.GetString("ConsumeUnitPlugin");
            iconType = CMD_ClearingHouse.IconType.TEXTURE;
            break;

        case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            text3    = StringMaster.GetString("ConsumeUnitTicket");
            iconType = CMD_ClearingHouse.IconType.TEXTURE;
            break;
        }
        string exchangeDetailName = exchangeItem.exchangeDetailName;
        string info = string.Format(StringMaster.GetString("ExchangeConfirmInfo"), new object[]
        {
            text2,
            this.consumeNum,
            text3,
            exchangeDetailName
        });
        CMD_ChangePOP cd = GUIMain.ShowCommonDialog(null, "CMD_ChangePOP", null) as CMD_ChangePOP;

        cd.Title = StringMaster.GetString("ExchangeConfirmTitle");
        cd.Info  = info;
        cd.SetPoint(exchangeItem.exchangeItemData.count, int.Parse(this.consumeNum));
        if (iconType == CMD_ClearingHouse.IconType.SPRITE)
        {
            cd.SetSpriteIcon(this.exchangeItemPathList[num]);
        }
        else if (iconType == CMD_ClearingHouse.IconType.TEXTURE)
        {
            cd.SetTextureIcon(this.exchangeItemPathList[num]);
        }
        cd.OnPushedYesAction = delegate()
        {
            cd.ClosePanel(true);
            this.AccessExchangeLogic(exchangeItem);
        };
    }