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

78 lines
2.1 KiB
Lua
Raw Normal View History

2020-07-07 15:20:43 +08:00
----- 宝器分解弹窗 -----
local this = {}
--传入父脚本模块
local parent
--传入特效层级
local sortingOrder=0
local _args={}
--传入选择宝器计算返回奖励数据列表
local dropList = {}
--item容器
local itemList = {}
--传入选择英雄
local selectEquipTreasureData
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.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(selectEquipTreasureData) do
-- table.insert(data,v.idDyn)
-- end
-- NetManager.UseAndPriceItemRequest(4, data, function(msg)
-- for i = 1, #data do
-- EquipTreasureManager.RemoveTreasureByIdDyn(data[i])
-- end
-- parent:ClosePanel()
-- UIManager.OpenPanel(UIName.RewardItemPopup,msg,1,function ()
-- ResolvePanel.SwitchView(3)
-- 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]
selectEquipTreasureData=args[2]
this.titleText.text=Language[11643]
--返还比
local num = 100--tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,35).Value)/100
this.bodyText.text=string.format( Language[11644],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,4,1,sortingOrder,false,data)
end
function this:OnClose()
end
function this:OnDestroy()
end
return this