2023-07-14 19:35:33 +00:00
|
|
|
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
|
2023-07-14 19:35:33 +00:00
|
|
|
|
|
|
|
local isReach = curLevel >= id
|
2024-09-01 20:49:41 +00:00
|
|
|
self.Normal.gameObject:SetActiveEx(not isReach)
|
|
|
|
self.Select.gameObject:SetActiveEx(isReach)
|
2023-07-14 19:35:33 +00:00
|
|
|
|
|
|
|
local amount = XAreaWarConfigs.GetHangUpUnlockAmount(id)
|
|
|
|
self.TxtCount.text = amount .. "/h"
|
|
|
|
|
|
|
|
if self.RImgIcon then
|
|
|
|
self.RImgIcon:SetRawImage(XDataCenter.AreaWarManager.GetCoinItemIcon())
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return XUiGridAreaWarHangUp
|