PGRData/Script/matrix/xui/xuiareawar/XUiGridAreaWarHangUp.lua

33 lines
841 B
Lua
Raw Normal View History

local XUiGridAreaWarHangUp = XClass(nil, "XUiGridAreaWarHangUp")
function XUiGridAreaWarHangUp:Ctor(ui, clickCb)
self.GameObject = ui.gameObject
self.Transform = ui.transform
XTool.InitUiObject(self)
if self.BtnClick then
self.BtnClick.CallBack = clickCb
end
end
function XUiGridAreaWarHangUp:Refresh(id, curLevel)
2024-09-01 20:49:41 +00:00
local level = string.format("%2d", id)
self.TxtLevelN.text = level
self.TxtLevelS.text = level
local isReach = curLevel >= id
2024-09-01 20:49:41 +00:00
self.Normal.gameObject:SetActiveEx(not isReach)
self.Select.gameObject:SetActiveEx(isReach)
local amount = XAreaWarConfigs.GetHangUpUnlockAmount(id)
self.TxtCount.text = amount .. "/h"
if self.RImgIcon then
self.RImgIcon:SetRawImage(XDataCenter.AreaWarManager.GetCoinItemIcon())
end
end
return XUiGridAreaWarHangUp