private static string GetInfoText(MasterDataMng.AssetCategory category, int payValue, int gashaCount)
        {
            string result = string.Empty;
            string arg    = string.Empty;

            GameWebAPI.RespDataMA_GetAssetCategoryM respDataMA_AssetCategoryM = MasterDataMng.Instance().RespDataMA_AssetCategoryM;
            if (respDataMA_AssetCategoryM != null)
            {
                GameWebAPI.RespDataMA_GetAssetCategoryM respDataMA_GetAssetCategoryM = respDataMA_AssetCategoryM;
                int num = (int)category;
                GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = respDataMA_GetAssetCategoryM.GetAssetCategory(num.ToString());
                if (assetCategory != null)
                {
                    arg = assetCategory.assetTitle;
                }
            }
            if (category == MasterDataMng.AssetCategory.DIGI_STONE || category != MasterDataMng.AssetCategory.LINK_POINT)
            {
                result = string.Format(StringMaster.GetString("GashaDigistone"), arg, payValue, gashaCount);
            }
            else
            {
                result = string.Format(StringMaster.GetString("GashaLinkpoint"), arg, payValue, gashaCount);
            }
            return(result);
        }
 public void SetParam(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM data)
 {
     MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory) int.Parse(data.assetCategoryId);
     if (assetCategory != MasterDataMng.AssetCategory.DIGI_STONE)
     {
         if (assetCategory != MasterDataMng.AssetCategory.LINK_POINT)
         {
             if (assetCategory == MasterDataMng.AssetCategory.TIP)
             {
                 this.titleLabel.text       = data.assetTitle;
                 this.textLabel.text        = StringMaster.GetString("TipDetileText");
                 this.iconSprite.spriteName = "Common02_LB_Chip";
             }
         }
         else
         {
             this.titleLabel.text       = data.assetTitle;
             this.textLabel.text        = StringMaster.GetString("LinkPointDetileText");
             this.iconSprite.spriteName = "Common02_LB_Link";
         }
     }
     else
     {
         this.titleLabel.text       = data.assetTitle;
         this.textLabel.text        = StringMaster.GetString("DigistoneDetileText");
         this.iconSprite.spriteName = "Common02_LB_Stone";
     }
     this.iconSprite.depth = this.iconTexture.depth;
     this.iconSprite.gameObject.SetActive(true);
     this.iconTexture.gameObject.SetActive(false);
 }
    public static CMD_QuestItemPOP Create(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM data)
    {
        CMD_QuestItemPOP cmd_QuestItemPOP = GUIMain.ShowCommonDialog(null, "CMD_QuestItemPOP", null) as CMD_QuestItemPOP;

        cmd_QuestItemPOP.SetParam(data);
        return(cmd_QuestItemPOP);
    }
    public string GetAssetTitle(string categoryId, string soulId)
    {
        string result = string.Empty;

        if (int.Parse(categoryId) == 14)
        {
            GameWebAPI.RespDataMA_GetSoulM respDataMA_SoulM = MasterDataMng.Instance().RespDataMA_SoulM;
            if (respDataMA_SoulM != null)
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = respDataMA_SoulM.GetSoul(soulId);
                if (soul != null)
                {
                    result = soul.soulName;
                }
            }
        }
        else
        {
            GameWebAPI.RespDataMA_GetAssetCategoryM respDataMA_AssetCategoryM = MasterDataMng.Instance().RespDataMA_AssetCategoryM;
            if (respDataMA_AssetCategoryM != null)
            {
                GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = respDataMA_AssetCategoryM.GetAssetCategory(categoryId);
                if (assetCategory != null)
                {
                    result = assetCategory.assetTitle;
                }
            }
        }
        return(result);
    }
Exemple #5
0
    public void DialogDataSet(GameWebAPI.RespDataGA_ExecGacha.GachaRewardsData[] RewardsData)
    {
        this.titleLabel.text      = StringMaster.GetString("CaptureBonusTitle");
        this.presentBoxLabel.text = StringMaster.GetString("CaptureBonusText");
        this.captureBonusItem.gameObject.SetActive(true);
        int           num  = (this.maxColumnNum + 1 >= RewardsData.Length) ? RewardsData.Length : (this.maxColumnNum + 1);
        float         num2 = this.captureBonusItem.GetComponent <BoxCollider>().size.x + this.iconMergine;
        float         num3 = num2 / 2f * (float)(num - 1);
        List <string> list = new List <string>();

        for (int i = 0; i < RewardsData.Length; i++)
        {
            CaptureBonusItem captureBonusItem = UnityEngine.Object.Instantiate <CaptureBonusItem>(this.captureBonusItem);
            captureBonusItem.transform.parent        = base.gameObject.transform;
            captureBonusItem.transform.localScale    = this.captureBonusItem.transform.localScale;
            captureBonusItem.transform.localRotation = this.captureBonusItem.transform.localRotation;
            captureBonusItem.transform.localPosition = new Vector3(this.captureBonusItem.transform.localPosition.x - num3 + num2 * (float)i, this.captureBonusItem.transform.localPosition.y, this.captureBonusItem.transform.localPosition.z);
            if (i >= this.maxColumnNum)
            {
                captureBonusItem.ActivateMore();
                list.Add(StringMaster.GetString("ItemTruncated"));
                break;
            }
            GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(RewardsData[i].assetCategoryId);
            MasterDataMng.AssetCategory assetCategoryId = (MasterDataMng.AssetCategory) int.Parse(RewardsData[i].assetCategoryId);
            list.Add(captureBonusItem.DialogDataSet(assetCategory, assetCategoryId, RewardsData[i]));
        }
        this.captureBonusItem.gameObject.SetActive(false);
        this.itemDetileLabel.text = string.Join("\n", list.ToArray());
    }
    private bool OpenShortCutDialog(UserFacility userFacility)
    {
        bool flag = null != this.buildCostLabel;

        if (flag)
        {
            FacilityM facilityMaster            = FarmDataManager.GetFacilityMaster(userFacility.facilityId);
            string    shorteningAssetCategoryId = facilityMaster.shorteningAssetCategoryId1;
            GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(shorteningAssetCategoryId);
            FacilityUpgradeM facilityUpgradeMaster = FarmDataManager.GetFacilityUpgradeMaster(userFacility.facilityId, userFacility.level);
            GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategoryM = (facilityUpgradeMaster == null) ? null : MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(facilityUpgradeMaster.shorteningAssetCategoryId1);
            CMD_ChangePOP_STONE cmd_ChangePOP_STONE = GUIMain.ShowCommonDialog(null, "CMD_ChangePOP_STONE", null) as CMD_ChangePOP_STONE;
            cmd_ChangePOP_STONE.Title             = StringMaster.GetString("FacilityShortcutTitle");
            cmd_ChangePOP_STONE.OnPushedYesAction = new Action(this.OnPushedShortCutYesButton);
            int point = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.point;
            if (userFacility.level == 0)
            {
                cmd_ChangePOP_STONE.Info = string.Format(StringMaster.GetString("FacilityShortcutBuild"), assetCategory.assetTitle);
            }
            else if (facilityUpgradeMaster != null)
            {
                cmd_ChangePOP_STONE.Info = string.Format(StringMaster.GetString("FacilityShortcutUpgrage"), assetCategoryM.assetTitle);
            }
            cmd_ChangePOP_STONE.SetDigistone(point, this.buildCostLabel.GetCost());
        }
        return(flag);
    }
    private string GetPresentName(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterAssetCategory, string objectId)
    {
        string result = StringMaster.GetString("Present-10");

        if (masterAssetCategory != null)
        {
            result = masterAssetCategory.assetTitle;
        }
        MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory)masterAssetCategory.assetCategoryId.ToInt32();
        switch (assetCategory)
        {
        case MasterDataMng.AssetCategory.FACILITY_KEY:
        {
            FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(objectId);
            if (facilityKeyMaster != null)
            {
                result = facilityKeyMaster.facilityKeyName;
            }
            break;
        }

        default:
            if (assetCategory != MasterDataMng.AssetCategory.MONSTER)
            {
                if (assetCategory == MasterDataMng.AssetCategory.ITEM)
                {
                    GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(objectId);
                    if (itemM != null)
                    {
                        result = itemM.name;
                    }
                }
            }
            else
            {
                GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(objectId).Simple;
                if (simple != null)
                {
                    GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group;
                    if (group != null)
                    {
                        result = group.monsterName;
                    }
                }
            }
            break;

        case MasterDataMng.AssetCategory.DUNGEON_TICKET:
        {
            GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => objectId == x.dungeonTicketId);
            if (dungeonTicketM != null)
            {
                result = dungeonTicketM.name;
            }
            break;
        }
        }
        return(result);
    }
Exemple #8
0
    protected virtual void OpenModalShortageMessage(string categoryId)
    {
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(categoryId);
        CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;

        cmd_ModalMessage.Title = string.Format(StringMaster.GetString("SystemShortage"), assetCategory.assetTitle);
        cmd_ModalMessage.Info  = string.Format(StringMaster.GetString("FacilityUpgradeFailedShortage"), assetCategory.assetTitle);
    }
    protected override void OpenModalShortageMessage(string categoryId)
    {
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(categoryId);
        CMD_Confirm cmd_Confirm = GUIMain.ShowCommonDialog(new Action <int>(this.OnCloseConfirmShop), "CMD_Confirm", null) as CMD_Confirm;

        cmd_Confirm.Title      = string.Format(StringMaster.GetString("SystemShortage"), assetCategory.assetTitle);
        cmd_Confirm.Info       = string.Format(StringMaster.GetString("FacilityUpgradeFailedShortage"), assetCategory.assetTitle);
        cmd_Confirm.BtnTextYes = StringMaster.GetString("SystemButtonGoShop");
        cmd_Confirm.BtnTextNo  = StringMaster.GetString("SystemButtonClose");
    }
Exemple #10
0
 private void ShowData()
 {
     if (this.rewards != null)
     {
         this.rewards.SetItem(GUIListPartsPackItem.Data.assetCategoryId, GUIListPartsPackItem.Data.assetValue, "1", false, null);
     }
     GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(GUIListPartsPackItem.Data.assetCategoryId);
     this.lbTX_ItemName.text = this.rewards.GetPresentName(assetCategory, GUIListPartsPackItem.Data.assetValue, true);
     this.lbTX_ItemNum.text  = StringMaster.GetString("MissionRewardKakeru") + GUIListPartsPackItem.Data.assetNum;
 }
Exemple #11
0
 private void Awake()
 {
     if (this.chipLabel != null)
     {
         GameWebAPI.RespDataMA_GetAssetCategoryM respDataMA_AssetCategoryM = MasterDataMng.Instance().RespDataMA_AssetCategoryM;
         string categoryID = 17.ToString();
         GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = respDataMA_AssetCategoryM.GetAssetCategory(categoryID);
         if (assetCategory != null)
         {
             this.chipLabel.text = assetCategory.assetTitle;
         }
     }
 }
Exemple #12
0
        public static string GetAssetName(string assetCategoryId, string assetValue)
        {
            string result = string.Empty;

            GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(assetCategoryId);
            if (assetCategory != null)
            {
                result = assetCategory.assetTitle;
                int assetCategoryId2;
                if (int.TryParse(assetCategory.assetCategoryId, out assetCategoryId2))
                {
                    string assetValueName = UIAssetName.GetAssetValueName(assetCategoryId2, assetValue);
                    if (!string.IsNullOrEmpty(assetValueName))
                    {
                        result = assetValueName;
                    }
                }
            }
            return(result);
        }
    protected virtual void OnPushedShortCutButton(Touch touch, Vector2 pos, bool touchOver)
    {
        if (!touchOver)
        {
            return;
        }
        UserFacility userFacility = Singleton <UserDataMng> .Instance.GetUserFacility(this.farmObject.userFacilityID);

        FacilityM facilityMaster            = FarmDataManager.GetFacilityMaster(userFacility.facilityId);
        string    shorteningAssetCategoryId = facilityMaster.shorteningAssetCategoryId1;

        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(shorteningAssetCategoryId);
        FacilityUpgradeM facilityUpgradeMaster = FarmDataManager.GetFacilityUpgradeMaster(userFacility.facilityId, userFacility.level);

        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategoryM = (facilityUpgradeMaster == null) ? null : MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(facilityUpgradeMaster.shorteningAssetCategoryId1);
        bool   flag = false;
        string arg  = string.Empty;

        if (userFacility.level == 0)
        {
            flag = FarmUtility.IsShortage(facilityMaster.shorteningAssetCategoryId1, this.buildCostLabel.GetCost().ToString());
            arg  = assetCategory.assetTitle;
        }
        else if (facilityUpgradeMaster != null)
        {
            flag = FarmUtility.IsShortage(facilityUpgradeMaster.shorteningAssetCategoryId1, this.buildCostLabel.GetCost().ToString());
            arg  = assetCategoryM.assetTitle;
        }
        if (flag)
        {
            CMD_Confirm cmd_Confirm = GUIMain.ShowCommonDialog(new Action <int>(this.OnCloseConfirmShop), "CMD_Confirm", null) as CMD_Confirm;
            cmd_Confirm.Title      = string.Format(StringMaster.GetString("SystemShortage"), arg);
            cmd_Confirm.Info       = string.Format(StringMaster.GetString("FacilityShortcutShortage"), arg);
            cmd_Confirm.BtnTextYes = StringMaster.GetString("SystemButtonGoShop");
            cmd_Confirm.BtnTextNo  = StringMaster.GetString("SystemButtonClose");
        }
        else
        {
            this.OpenShortCutDialog(userFacility);
        }
    }
    private void InfoSetting()
    {
        this.goListPartsExchange.SetActive(false);
        if (CMD_ClearingHouse.exchangeResultInfo == null || CMD_ClearingHouse.exchangeResultInfo.detail == null || CMD_ClearingHouse.exchangeResultInfo.detail.Length == 0)
        {
            base.PartsTitle.SetTitle(StringMaster.GetString("ExchangeTitle"));
            this.goEFC_LEFT.SetActive(false);
            this.exchangeEmptyLabel.gameObject.SetActive(true);
            return;
        }
        if (!string.IsNullOrEmpty(CMD_ClearingHouse.exchangeResultInfo.name))
        {
            base.PartsTitle.SetTitle(CMD_ClearingHouse.exchangeResultInfo.name);
        }
        else
        {
            base.PartsTitle.SetTitle(StringMaster.GetString("ExchangeTitle"));
        }
        for (int i = 0; i < this.exchangeBaseObject.Count; i++)
        {
            this.exchangeBaseObject[i].SetActive(false);
        }
        for (int j = 0; j < CMD_ClearingHouse.exchangeResultInfo.detail.Length; j++)
        {
            string assetCategoryId = CMD_ClearingHouse.exchangeResultInfo.detail[j].item.assetCategoryId;
            string assetValue      = CMD_ClearingHouse.exchangeResultInfo.detail[j].item.assetValue;
            string key             = assetCategoryId + assetValue;
            if (!this.itemDictionary.ContainsKey(key) || (this.itemDictionary.ContainsKey(key) && this.itemDictionary[key] != assetValue))
            {
                this.itemDictionary.Add(key, assetValue);
                this.exchangeItemDataList.Add(CMD_ClearingHouse.exchangeResultInfo.detail[j].item);
            }
        }
        int num = 0;

        foreach (string key2 in this.itemDictionary.Keys)
        {
            string itemId = this.exchangeItemDataList[num].assetValue;
            this.exchangeConsumeItemInfo = MasterDataMng.Instance().RespDataMA_ItemM.itemM.SingleOrDefault((GameWebAPI.RespDataMA_GetItemM.ItemM x) => x.itemId == itemId);
            if (this.exchangeBaseObject.Count > num)
            {
                this.exchangeConsumeItemNumLabel[num].text = this.exchangeItemDataList[num].count.ToString();
            }
            string assetCategoryId2  = this.exchangeItemDataList[num].assetCategoryId;
            string consumeAssetValue = this.itemDictionary[key2];
            MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory) int.Parse(assetCategoryId2);
            if (assetCategory == MasterDataMng.AssetCategory.ITEM)
            {
                if (this.exchangeBaseObject.Count > num)
                {
                    this.exchangeConsumeSprite[num].enabled  = false;
                    this.exchangeConsumeTexture[num].enabled = true;
                }
                if (this.exchangeConsumeItemInfo != null)
                {
                    this.exchangeConsumeItemTexturePath = this.exchangeConsumeItemInfo.GetSmallImagePath();
                    this.exchangeItemPathList.Add(this.exchangeConsumeItemTexturePath);
                    this.exchangeConsumeItemName.Add(this.exchangeConsumeItemInfo.name);
                    if (this.exchangeBaseObject.Count > num)
                    {
                        NGUIUtil.ChangeUITextureFromFile(this.exchangeConsumeTexture[num], this.exchangeConsumeItemTexturePath, false);
                    }
                }
            }
            else
            {
                if (this.exchangeBaseObject.Count > num)
                {
                    this.exchangeConsumeSprite[num].enabled  = true;
                    this.exchangeConsumeTexture[num].enabled = false;
                }
                GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory2 = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(assetCategoryId2);
                if (assetCategory2 != null)
                {
                    this.exchangeConsumeItemName.Add(assetCategory2.assetTitle);
                }
                string text = string.Empty;
                switch (assetCategory)
                {
                case MasterDataMng.AssetCategory.DIGI_STONE:
                    text = "Common02_ShopList_1";
                    this.exchangeItemPathList.Add(text);
                    break;

                case MasterDataMng.AssetCategory.LINK_POINT:
                    text = "Common02_Icon_Link";
                    this.exchangeItemPathList.Add(text);
                    break;

                case MasterDataMng.AssetCategory.TIP:
                    text = "Common02_Icon_Chip";
                    this.exchangeItemPathList.Add(text);
                    break;

                default:
                    switch (assetCategory)
                    {
                    case MasterDataMng.AssetCategory.MEAT:
                        text = "Common02_Icon_Meat";
                        this.exchangeItemPathList.Add(text);
                        break;

                    case MasterDataMng.AssetCategory.SOUL:
                        this.exchangeConsumeItemTexturePath = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(consumeAssetValue);

                        if (this.exchangeBaseObject.Count > num)
                        {
                            this.exchangeConsumeTexture[num].enabled = true;
                            NGUIUtil.ChangeUITextureFromFile(this.exchangeConsumeTexture[num], this.exchangeConsumeItemTexturePath, false);
                        }
                        this.exchangeItemPathList.Add(this.exchangeConsumeItemTexturePath);
                        break;

                    case MasterDataMng.AssetCategory.DUNGEON_TICKET:
                    {
                        GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => consumeAssetValue == x.dungeonTicketId);
                        if (dungeonTicketM != null)
                        {
                            this.exchangeConsumeItemTexturePath = dungeonTicketM.img;
                            this.exchangeItemPathList.Add(this.exchangeConsumeItemTexturePath);
                            if (this.exchangeBaseObject.Count > num)
                            {
                                this.exchangeConsumeTexture[num].enabled = true;
                                if (dungeonTicketM != null)
                                {
                                    NGUIUtil.ChangeUITextureFromFile(this.exchangeConsumeTexture[num], this.exchangeConsumeItemTexturePath, false);
                                }
                            }
                        }
                        break;
                    }
                    }
                    break;
                }
                if (this.exchangeBaseObject.Count > num)
                {
                    if (!string.IsNullOrEmpty(text))
                    {
                        this.exchangeConsumeSprite[num].spriteName = text;
                    }
                    else
                    {
                        this.exchangeConsumeSprite[num].enabled = false;
                    }
                }
            }
            if (this.exchangeBaseObject.Count > num)
            {
                this.exchangeBaseObject[num].SetActive(true);
            }
            num++;
        }
        if (CMD_ClearingHouse.exchangeResultInfo.IsAlways())
        {
            this.exchangeLimitLabel.transform.parent.gameObject.SetActive(false);
        }
        else
        {
            base.InvokeRepeating("TimeSetting", 1f, 1f);
            this.TimeSetting();
        }
        this.SetCommonUI_Exchange();
        this.InitExchangeList();
        this.SetExchangeDetail();
    }
    public void ItemIconOnTap()
    {
        if (this.numUpButtonCollider.isTouching || this.numDownButtonCollider.isTouching)
        {
            return;
        }
        MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory) int.Parse(this.exchangeInfoData.assetCategoryId);
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory2 = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(this.exchangeInfoData.assetCategoryId);
        switch (assetCategory)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            if (!string.IsNullOrEmpty(this.exchangeInfoData.monsterFixedValueId))
            {
                MonsterFixedM fixedValues = MonsterFixedData.GetMonsterFixedMaster(this.exchangeInfoData.monsterFixedValueId);
                if (fixedValues != null)
                {
                    CMD_MonsterParamPop cmd_MonsterParamPop          = GUIMain.ShowCommonDialog(null, "CMD_MonsterParamPop", null) as CMD_MonsterParamPop;
                    MonsterData         digimonData                  = MonsterDataMng.Instance().CreateMonsterDataByMID(this.exchangeInfoData.assetValue);
                    GameWebAPI.RespDataMA_GetSkillM.SkillM[] skillM  = MasterDataMng.Instance().RespDataMA_SkillM.skillM;
                    GameWebAPI.RespDataMA_GetSkillM.SkillM   skillM2 = skillM.FirstOrDefault((GameWebAPI.RespDataMA_GetSkillM.SkillM x) => x.skillGroupId == digimonData.monsterM.skillGroupId && x.skillGroupSubId == fixedValues.defaultSkillGroupSubId);
                    if (int.Parse(fixedValues.level) > int.Parse(digimonData.monsterM.maxLevel))
                    {
                        fixedValues.level = digimonData.monsterM.maxLevel;
                    }
                    int lvMAXExperienceInfo = DataMng.Instance().GetLvMAXExperienceInfo(int.Parse(fixedValues.level));
                    DataMng.ExperienceInfo experienceInfo = DataMng.Instance().GetExperienceInfo(lvMAXExperienceInfo);
                    digimonData.userMonster.luck                   = fixedValues.luck;
                    digimonData.userMonster.friendship             = "0";
                    digimonData.userMonster.level                  = fixedValues.level;
                    digimonData.userMonster.hpAbility              = fixedValues.hpAbility;
                    digimonData.userMonster.hpAbilityFlg           = fixedValues.hpAbilityFlg.ToString();
                    digimonData.userMonster.attackAbility          = fixedValues.attackAbility;
                    digimonData.userMonster.attackAbilityFlg       = fixedValues.attackAbilityFlg.ToString();
                    digimonData.userMonster.defenseAbility         = fixedValues.defenseAbility;
                    digimonData.userMonster.defenseAbilityFlg      = fixedValues.defenseAbilityFlg.ToString();
                    digimonData.userMonster.spAttackAbility        = fixedValues.spAttackAbility;
                    digimonData.userMonster.spAttackAbilityFlg     = fixedValues.spAttackAbilityFlg.ToString();
                    digimonData.userMonster.spDefenseAbility       = fixedValues.spDefenseAbility;
                    digimonData.userMonster.spDefenseAbilityFlg    = fixedValues.spDefenseAbilityFlg.ToString();
                    digimonData.userMonster.speedAbility           = fixedValues.speedAbility;
                    digimonData.userMonster.speedAbilityFlg        = fixedValues.speedAbilityFlg.ToString();
                    digimonData.userMonster.commonSkillId          = fixedValues.commonSkillId;
                    digimonData.userMonster.leaderSkillId          = fixedValues.leaderSkillId;
                    digimonData.userMonster.defaultSkillGroupSubId = fixedValues.defaultSkillGroupSubId;
                    digimonData.userMonster.uniqueSkillId          = skillM2.skillId;
                    digimonData.InitSkillInfo();
                    cmd_MonsterParamPop.MonsterDataSet(digimonData, experienceInfo, int.Parse(this.exchangeInfoData.maxExtraSlotNum), this.exchangeItemData.eventExchangeId);
                }
            }
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
            CMD_QuestItemPOP.Create(assetCategory2);
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            CMD_QuestItemPOP.Create(assetCategory2);
            break;

        case MasterDataMng.AssetCategory.TIP:
            CMD_QuestItemPOP.Create(assetCategory2);
            break;

        default:
            switch (assetCategory)
            {
            case MasterDataMng.AssetCategory.SOUL:
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(this.exchangeInfoData.assetValue);
                CMD_QuestItemPOP.Create(soul);
                break;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
            {
                FacilityConditionM[] facilityCondition         = FarmDataManager.GetFacilityCondition(this.exchangeInfoData.assetValue);
                FacilityConditionM   facilityConditionM        = facilityCondition.FirstOrDefault((FacilityConditionM x) => int.Parse(x.conditionType) == 1);
                FacilityM            facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(facilityConditionM.releaseId);
                CMD_QuestItemPOP.Create(facilityConditionM, this.exchangeInfoData.assetValue, facilityMasterByReleaseId);
                break;
            }

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(this.exchangeInfoData.assetValue);
                CMD_QuestItemPOP.Create(chipMainData);
                break;
            }

            case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            {
                string ticketValue = this.exchangeInfoData.assetValue;
                GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM data = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => x.dungeonTicketId == ticketValue);
                CMD_QuestItemPOP.Create(data);
                break;
            }
            }
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(this.exchangeInfoData.assetValue);
            CMD_QuestItemPOP.Create(itemM);
            break;
        }
        }
    }
    public void SetItem(string assetCategoryId, string objectId, string num, bool isLoadASync = false, Action callback = null)
    {
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(assetCategoryId);
        MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory)assetCategory.assetCategoryId.ToInt32();
        this.itemName = this.GetPresentName(assetCategory, objectId);
        string arg;

        if (assetCategory2 == MasterDataMng.AssetCategory.TIP)
        {
            arg = StringFormat.Cluster(num);
        }
        else
        {
            arg = num;
        }
        if (this.itemNameLabel != null)
        {
            if (assetCategory2 == MasterDataMng.AssetCategory.FACILITY_KEY)
            {
                this.itemNameLabel.text = this.itemName;
            }
            else
            {
                this.itemNameLabel.text = string.Format(StringMaster.GetString("SystemItemCount"), this.itemName, arg);
            }
        }
        switch (assetCategory2)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            if (null != this.monsterIcon)
            {
                UnityEngine.Object.Destroy(this.monsterIcon.gameObject);
            }
            this.monsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(MonsterDataMng.Instance().CreateMonsterDataByMID(objectId), Vector3.one, Vector3.zero, this.iconSprite.transform, true, false);
            this.monsterIcon.ResizeIcon(this.iconSprite.width, this.iconSprite.height);
            if (null != this.monsterIcon)
            {
                DepthController depthController = this.monsterIcon.GetDepthController();
                if (null != depthController)
                {
                    depthController.AddWidgetDepth(this.monsterIcon.transform, this.iconSprite.depth + 10);
                }
            }
            if (callback != null)
            {
                callback();
            }
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
        case MasterDataMng.AssetCategory.LINK_POINT:
        case MasterDataMng.AssetCategory.TIP:
        case MasterDataMng.AssetCategory.EXP:
        case MasterDataMng.AssetCategory.MEAT:
            this.iconSprite.enabled    = true;
            this.iconSprite.spriteName = this.GetSpriteName(assetCategory2);
            if (callback != null)
            {
                callback();
            }
            break;

        case MasterDataMng.AssetCategory.ITEM:
        case MasterDataMng.AssetCategory.SOUL:
        case MasterDataMng.AssetCategory.FACILITY_KEY:
        case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            this.iconTexture.enabled = true;
            if (isLoadASync)
            {
                NGUIUtil.ChangeUITextureFromFileASync(this.iconTexture, this.GetTexturePath(assetCategory2, objectId), false, callback);
            }
            else
            {
                NGUIUtil.ChangeUITextureFromFile(this.iconTexture, this.GetTexturePath(assetCategory2, objectId), false);
                if (callback != null)
                {
                    callback();
                }
            }
            if (assetCategory2 == MasterDataMng.AssetCategory.FACILITY_KEY)
            {
                this.iconSprite.enabled    = true;
                this.iconSprite.spriteName = "Common02_item_flame";
            }
            break;

        case MasterDataMng.AssetCategory.CHIP:
        {
            GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(objectId);
            ChipDataMng.MakePrefabByChipData(chipMainData, this.iconSprite.gameObject, this.iconSprite.transform.localPosition, this.iconSprite.transform.localScale, delegate(ChipIcon result)
                {
                    if (callback != null)
                    {
                        callback();
                    }
                }, this.iconSprite.width, this.iconSprite.height, true);
            break;
        }
        }
        this.uiBasicSprites = base.transform.GetComponentsInParent <UIBasicSprite>(true);
    }
    public void SetDetail(GameWebAPI.RespDataMS_EventExchangeInfoLogic.Result.Detail exchangeInfo, int selectItemNum, Action <ExchangeItem> touchEvent)
    {
        this.onPushedButton = touchEvent;
        GUICollider component = this.pushedButton.GetComponent <GUICollider>();

        component.onTouchEnded += delegate(Touch touch, Vector2 pos, bool flag)
        {
            this.onPushedButton(this);
        };
        this.selectNum = selectItemNum;
        int.TryParse(exchangeInfo.eventExchangeDetailId, out this.exchangeDetailId);
        this.exchangeItemData = exchangeInfo.item;
        string text  = string.Empty;
        string value = string.Empty;

        this.exchangeInfoData = exchangeInfo;
        this.viewIcon.gameObject.SetActive(true);
        this.viewIconTexture.gameObject.SetActive(false);
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(exchangeInfo.assetCategoryId);
        string text2 = string.Empty;

        if (assetCategory != null)
        {
            text2 = assetCategory.assetTitle;
        }
        this.exchangeDetailCategoryID = exchangeInfo.assetCategoryId;
        MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory) int.Parse(exchangeInfo.assetCategoryId);
        this.numCountLabel.text = "1";
        switch (assetCategory2)
        {
        case MasterDataMng.AssetCategory.MONSTER:
        {
            text = string.Empty;
            if (this.micon != null)
            {
                UnityEngine.Object.Destroy(this.micon.gameObject);
            }
            this.viewIcon.gameObject.SetActive(false);
            MonsterData monsterData = MonsterDataMng.Instance().CreateMonsterDataByMID(exchangeInfo.assetValue);
            this.exchangeDetailName = monsterData.monsterMG.monsterName;
            this.micon = GUIMonsterIcon.MakePrefabByMonsterData(monsterData, new Vector3(1f, 1f, 1f), new Vector3(-165f, 25f, 0f), this.iconRoot.transform, true, false);
            UIWidget component2 = base.gameObject.GetComponent <UIWidget>();
            if (component2 != null)
            {
                DepthController component3 = this.micon.GetComponent <DepthController>();
                if (component3 != null)
                {
                    component3.AddWidgetDepth(this.micon.transform, component2.depth + 10);
                }
            }
            this.micon.GetDepthController();
            BoxCollider component4 = this.micon.gameObject.GetComponent <BoxCollider>();
            if (component4 != null)
            {
                component4.enabled = false;
            }
            break;
        }

        case MasterDataMng.AssetCategory.DIGI_STONE:
            text = "Common02_LB_Stone";
            this.exchangeDetailName = text2;
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            text = "Common02_LB_Link";
            this.exchangeDetailName = text2;
            break;

        case MasterDataMng.AssetCategory.TIP:
            text = "Common02_LB_Chip";
            this.exchangeDetailName = text2;
            break;

        default:
            switch (assetCategory2)
            {
            case MasterDataMng.AssetCategory.MEAT:
                text = "Common02_item_meat";
                this.exchangeDetailName = text2;
                goto IL_567;

            case MasterDataMng.AssetCategory.SOUL:
            {
                this.exchangeDetailName = text2;
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(exchangeInfo.assetValue);
                value = soul.soulName;
                this.viewIconTexture.gameObject.SetActive(true);
                string evolveItemIconPathByID = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(exchangeInfo.assetValue);

                NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, evolveItemIconPathByID, false);
                this.viewIcon.gameObject.SetActive(false);
                goto IL_567;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
            {
                this.viewIconTexture.gameObject.SetActive(true);
                this.viewIcon.gameObject.SetActive(false);
                FacilityConditionM[] facilityCondition         = FarmDataManager.GetFacilityCondition(exchangeInfo.assetValue);
                FacilityConditionM   facilityConditionM        = facilityCondition.FirstOrDefault((FacilityConditionM x) => int.Parse(x.conditionType) == 1);
                FacilityM            facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(facilityConditionM.releaseId);
                NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, facilityMasterByReleaseId.GetIconPath(), false);
                FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(exchangeInfo.assetValue);
                if (facilityKeyMaster != null)
                {
                    this.exchangeDetailName = facilityKeyMaster.facilityKeyName;
                }
                goto IL_567;
            }

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(exchangeInfo.assetValue);
                ChipDataMng.MakePrefabByChipData(chipMainData, this.viewIcon.gameObject, this.viewIcon.gameObject.transform.localPosition, this.viewIcon.gameObject.transform.localScale, null, 128, 128, false);
                this.exchangeDetailName = chipMainData.name;
                this.viewIcon.gameObject.SetActive(false);
                goto IL_567;
            }

            case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            {
                this.viewIconTexture.gameObject.SetActive(true);
                this.viewIcon.gameObject.SetActive(false);
                GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => exchangeInfo.assetValue == x.dungeonTicketId);
                if (dungeonTicketM != null)
                {
                    global::Debug.Log(dungeonTicketM.img);
                    NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, dungeonTicketM.img, false);
                    this.exchangeDetailName = dungeonTicketM.name;
                }
                goto IL_567;
            }
            }
            text = string.Empty;
            this.exchangeDetailName = StringMaster.GetString("Present-10");
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(exchangeInfo.assetValue);
            if (itemM != null)
            {
                this.exchangeDetailName = itemM.name;
                this.viewIconTexture.gameObject.SetActive(true);
                this.viewIcon.gameObject.SetActive(false);
                string largeImagePath = itemM.GetLargeImagePath();
                NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, largeImagePath, false);
            }
            break;
        }
        }
IL_567:
        if (!string.IsNullOrEmpty(text) && assetCategory2 != MasterDataMng.AssetCategory.MONSTER)
        {
            this.viewIcon.spriteName = text;
        }
        if (assetCategory2 == MasterDataMng.AssetCategory.TIP)
        {
            this.exchangeDetailNum = StringFormat.Cluster(exchangeInfo.assetNum);
        }
        else
        {
            this.exchangeDetailNum = exchangeInfo.assetNum;
        }
        if (assetCategory2 != MasterDataMng.AssetCategory.MONSTER)
        {
            this.titleLabel.text = string.Format(StringMaster.GetString("SystemItemCount"), this.exchangeDetailName, this.exchangeDetailNum);
        }
        else
        {
            this.titleLabel.text = this.exchangeDetailName;
        }
        if (!string.IsNullOrEmpty(value))
        {
            this.exchangeDetailName = value;
        }
        this.exchangeConsumeNum = exchangeInfo.needNum;
        this.buildNumLabel.text = this.exchangeConsumeNum;
        this.ExchangeIconSet(exchangeInfo);
        this.ResetNum(exchangeInfo);
        this.SetButton(exchangeInfo);
        this.ShowGUI();
    }
    private void ActCallBackDropItem(int idx)
    {
        if (this.isClosed)
        {
            return;
        }
        MasterDataMng.AssetCategory assetCategoryId = (MasterDataMng.AssetCategory) this.dropAssetList[idx].assetCategoryId;
        string text = this.dropAssetList[idx].assetValue.ToString();

        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(this.dropAssetList[idx].assetCategoryId.ToString());
        switch (assetCategoryId)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
            CMD_QuestItemPOP.Create(assetCategory);
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            CMD_QuestItemPOP.Create(assetCategory);
            break;

        case MasterDataMng.AssetCategory.TIP:
            CMD_QuestItemPOP.Create(assetCategory);
            break;

        default:
            switch (assetCategoryId)
            {
            case MasterDataMng.AssetCategory.SOUL:
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(text);
                CMD_QuestItemPOP.Create(soul);
                break;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
            {
                FacilityConditionM[] facilityCondition         = FarmDataManager.GetFacilityCondition(text);
                FacilityConditionM   facilityConditionM        = facilityCondition.FirstOrDefault((FacilityConditionM x) => int.Parse(x.conditionType) == 1);
                FacilityM            facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(facilityConditionM.releaseId);
                CMD_QuestItemPOP.Create(facilityConditionM, text, facilityMasterByReleaseId);
                break;
            }

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(text);
                CMD_QuestItemPOP.Create(chipMainData);
                break;
            }

            case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            {
                string ticketValue = text;
                GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM data = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => x.dungeonTicketId == ticketValue);
                CMD_QuestItemPOP.Create(data);
                break;
            }
            }
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(text);
            CMD_QuestItemPOP.Create(itemM);
            break;
        }
        }
    }
Exemple #19
0
 private static CommonDialog CreatePopupClusterDetail(string assetCategoryId, string assetValue)
 {
     GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(assetCategoryId);
     return(CMD_QuestItemPOP.Create(assetCategory));
 }
    public string DialogDataSet(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterUpgradeCategory, MasterDataMng.AssetCategory assetCategoryId, GameWebAPI.RespDataGA_ExecGacha.GachaRewardsData RewardsData)
    {
        string text = string.Empty;

        if (masterUpgradeCategory != null)
        {
            text = masterUpgradeCategory.assetTitle;
        }
        string arg = string.Empty;

        this.iconTexture.gameObject.SetActive(false);
        this.iconSprite.gameObject.SetActive(false);
        this.textMore.gameObject.SetActive(false);
        switch (assetCategoryId)
        {
        case MasterDataMng.AssetCategory.MONSTER:
        {
            MonsterData    monsterData    = MonsterDataMng.Instance().CreateMonsterDataByMID(RewardsData.assetValue);
            GUIMonsterIcon guimonsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(MonsterDataMng.Instance().CreateMonsterDataByMID(RewardsData.assetValue), Vector3.one, Vector3.zero, this.iconSprite.transform, true, false);
            guimonsterIcon.ResizeIcon(this.iconSprite.width, this.iconSprite.height);
            if (null != guimonsterIcon)
            {
                DepthController depthController = guimonsterIcon.GetDepthController();
                if (null != depthController)
                {
                    depthController.AddWidgetDepth(guimonsterIcon.transform, this.iconSprite.depth + 10);
                    this.iconSprite.gameObject.SetActive(true);
                }
            }
            arg = monsterData.monsterMG.monsterName;
            break;
        }

        case MasterDataMng.AssetCategory.DIGI_STONE:
            arg = text;
            this.iconSprite.gameObject.SetActive(true);
            this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            arg = text;
            this.iconSprite.gameObject.SetActive(true);
            this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
            break;

        case MasterDataMng.AssetCategory.TIP:
            this.iconSprite.gameObject.SetActive(true);
            this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
            arg = text;
            break;

        default:
            switch (assetCategoryId)
            {
            case MasterDataMng.AssetCategory.MEAT:
                this.iconSprite.gameObject.SetActive(true);
                this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
                arg = text;
                goto IL_2FA;

            case MasterDataMng.AssetCategory.SOUL:
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(RewardsData.assetValue);
                arg = soul.soulName;
                NGUIUtil.ChangeUITextureFromFile(this.iconTexture, this.GetTexturePath(assetCategoryId, RewardsData.assetValue), false);
                this.iconTexture.gameObject.SetActive(true);
                goto IL_2FA;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
                arg = text;
                goto IL_2FA;

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(RewardsData.assetValue);
                ChipDataMng.MakePrefabByChipData(chipMainData, this.iconSprite.gameObject, this.iconSprite.transform.localPosition, this.iconSprite.transform.localScale, null, -1, -1, true);
                arg = chipMainData.name;
                goto IL_2FA;
            }
            }
            arg = StringMaster.GetString("Present-10");
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(RewardsData.assetValue);
            if (itemM != null)
            {
                arg = itemM.name;
                NGUIUtil.ChangeUITextureFromFile(this.iconTexture, this.GetTexturePath(assetCategoryId, RewardsData.assetValue), false);
                this.iconTexture.gameObject.SetActive(true);
            }
            break;
        }
        }
IL_2FA:
        return(string.Format(StringMaster.GetString("CaptureBonusItem"), arg, RewardsData.count));
    }
Exemple #21
0
    private string GetDetailText(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterUpgradeCategory, MasterDataMng.AssetCategory assetCategoryId, GameWebAPI.RespDataGA_ExecGacha.GachaRewardsData RewardsData)
    {
        string text = string.Empty;

        if (masterUpgradeCategory != null)
        {
            text = masterUpgradeCategory.assetTitle;
        }
        string arg = string.Empty;

        switch (assetCategoryId)
        {
        case MasterDataMng.AssetCategory.MONSTER:
        {
            MonsterData monsterData = MonsterDataMng.Instance().CreateMonsterDataByMID(RewardsData.assetValue);
            arg = monsterData.monsterMG.monsterName;
            break;
        }

        case MasterDataMng.AssetCategory.DIGI_STONE:
            arg = text;
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            arg = text;
            break;

        case MasterDataMng.AssetCategory.TIP:
            arg = text;
            break;

        default:
            switch (assetCategoryId)
            {
            case MasterDataMng.AssetCategory.MEAT:
                arg = text;
                goto IL_117;

            case MasterDataMng.AssetCategory.SOUL:
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(RewardsData.assetValue);
                arg = soul.soulName;
                goto IL_117;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
                arg = text;
                goto IL_117;

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(RewardsData.assetValue);
                arg = chipMainData.name;
                goto IL_117;
            }
            }
            arg = StringMaster.GetString("Present-10");
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(RewardsData.assetValue);
            if (itemM != null)
            {
                arg = itemM.name;
            }
            break;
        }
        }
IL_117:
        return(string.Format(StringMaster.GetString("CaptureBonusItem"), arg, RewardsData.count));
    }
Exemple #22
0
    public string GetPresentName(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterAssetCategory, string objectId, bool showDetail = false)
    {
        string result = StringMaster.GetString("Present-10");

        if (masterAssetCategory != null)
        {
            result = masterAssetCategory.assetTitle;
        }
        MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory)masterAssetCategory.assetCategoryId.ToInt32();
        switch (assetCategory)
        {
        case MasterDataMng.AssetCategory.FACILITY_KEY:
        {
            FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(objectId);
            if (facilityKeyMaster != null)
            {
                result = facilityKeyMaster.facilityKeyName;
            }
            break;
        }

        default:
            if (assetCategory != MasterDataMng.AssetCategory.MONSTER)
            {
                if (assetCategory == MasterDataMng.AssetCategory.ITEM)
                {
                    GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(objectId);
                    if (itemM != null)
                    {
                        result = itemM.name;
                    }
                }
            }
            else
            {
                GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(objectId).Simple;
                if (simple != null)
                {
                    GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group;
                    if (group != null)
                    {
                        result = group.monsterName;
                    }
                }
            }
            break;

        case MasterDataMng.AssetCategory.DUNGEON_TICKET:
        {
            GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => objectId == x.dungeonTicketId);
            if (dungeonTicketM != null)
            {
                result = dungeonTicketM.name;
            }
            break;
        }

        case MasterDataMng.AssetCategory.TITLE:
        {
            GameWebAPI.RespDataMA_TitleMaster.TitleM titleM = TitleDataMng.GetDictionaryTitleM()[int.Parse(objectId)];
            if (titleM != null)
            {
                result = titleM.name;
            }
            break;
        }
        }
        if (showDetail)
        {
            MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory)masterAssetCategory.assetCategoryId.ToInt32();
            if (assetCategory2 != MasterDataMng.AssetCategory.CHIP)
            {
                if (assetCategory2 == MasterDataMng.AssetCategory.SOUL)
                {
                    GameWebAPI.RespDataMA_GetSoulM.SoulM soulMasterBySoulId = VersionUpMaterialData.GetSoulMasterBySoulId(objectId);
                    result = soulMasterBySoulId.soulName;
                }
            }
            else
            {
                int chipId = int.Parse(objectId);
                GameWebAPI.RespDataMA_ChipM.Chip chipMaster = ChipDataMng.GetChipMaster(chipId);
                result = chipMaster.name;
            }
        }
        return(result);
    }