PopupManager
Handles UI in a pop up manner using a queue to manage order of call.
Functions
new
Creates a new popup manager.
Queue
PopupManager:
Queue
(
UIObject:
GuiObject
|
(
)
→
GuiObject
,
--
The UI to show up on the screen like a pop up, in an ordered manner. Also takes a function that returns a GuiObject.
Callback:
(
(
gui:
GuiObject
)
→
(
)
)
?
,
--
Custom callback to run when it is this requests turn. Passes the created or given GuiObject as the first argument.
Timeout:
number?
--
Time in seconds before the promise auto rejects.
) →
Promise
<
GuiObject
>
--
Returns a promise that resolves when the callback finishes or the UIObject is destroyed.
Queues up a UI to be shown on the screen in a pop up manner. The UI will be parented auto parented to the PopupManager GuiObject. The method takes a callback the is run when the UI is parented to the PopupManager GuiObject. The callback can be used to animate the UI or do anything else you want to do. When the given callback resolves it will parent the next GuiObject in the Queue. The method returns a promise that resolves when the callback finishes or the UIObject is destroyed and resolves with the given or created GuiObject. If the returned promise is cancelled then the Queue request is removed from the queue and immediately begins the next request.
ClearAll
PopupManager:
ClearAll
(
) →
(
)
Pauses the current running 'FunctionQueue' thread and clears the queue, effectively setting Queue._queue to be an empty table.
GetGui
Fetches the Gui for this PopupManager. If it does not exist it will create it.