PGRData/Script/matrix/xui/xuiequipoverrun/XUiEquipOverrunSelectGrid.lua

31 lines
1,011 B
Lua
Raw Normal View History

2024-09-01 20:49:41 +00:00
local XUiEquipOverrunSelectGrid = XClass(nil, "XUiEquipOverrunSelectGrid")
function XUiEquipOverrunSelectGrid:Ctor(ui)
self.GameObject = ui.gameObject
self.Transform = ui.transform
XTool.InitUiObject(self)
end
function XUiEquipOverrunSelectGrid:Init(parent)
self.Parent = parent
end
function XUiEquipOverrunSelectGrid:Refresh(suitData, isLastSelect)
local suitCfg = XEquipConfig.GetEquipSuitCfg(suitData.Id)
self.RImgIcon:SetRawImage(suitCfg.IconPath)
self.TxtName.text = suitCfg.Name
self.TxtDes.text = suitCfg.Description
self.TagNotActive.gameObject:SetActiveEx(not suitData.IsActive)
self.TagNow.gameObject:SetActiveEx(isLastSelect)
local quality = XEquipConfig.GetSuitQuality(suitData.Id)
local qualityPath = XArrangeConfigs.GeQualityBgPath(quality)
self.ImgEquipQuality:SetSprite(qualityPath)
end
function XUiEquipOverrunSelectGrid:SetCurSelect(isCurSelect)
self.Select.gameObject:SetActiveEx(isCurSelect)
end
return XUiEquipOverrunSelectGrid