2024-09-01 20:49:41 +00:00
|
|
|
---@class XUiGridInfoSupportCondition
|
2023-07-14 19:35:33 +00:00
|
|
|
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
|
2023-07-14 19:35:33 +00:00
|
|
|
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
|