fix(scaleform): invalid private property access

Adds an isDrawing and draw method to scaleforms.
So technically a feature I guess.
This commit is contained in:
Linden
2025-02-08 13:14:51 +11:00
parent b726faea2d
commit aa2f761a34

View File

@@ -153,15 +153,11 @@ function lib.scaleform:setRenderTarget(name, model)
end end
end end
---@return nil function lib.scaleform:isDrawing()
function lib.scaleform:startDrawing() return self.private.isDrawing
if self.private.isDrawing then
return
end end
self.private.isDrawing = true function lib.scaleform:draw()
CreateThread(function()
while self.private.isDrawing do
if self.target then if self.target then
SetTextRenderId(self.target) SetTextRenderId(self.target)
SetScriptGfxDrawOrder(4) SetScriptGfxDrawOrder(4)
@@ -182,7 +178,18 @@ function lib.scaleform:startDrawing()
if self.target then if self.target then
SetTextRenderId(1) SetTextRenderId(1)
end end
end
function lib.scaleform:startDrawing()
if self.private.isDrawing then
return
end
self.private.isDrawing = true
CreateThread(function()
while self:isDrawing() do
self:draw()
Wait(0) Wait(0)
end end
end) end)