PGRData/Script/matrix/xui/xuifubenbabeltower/XUiGridInfoSupportCondition.lua

35 lines
1.3 KiB
Lua
Raw Normal View History

2024-09-01 20:49:41 +00:00
---@class XUiGridInfoSupportCondition
local XUiGridInfoSupportCondition = XClass(nil, "XUiGridInfoSupportCondition")
function XUiGridInfoSupportCondition:Ctor(ui)
self.GameObject = ui.gameObject
self.Transform = ui.transform
XTool.InitUiObject(self)
end
2024-09-01 20:49:41 +00:00
---@param uiRoot XUiPanelBabelTowerRoom
function XUiGridInfoSupportCondition:Init(uiRoot)
self.UiRoot = uiRoot
end
function XUiGridInfoSupportCondition:SetItemInfo(conditionData)
self.SupportConditionId = conditionData.SupportConditionId
self.SupportConditionTemplate = XFubenBabelTowerConfigs.GetBabelTowerSupportConditonTemplate(self.SupportConditionId)
self:RefreshItemInfos()
end
function XUiGridInfoSupportCondition:RefreshItemInfos()
if self.SupportConditionTemplate then
local isSupport = self.UiRoot:CheckBabelTeamCondition(self.SupportConditionTemplate.Condition)
local description = XFubenBabelTowerConfigs.GetConditionDescription(self.SupportConditionId)
self.PanelActive.gameObject:SetActiveEx(isSupport)
self.TxtUnActiveCondition.text = description
self.TxtUnActiveChallengeGet.text = self.SupportConditionTemplate.PointAdd
self.TxtActiveCondition.text = description
self.TxtActiveChallengeGet.text = self.SupportConditionTemplate.PointAdd
end
end
return XUiGridInfoSupportCondition