public void RecoverPlayLimit(GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons dng, Action <GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons> actCallBackRcv) { RestrictionInput.StartLoad(RestrictionInput.LoadType.SMALL_IMAGE_MASK_ON); GameWebAPI.RequestWD_RecoverPlayLimit request = new GameWebAPI.RequestWD_RecoverPlayLimit { SetSendData = delegate(GameWebAPI.WD_RecoverPlayLimit param) { param.worldDungeonId = dng.worldDungeonId; }, OnReceived = delegate(WebAPI.ResponseData res) { GameWebAPI.RespDataWD_GetDungeonInfo.PlayLimit playLimit = dng.playLimit; playLimit.restCount = int.Parse(playLimit.recoveryCount).ToString(); if (playLimit.recoveryAssetCategoryId == 2) { int num = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.point; num -= dng.playLimit.recoveryAssetNum; DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.point = num; } else if (playLimit.recoveryAssetCategoryId == 6) { Singleton <UserDataMng> .Instance.UpdateUserItemNum(playLimit.recoveryAssetValue, -playLimit.recoveryAssetNum); } else { Debug.LogError("===================================回数制限DNG: サポートされてないAsssetCategoryID"); } actCallBackRcv(dng); } }; AppCoroutine.Start(request.Run(delegate() { RestrictionInput.EndLoad(); }, null, null), false); }
public void RefreshShowPlayLimit() { if (this.WorldDungeonData.dungeon.playLimit != null) { this.ngTXT_PLAY_LIMIT.gameObject.SetActive(true); GameWebAPI.RespDataWD_GetDungeonInfo.PlayLimit playLimit = this.WorldDungeonData.dungeon.playLimit; int num = int.Parse(playLimit.restCount); this.ngTXT_PLAY_LIMIT.gameObject.SetActive(false); this.ngTXT_TICKET_LEFT.gameObject.SetActive(false); this.spGRAYOUT_PLAY_LIMIT.gameObject.SetActive(false); string text = string.Empty; if (playLimit.limitType == "1") { text = StringMaster.GetString("QuestPlayLimitBattle"); } else if (playLimit.limitType == "2") { text = StringMaster.GetString("QuestPlayLimitClear"); } if (playLimit.recoveryFlg == "1") { if (playLimit.dailyResetFlg == "1") { text += string.Format(StringMaster.GetString("PlayLimitQuestRestCT_4"), num); } else { text += string.Format(StringMaster.GetString("PlayLimitQuestRestCT_3"), num); } } else { if (0 >= num) { text = string.Empty; this.ngTXT_PLAY_LIMIT.gameObject.SetActive(true); this.ngTXT_PLAY_LIMIT.text = StringMaster.GetString("PlayLimitQuestRestNone"); this.spGRAYOUT_PLAY_LIMIT.gameObject.SetActive(true); GUICollider component = base.gameObject.GetComponent <GUICollider>(); if (null != component) { component.activeCollider = false; } this.ngTXT_TICKET_LEFT.text = text; return; } text += string.Format(StringMaster.GetString("PlayLimitQuestRestCT_3"), num); } this.ngTXT_TICKET_LEFT.gameObject.SetActive(true); this.ngTXT_TICKET_LEFT.text = text; } else { this.ngTXT_PLAY_LIMIT.gameObject.SetActive(false); this.ngTXT_TICKET_LEFT.text = string.Empty; this.ngTXT_TICKET_LEFT.gameObject.SetActive(false); this.spGRAYOUT_PLAY_LIMIT.gameObject.SetActive(false); } }
public void UsePlayLimitNumCont() { if (this.dngPlayLimit_cache != null && this.dngPlayLimit_cache.playLimit != null) { GameWebAPI.RespDataWD_GetDungeonInfo.PlayLimit playLimit = this.dngPlayLimit_cache.playLimit; int num = int.Parse(playLimit.restCount); num -= this.dngPlayLimit_UseCount_cache; if (0 > num) { num = 0; } playLimit.restCount = num.ToString(); this.dngPlayLimit_cache = null; } }
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); }