miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_EquipCompound.lua

69 lines
2.0 KiB
Lua
Raw Normal View History

2021-04-21 13:12:04 +08:00
----- 献祭弹窗 -----
2020-05-09 13:31:21 +08:00
local this = {}
--传入父脚本模块
local parent
--传入特效层级
2024-09-06 10:38:56 +08:00
local sortingOrder = 0
local _args = {}
2020-05-09 13:31:21 +08:00
local fun
--item容器
local itemList = {}
--传入选择英雄
2024-09-06 10:38:56 +08:00
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
2020-05-09 13:31:21 +08:00
function this:InitComponent(gameObject)
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2024-09-06 10:38:56 +08:00
this.titleText = Util.GetGameObject(gameObject, "TitleText"):GetComponent("Text")
this.num = Util.GetGameObject(gameObject, "Body/Num"):GetComponent("Text")
this.num2 = Util.GetGameObject(gameObject, "Body/Num2"):GetComponent("Text")
this.numImage = Util.GetGameObject(gameObject, "Body/Num/Image"):GetComponent("Image")
this.numImage2 = Util.GetGameObject(gameObject, "Body/Num2/Image"):GetComponent("Image")
this.cancelBtn = Util.GetGameObject(gameObject, "CancelBtn")
this.confirmBtn = Util.GetGameObject(gameObject, "ConfirmBtn")
2020-05-09 13:31:21 +08:00
--滚动条根节点
this.root = Util.GetGameObject(gameObject, "Root")
end
function this:BindEvent()
2024-09-06 10:38:56 +08:00
Util.AddClick(this.cancelBtn, function()
2020-05-09 13:31:21 +08:00
parent:ClosePanel()
end)
2024-09-06 10:38:56 +08:00
Util.AddClick(this.confirmBtn, function()
2020-05-09 13:31:21 +08:00
if fun then
fun()
end
2024-09-06 10:38:56 +08:00
parent:ClosePanel()
2020-05-09 13:31:21 +08:00
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
2024-09-06 10:38:56 +08:00
function this:OnShow(_parent, ...)
parent = _parent
2020-05-25 19:16:23 +08:00
sortingOrder = _parent.sortingOrder
2020-05-09 13:31:21 +08:00
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
2024-09-06 10:38:56 +08:00
local args = { ... }
2020-05-25 19:16:23 +08:00
this.num.text = args[1]
this.num2.text = args[2]
fun = args[4]
2024-09-06 10:38:56 +08:00
this.titleText.text = Language[12289]
2021-04-21 13:12:04 +08:00
this.numImage.sprite = SetIcon(this.spLoader, 14)
this.numImage2.sprite = SetIcon(this.spLoader, 1258)
2024-09-06 10:38:56 +08:00
ResetItemView(this.root, this.root.transform, itemList, 10, 1, sortingOrder, false, args[3])
2020-05-09 13:31:21 +08:00
end
function this:OnClose()
end
function this:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-05-09 13:31:21 +08:00
end
2024-09-06 10:38:56 +08:00
return this