2023-07-15 02:35:33 +07:00
|
|
|
local XUiGridDoomsdayInhaibitantAttrNormal = XClass(nil, "XUiGridDoomsdayInhaibitantAttrNormal")
|
|
|
|
|
|
|
|
function XUiGridDoomsdayInhaibitantAttrNormal:Ctor(stageId)
|
|
|
|
self.StageId = stageId
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridDoomsdayInhaibitantAttrNormal:Refresh(attr)
|
|
|
|
local stageId = self.StageId
|
|
|
|
|
|
|
|
local attrType = attr:GetProperty("_Type")
|
|
|
|
self.TxtState1.text = XDoomsdayConfigs.AttributeTypeConfig:GetProperty(attrType, "Name")
|
|
|
|
|
|
|
|
local max = XDoomsdayConfigs.AttributeTypeConfig:GetProperty(attrType, "MaxValue")
|
|
|
|
self.Parent:BindViewModelPropertyToObj(
|
|
|
|
attr,
|
|
|
|
function(cur)
|
|
|
|
self.ImgProgress.fillAmount = cur / max
|
|
|
|
|
|
|
|
self.TxtState1Num.text =
|
2024-09-01 22:49:41 +02:00
|
|
|
string.format("%d/%d", cur, max)
|
|
|
|
-- .. XDataCenter.DoomsdayManager.GetAverageInhabitantAttrValueText(stageId, attrType)
|
2023-07-15 02:35:33 +07:00
|
|
|
end,
|
|
|
|
"_Value"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
return XUiGridDoomsdayInhaibitantAttrNormal
|