/tg/ Station 13 - Modules - TypesProc Details

/datum/tgui_window

Copyright (c) 2020 Aleksej Komarov SPDX-License-Identifier: MIT

Procs

Newpublic
acquire_lockpublic
can_be_suspendedpublic
closepublic
flush_message_queueprivate
initializepublic
is_readypublic
on_messageprivate
release_lockRelease the window lock.
send_assetpublic
send_messagepublic

Proc Details

New

public

Create a new tgui window.

required client /client required id string A unique window identifier.

acquire_lock

public

Acquire the window lock. Pool will not be able to provide this window to other UIs for the duration of the lock.

Can be given an optional tgui datum, which will hook its on_message callback into the message stream.

optional ui /datum/tgui

can_be_suspended

public

Checks if the window can be sanely suspended.

return bool

close

public

Close the UI.

optional can_be_suspended bool

flush_message_queue

private

Sends queued messages if the queue wasn't empty.

initialize

public

Initializes the window with a fresh page. Puts window into the "loading" state. You can begin sending messages right after initializing. Messages will be put into the queue until the window finishes loading.

optional inline_assets list List of assets to inline into the html.

is_ready

public

Checks if the window is ready to receive data.

return bool

on_message

private

Callback for handling incoming tgui messages.

release_lock

Release the window lock.

send_asset

public

Makes an asset available to use in tgui.

required asset datum/asset

send_message

public

Sends a message to tgui window.

required type string Message type required payload list Message payload optional force bool Send regardless of the ready status.