PGRData/Script/matrix/xui/xuiprequel/XUiGridChallengeTab.lua

60 lines
2.3 KiB
Lua
Raw Normal View History

XUiGridChallengeTab = XClass(nil, "XUiGridChallengeTab")
function XUiGridChallengeTab:Ctor(ui)
self.GameObject = ui.gameObject
self.Transform = ui.transform
self:InitAutoScript()
end
-- auto
-- Automatic generation of code, forbid to edit
function XUiGridChallengeTab:InitAutoScript()
self:AutoInitUi()
self:AutoAddListener()
end
function XUiGridChallengeTab:AutoInitUi()
self.PanelTabUnSelect = self.Transform:Find("PanelTabUnSelect")
self.ImgUnSelect = self.Transform:Find("PanelTabUnSelect/ImgUnSelect"):GetComponent("Image")
self.TxtUnSelectTitle = self.Transform:Find("PanelTabUnSelect/TxtUnSelectTitle"):GetComponent("Text")
self.PanelTabSelect = self.Transform:Find("PanelTabSelect")
self.ImgSelect = self.Transform:Find("PanelTabSelect/ImgSelect"):GetComponent("Image")
self.TxtSelectTitle = self.Transform:Find("PanelTabSelect/TxtSelectTitle"):GetComponent("Text")
self.PanelTabLock = self.Transform:Find("PanelTabLock")
self.ImgUnSelect = self.Transform:Find("PanelTabLock/ImgUnSelect"):GetComponent("Image")
self.ImgLock = self.Transform:Find("PanelTabLock/ImgLock"):GetComponent("Image")
self.TxtLockTitleA = self.Transform:Find("PanelTabLock/TxtLockTitle"):GetComponent("Text")
self.ImgNewCheckPoint = self.Transform:Find("ImgNewCheckPoint"):GetComponent("Image")
end
function XUiGridChallengeTab:RegisterClickEvent(uiNode, func)
if func == nil then
XLog.Error("XUiGridChallengeTab:RegisterClickEvent函数参数错误参数func不能为空")
return
end
if type(func) ~= "function" then
XLog.Error("XUiGridChallengeTab:RegisterClickEvent函数错误, 参数func需要是function类型, func的类型是" .. type(func))
end
local listener = function(...)
func(self, ...)
end
CsXUiHelper.RegisterClickEvent(uiNode, listener)
end
function XUiGridChallengeTab:AutoAddListener()
end
-- auto
function XUiGridChallengeTab:UpdateDefaultViews()
self.PanelTabUnSelect.gameObject:SetActive(false)
self.PanelTabSelect.gameObject:SetActive(true)
self.PanelTabLock.gameObject:SetActive(false)
self.ImgNewCheckPoint.gameObject:SetActive(false)
self.TxtSelectTitle.text = CS.XTextManager.GetText("PrequelChallangeTab")
end
return XUiGridChallengeTab