forked from endernon/PGRData
29 lines
No EOL
862 B
Lua
29 lines
No EOL
862 B
Lua
---@class XUiScratchTicketPanelPreview
|
|
local XUiScratchTicketPanelPreview = XClass(nil, "XUiScratchTicketPanelPreview")
|
|
|
|
function XUiScratchTicketPanelPreview:Ctor(uiGameObject, gameController, rootUi)
|
|
XTool.InitUiObjectByUi(self, uiGameObject)
|
|
self.Controller = gameController
|
|
self.RootUi = rootUi
|
|
self:InitPanel()
|
|
end
|
|
|
|
function XUiScratchTicketPanelPreview:InitPanel()
|
|
self:Refresh()
|
|
end
|
|
|
|
function XUiScratchTicketPanelPreview:Refresh()
|
|
if not self.RootUi.Ticket then return end
|
|
self.TxtCount.text = self.RootUi.Ticket:GetOpenGridNum()
|
|
self.TxtMaxCount.text = "/" .. self.Controller:GetPreviewCount()
|
|
end
|
|
|
|
function XUiScratchTicketPanelPreview:ShowPanel()
|
|
self.GameObject:SetActiveEx(true)
|
|
end
|
|
|
|
function XUiScratchTicketPanelPreview:HidePanel()
|
|
self.GameObject:SetActiveEx(false)
|
|
end
|
|
|
|
return XUiScratchTicketPanelPreview |