2021-04-21 13:12:04 +08:00
|
|
|
|
----- 点将台抽卡 宝箱弹窗 -----
|
2020-05-25 19:16:23 +08:00
|
|
|
|
local this = {}
|
|
|
|
|
--传入父脚本模块
|
|
|
|
|
local parent
|
|
|
|
|
--传入特效层级
|
|
|
|
|
local sortingOrder=0
|
|
|
|
|
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
|
|
|
|
|
local specialConfig=ConfigManager.GetConfig(ConfigName.SpecialConfig)
|
|
|
|
|
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
2021-05-24 20:33:26 +08:00
|
|
|
|
local _CostItem --s1 消耗道具 s2消耗数量
|
|
|
|
|
local _Con_Recharge --充值数
|
|
|
|
|
local _Con_Star --充值数
|
2020-05-25 19:16:23 +08:00
|
|
|
|
|
|
|
|
|
function this:InitComponent(gameObject)
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader = SpriteLoader.New()
|
2020-05-25 19:16:23 +08:00
|
|
|
|
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
|
|
|
|
this.text1=Util.GetGameObject(gameObject,"Body/Text1"):GetComponent("Text")
|
|
|
|
|
this.text2=Util.GetGameObject(gameObject,"Body/Text2"):GetComponent("Text")
|
|
|
|
|
this.text3=Util.GetGameObject(gameObject,"Body/Text3"):GetComponent("Text")
|
|
|
|
|
this.curNum=Util.GetGameObject(gameObject,"Body/CurNum/Text"):GetComponent("Text")
|
|
|
|
|
this.okBtn=Util.GetGameObject(gameObject,"OkBtn")
|
2021-11-02 09:29:07 +08:00
|
|
|
|
this.anim = Util.GetGameObject(gameObject, "Body/boxIcon"):GetComponent("Animator")
|
2020-05-25 19:16:23 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:BindEvent()
|
|
|
|
|
Util.AddClick(this.okBtn,function()
|
2021-05-24 20:33:26 +08:00
|
|
|
|
if BagManager.GetItemCountById(94)< tonumber(_CostItem) then
|
2021-11-02 09:29:07 +08:00
|
|
|
|
-- PopupTipPanel.ShowTip(Language[11585])
|
|
|
|
|
JumpManager.GoJump(36008)
|
2020-05-25 19:16:23 +08:00
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
RecruitManager.RecruitRequest(RecruitType.RecruitBox, function(msg)
|
2021-01-06 13:58:25 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.SingleRecruitPanel, msg.drop.Hero[1],RecruitType.RecruitBox,1,{RecruitType.RecruitBox,RecruitType.RecruitBox})
|
2021-03-02 16:53:12 +08:00
|
|
|
|
this.curNum.text=string.format(Language[11586],BagManager.GetItemCountById(94))
|
2020-08-28 18:37:16 +08:00
|
|
|
|
parent:ClosePanel()
|
2020-05-25 19:16:23 +08:00
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:AddListener()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:RemoveListener()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnShow(_parent,...)
|
|
|
|
|
parent=_parent
|
|
|
|
|
sortingOrder =_parent.sortingOrder
|
|
|
|
|
local args = {...}
|
2021-05-25 10:30:18 +08:00
|
|
|
|
_CostItem=lotterySetting[RecruitType.RecruitBox].CostItem[1][2]
|
2021-05-24 20:33:26 +08:00
|
|
|
|
|
|
|
|
|
local con = string.split(specialConfig[49].Value, "#")
|
|
|
|
|
_Con_Recharge = tonumber(con[1])
|
|
|
|
|
_Con_Star = tonumber(con[2])
|
2021-03-02 16:53:12 +08:00
|
|
|
|
this.titleText.text=Language[11587]
|
2021-11-02 11:06:13 +08:00
|
|
|
|
this.text1.text=string.format("消耗<color=#00FF66>%s点仙缘积分\n</color>开启一次仙缘汇聚箱必得5星神将!",_CostItem)
|
2021-11-02 09:29:07 +08:00
|
|
|
|
this.text2.text=""--Language[11589] --后续改成读表
|
2021-07-05 09:55:02 +08:00
|
|
|
|
this.text3.text= string.format("充值%s或山河社稷图累计星数到达%s开启", string.format(MoneyUtil.GetMoneyUnitName(), _Con_Recharge), _Con_Star)
|
2021-05-24 20:33:26 +08:00
|
|
|
|
--Language[11590]..string.format(MoneyUtil.GetMoneyUnitName(),_Con_Recharge)..Language[11591]
|
|
|
|
|
|
|
|
|
|
local isUnlock = VipManager.GetChargedNum() >= _Con_Recharge or FightLevelManager.GetAllChapterStars() >= _Con_Star
|
|
|
|
|
|
2021-11-02 09:29:07 +08:00
|
|
|
|
this.curNum.text=string.format("当前积分:%s/%s",BagManager.GetItemCountById(94),_CostItem)
|
2021-05-24 20:33:26 +08:00
|
|
|
|
Util.SetGray(this.okBtn, not isUnlock)
|
|
|
|
|
this.okBtn:GetComponent("Button").interactable = isUnlock
|
|
|
|
|
this.text3.gameObject:SetActive(not isUnlock)
|
2021-11-02 09:29:07 +08:00
|
|
|
|
this.anim.enabled = BagManager.GetItemCountById(94) >= tonumber(_CostItem)
|
2020-05-25 19:16:23 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnClose()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnDestroy()
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader:Destroy()
|
2020-05-25 19:16:23 +08:00
|
|
|
|
end
|
|
|
|
|
|
2020-06-23 18:36:24 +08:00
|
|
|
|
return this
|