2023-07-14 19:35:33 +00:00
|
|
|
local XUiHelp = XLuaUiManager.Register(XLuaUi, "UiHelp")
|
|
|
|
local XUiGridHelpCourse = require("XUi/XUiHelpCourse/XUiGridHelpCourse")
|
|
|
|
|
|
|
|
function XUiHelp:OnAwake()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
function XUiHelp:OnStart(config, cb, jumpIndex, closeCb)
|
2023-07-14 19:35:33 +00:00
|
|
|
self.Config = config
|
|
|
|
self.Cb = cb
|
2024-09-01 20:49:41 +00:00
|
|
|
self.JumpIndex = jumpIndex
|
|
|
|
self.CloseCb = closeCb
|
2023-07-14 19:35:33 +00:00
|
|
|
self:RegisterClickEvent(self.BtnMask, self.OnBtnMaskClick)
|
|
|
|
self:InitDynamicTable()
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiHelp:InitDynamicTable()
|
|
|
|
self.DynamicTable = XDynamicTableCurve.New(self.PanelHelp.gameObject)
|
|
|
|
self.DynamicTable:SetProxy(XUiGridHelpCourse)
|
|
|
|
self.DynamicTable:SetDelegate(self)
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiHelp:OnEnable()
|
|
|
|
if not self.Config then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
self.Icons = self.Config.ImageAsset
|
|
|
|
self.Length = #self.Icons
|
|
|
|
self.DynamicTable:SetDataSource(self.Config.ImageAsset)
|
2024-09-01 20:49:41 +00:00
|
|
|
self.DynamicTable:ReloadData(self.JumpIndex)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiHelp:OnDisable()
|
|
|
|
|
2023-07-14 19:35:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
--动态列表事件
|
|
|
|
function XUiHelp:OnDynamicTableEvent(event, index, grid)
|
|
|
|
if event == DYNAMIC_DELEGATE_EVENT.DYNAMIC_GRID_ATINDEX then
|
|
|
|
grid:Refresh(self.Icons[index + 1], index + 1, self.Length)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiHelp:OnBtnMaskClick()
|
|
|
|
if self.Cb then
|
|
|
|
self.Cb()
|
|
|
|
end
|
|
|
|
self:Close()
|
2024-09-01 20:49:41 +00:00
|
|
|
if self.CloseCb then
|
|
|
|
self.CloseCb()
|
|
|
|
end
|
2023-07-14 19:35:33 +00:00
|
|
|
end
|