Skip to main content

PopupManager

Handles UI in a pop up manner using a queue to manage order of call.

Functions

new

PopupManager.new() → PopupManager

Creates a new popup manager.

Queue

PopupManager:Queue(
UIObjectGuiObject | () → 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((guiGuiObject) → ())?,--

Custom callback to run when it is this requests turn. Passes the created or given GuiObject as the first argument.

Timeoutnumber?--

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

PopupManager:GetGui() → Frame

Fetches the Gui for this PopupManager. If it does not exist it will create it.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new popup manager.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PopupManager"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 49,
                "path": "src/popupmanager/src/Client/PopupManager.lua"
            }
        },
        {
            "name": "Queue",
            "desc": "Queues up a UI to be shown on the screen in a pop up manner. The UI will be parented auto parented\nto the PopupManager GuiObject. The method takes a callback the is run when the UI is parented to the\nPopupManager GuiObject. The callback can be used to animate the UI or do anything else you want to do.\nWhen the given callback resolves it will parent the next GuiObject in the Queue.\nThe method returns a promise that resolves when the callback finishes or the UIObject is destroyed and\nresolves with the given or created GuiObject. If the returned promise is cancelled then the Queue request\nis removed from the queue and immediately begins the next request.",
            "params": [
                {
                    "name": "UIObject",
                    "desc": "The UI to show up on the screen like a pop up, in an ordered manner. Also takes a function that returns a GuiObject.",
                    "lua_type": "GuiObject | () -> GuiObject"
                },
                {
                    "name": "Callback",
                    "desc": "Custom callback to run when it is this requests turn. Passes the created or given GuiObject as the first argument.",
                    "lua_type": "((gui: GuiObject) -> ())?"
                },
                {
                    "name": "Timeout",
                    "desc": "Time in seconds before the promise auto rejects.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "Returns a promise that resolves when the callback finishes or the UIObject is destroyed.",
                    "lua_type": "Promise<GuiObject>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 72,
                "path": "src/popupmanager/src/Client/PopupManager.lua"
            }
        },
        {
            "name": "ClearAll",
            "desc": "Pauses the current running 'FunctionQueue' thread and clears the queue, effectively setting \nQueue._queue to be an empty table.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 136,
                "path": "src/popupmanager/src/Client/PopupManager.lua"
            }
        },
        {
            "name": "GetGui",
            "desc": "Fetches the Gui for this PopupManager. If it does not exist it will create it.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Frame"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 146,
                "path": "src/popupmanager/src/Client/PopupManager.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PopupManager",
    "desc": "Handles UI in a pop up manner using a queue to manage order of call.",
    "source": {
        "line": 9,
        "path": "src/popupmanager/src/Client/PopupManager.lua"
    }
}