【抽卡】仙缘汇聚箱加入山河社稷图星数条件

dev_chengFeng
gaoxin 2021-05-24 20:33:26 +08:00
parent 40fcabaf55
commit bfbc185604
1 changed files with 18 additions and 10 deletions

View File

@ -7,8 +7,9 @@ local sortingOrder=0
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local specialConfig=ConfigManager.GetConfig(ConfigName.SpecialConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local s --s1 消耗道具 s2消耗数量
local b --充值数
local _CostItem --s1 消耗道具 s2消耗数量
local _Con_Recharge --充值数
local _Con_Star --充值数
function this:InitComponent(gameObject)
this.spLoader = SpriteLoader.New()
@ -22,7 +23,7 @@ end
function this:BindEvent()
Util.AddClick(this.okBtn,function()
if BagManager.GetItemCountById(94)< tonumber(s) then
if BagManager.GetItemCountById(94)< tonumber(_CostItem) then
PopupTipPanel.ShowTip(Language[11585])
return
end
@ -45,16 +46,23 @@ function this:OnShow(_parent,...)
parent=_parent
sortingOrder =_parent.sortingOrder
local args = {...}
s=lotterySetting[RecruitType.RecruitBox].CostItem[1][2]
b=tonumber(specialConfig[49].Value)
_CostItem=lotterySetting[RecruitType.RecruitBox]._CostItem[1][2]
local con = string.split(specialConfig[49].Value, "#")
_Con_Recharge = tonumber(con[1])
_Con_Star = tonumber(con[2])
this.titleText.text=Language[11587]
this.text1.text=string.format(Language[11588],s)
this.text1.text=string.format(Language[11588],_CostItem)
this.text2.text=Language[11589] --后续改成读表
this.text3.text=Language[11590]..string.format(MoneyUtil.GetMoneyUnitName(),b)..Language[11591]
this.text3.text= string.format("充值%s元或山河社稷图累计星数到达%s开启", string.format(MoneyUtil.GetMoneyUnitName(), _Con_Recharge), _Con_Star)
--Language[11590]..string.format(MoneyUtil.GetMoneyUnitName(),_Con_Recharge)..Language[11591]
local isUnlock = VipManager.GetChargedNum() >= _Con_Recharge or FightLevelManager.GetAllChapterStars() >= _Con_Star
this.curNum.text=string.format(Language[11586],BagManager.GetItemCountById(94))
Util.SetGray(this.okBtn,VipManager.GetChargedNum()<b)
this.okBtn:GetComponent("Button").interactable=VipManager.GetChargedNum()>=b
this.text3.gameObject:SetActive(VipManager.GetChargedNum()>=0 and VipManager.GetChargedNum()<b)
Util.SetGray(this.okBtn, not isUnlock)
this.okBtn:GetComponent("Button").interactable = isUnlock
this.text3.gameObject:SetActive(not isUnlock)
end
function this:OnClose()