2023-07-14 19:35:33 +00:00
|
|
|
local XUiGridReviewItem = XClass(nil, "XUiGridReviewItem")
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
function XUiGridReviewItem:Ctor(ui, data,cb)
|
2023-07-14 19:35:33 +00:00
|
|
|
self.GameObject = ui.gameObject
|
|
|
|
self.Transform = ui.transform
|
2024-09-01 20:49:41 +00:00
|
|
|
self.ReviewCallBack = cb
|
|
|
|
self.CueId = data.CueId or 0
|
2023-07-14 19:35:33 +00:00
|
|
|
XTool.InitUiObject(self)
|
2024-09-01 20:49:41 +00:00
|
|
|
self.BtnReview.CallBack = function()
|
|
|
|
if self.ReviewCallBack then
|
|
|
|
self.ReviewCallBack(self.CueId)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
self.BtnReview.gameObject:SetActiveEx(self.CueId ~= 0)
|
2023-07-14 19:35:33 +00:00
|
|
|
self:Refresh(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridReviewItem:Refresh(data)
|
|
|
|
self.TxtName.text = data.RoleName
|
|
|
|
self.TxtWords.text = data.Content
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridReviewItem:SetTextColor(color)
|
|
|
|
self.TxtWords.color = color
|
|
|
|
self.TxtName.color = color
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGridReviewItem:GetTextColor()
|
|
|
|
return self.TxtWords.color
|
|
|
|
end
|
|
|
|
|
|
|
|
return XUiGridReviewItem
|