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

86 lines
2.7 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

----- 送神弹窗 -----
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")
this.FourStarUpTip=Util.GetGameObject(gameObject,"FourStarUpTip")
Util.GetGameObject(gameObject,"FourStarUpTip"):GetComponent("Text").text = "包含4星或更高星级的神将"
--滚动条根节点
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)
UIManager.OpenPanel(UIName.RewardItemPopup,msg,1,function ()
ResolvePanel.SwitchView(1)
end)
end)
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder =_parent.sortingOrder
local args = {...}
dropList = args[1]
selectHeroData=args[2]
local isShowFourStarUpTip = false
for k,v in pairs(selectHeroData) do
if v.star >= 4 then
isShowFourStarUpTip = true
end
end
this.FourStarUpTip:SetActive(isShowFourStarUpTip)
this.titleText.text="确认送神"
--返还比
local num=tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,35).Value)/100
this.bodyText.text=string.format( "恭送神将会获得仙缘余尘,若神将已升级,突破或进阶,还会返还%s%s消耗的金币、成长护符和九转金丹是否确定恭送所选神将\n\n\t\t\t\t\t\t\t送神后获得:",num,"%")
local data={}
for i, v in pairs(dropList) do
data[i]={v.id,v.num}
end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,data)
end
function this:OnClose()
end
function this:OnDestroy()
end
return this