CritteRo / fivem-scaleform-lib

A library of GTA 5 scaleforms for FiveM. All scaleforms can be activated using events.
28 stars 17 forks source link

Scaleform draw time needs to be reworked #3

Open CritteRo opened 3 years ago

CritteRo commented 3 years ago

Currently, when you call an event, a varoable for that event will switch to true and a draw loop will be activated for that variable.

After that, we start a new thread, wait for the seconds to pass and then will set the initial variable back to false, closing the draw loop.

While this does get the job done, calling the same event in that timeframe will break the scaleform, since the event will generate another thread, with another timer, while the first one is still active, causing the new scaleform to close before completion.

The new system will need to check for scaleforms already active.

CritteRo commented 3 years ago

Moved most of the scaleform timers from the build function to the event itself. This should be the first in recreating the timer event.