miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_ResolveDismant...

86 lines
2.5 KiB
Lua
Raw Normal View History

2020-08-25 15:46:38 +08:00
----- 送神弹窗 -----
2020-05-09 13:31:21 +08:00
local this = {}
--传入父脚本模块
local parent
--传入特效层级
local sortingOrder=0
local _args={}
--传入选择英雄计算返回奖励数据列表
local dropList = {}
--item容器
local itemList = {}
--传入选择英雄
local selectHeroData
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
function this:InitComponent(gameObject)
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
this.bodyText=Util.GetGameObject(gameObject,"BodyText"):GetComponent("Text")
this.cancelBtn=Util.GetGameObject(gameObject,"CancelBtn")
this.confirmBtn=Util.GetGameObject(gameObject,"ConfirmBtn")
2020-08-31 18:19:38 +08:00
this.FourStarUpTip=Util.GetGameObject(gameObject,"FourStarUpTip")
Util.GetGameObject(gameObject,"FourStarUpTip"):GetComponent("Text").text = Language[12389]
2020-05-09 13:31:21 +08:00
--滚动条根节点
this.root = Util.GetGameObject(gameObject, "Root")
end
function this:BindEvent()
Util.AddClick(this.cancelBtn,function()
parent:ClosePanel()
end)
Util.AddClick(this.confirmBtn,function()
local data={}
for k,v in pairs(selectHeroData) do
table.insert(data,v.dynamicId)
end
NetManager.UseAndPriceItemRequest(3, data, function(msg)
HeroManager.DeleteHeroDatas(data)
parent:ClosePanel()
BagManager.SetDropIsSHowEquipPrint(false)
2020-05-09 13:31:21 +08:00
UIManager.OpenPanel(UIName.RewardItemPopup,msg,1,function ()
2021-02-26 14:52:59 +08:00
ResolvePanel.SwitchView(1,true,true)
2020-05-09 13:31:21 +08:00
end)
end)
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
2020-05-25 19:16:23 +08:00
function this:OnShow(_parent,...)
parent=_parent
sortingOrder =_parent.sortingOrder
2020-05-09 13:31:21 +08:00
local args = {...}
2020-05-25 19:16:23 +08:00
dropList = args[1]
selectHeroData=args[2]
2020-08-31 18:19:38 +08:00
local isShowFourStarUpTip = false
for k,v in pairs(selectHeroData) do
if v.star >= 4 then
isShowFourStarUpTip = true
end
end
this.FourStarUpTip:SetActive(isShowFourStarUpTip)
2020-06-23 18:36:24 +08:00
this.titleText.text=Language[11643]
2020-05-09 13:31:21 +08:00
--返还比
local num=tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,35).Value)/100
2020-06-23 18:36:24 +08:00
this.bodyText.text=string.format( Language[11644],num,"%")
2020-05-09 13:31:21 +08:00
local data={}
for i, v in pairs(dropList) do
data[i]={v.id,v.num}
end
2020-07-31 18:36:54 +08:00
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,data)
2020-05-09 13:31:21 +08:00
end
function this:OnClose()
end
function this:OnDestroy()
end
2020-06-23 18:36:24 +08:00
return this