2023-07-14 19:35:33 +00:00
|
|
|
local XUiGridActivityLink = require("XUi/XUiActivityBase/XUiGridActivityLink")
|
|
|
|
local XUiActivityBaseLink = XLuaUiManager.Register(XLuaUi, "UiActivityBaseLink")
|
|
|
|
|
|
|
|
function XUiActivityBaseLink:OnStart()
|
|
|
|
self:InitDynamicTable()
|
|
|
|
self:UpdateList()
|
|
|
|
--local bg = self.BtnFirst.transform:Find("RImgBg"):GetComponent("RawImage")
|
|
|
|
--bg:SetRawImage(CS.XGame.ClientConfig:GetString("ActivityLinkButtonBg"))
|
|
|
|
self.BtnFirst:SetName(CS.XGame.ClientConfig:GetString("ActivityLinkButtonName"))
|
2024-09-01 20:49:41 +00:00
|
|
|
self.BtnFirst.CallBack = function()
|
|
|
|
self:OnBtnClick()
|
|
|
|
end
|
2023-07-14 19:35:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function XUiActivityBaseLink:InitDynamicTable()
|
|
|
|
self.DynamicTable = XDynamicTableNormal.New(self.SViewLinkList)
|
|
|
|
self.DynamicTable:SetProxy(XUiGridActivityLink)
|
|
|
|
self.DynamicTable:SetDelegate(self)
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiActivityBaseLink:UpdateList()
|
2024-09-01 20:49:41 +00:00
|
|
|
self.LinkDataList = {}
|
|
|
|
local LinkDataList = XActivityConfigs.GetActivityLinkTemplate()
|
|
|
|
for i = 1, 3 do
|
|
|
|
if LinkDataList[i] then
|
|
|
|
table.insert(self.LinkDataList,LinkDataList[i])
|
|
|
|
end
|
|
|
|
end
|
2023-07-14 19:35:33 +00:00
|
|
|
self.DynamicTable:SetDataSource(self.LinkDataList)
|
|
|
|
self.DynamicTable:ReloadDataASync()
|
|
|
|
end
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
function XUiActivityBaseLink:OnBtnClick()
|
|
|
|
self.BtnFirst:SetButtonState(CS.UiButtonState.Select)
|
|
|
|
end
|
|
|
|
|
2023-07-14 19:35:33 +00:00
|
|
|
function XUiActivityBaseLink:OnDynamicTableEvent(event, index, grid)
|
|
|
|
if event == DYNAMIC_DELEGATE_EVENT.DYNAMIC_GRID_ATINDEX then
|
|
|
|
grid:UpdateGrid(self.LinkDataList[index])
|
|
|
|
end
|
|
|
|
end
|