PGRData/Script/matrix/xui/xuimovie/XUiGridReviewItem.lua

32 lines
842 B
Lua
Raw Normal View History

local XUiGridReviewItem = XClass(nil, "XUiGridReviewItem")
2024-09-01 20:49:41 +00:00
function XUiGridReviewItem:Ctor(ui, data,cb)
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
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)
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