/tg/ Station 13 - Modules - TypesVar Details - Proc Details

tgui

tgui datum (represents a UI).

Vars

autoupdateUpdate the UI every MC tick.
closingStops further updates when close() was called.
initializedIf the UI has been initialized yet.
interfaceThe interface (template) to be used for this UI.
mouse_hookedAre byond mouse events beyond the window passed in to the ui
opened_atTime of opening the window.
refresh_cooldownRate limit client refreshes to prevent DoS.
refreshingTimed refreshing state
src_objectThe object which owns the UI.
stateTopic state used to determine status/interactability.
statusThe status/visibility of the UI.
titleThe title of the UI.
userThe mob who opened/is using the UI.
windowThe window_id for browse() and onclose().
window_keyKey that is used for remembering the window geometry.
window_sizeDeprecated: Window size.

Procs

Newpublic
closepublic
get_payloadprivate
on_act_messageWrapper for behavior to potentially wait until the next tick if the server is overloaded
on_messageprivate
openpublic
processprivate
process_statusprivate
send_assetpublic
send_full_updatepublic
send_updatepublic
set_autoupdatepublic
set_mouse_hookpublic
set_statepublic

Var Details

autoupdate

Update the UI every MC tick.

closing

Stops further updates when close() was called.

initialized

If the UI has been initialized yet.

interface

The interface (template) to be used for this UI.

mouse_hooked

Are byond mouse events beyond the window passed in to the ui

opened_at

Time of opening the window.

refresh_cooldown

Rate limit client refreshes to prevent DoS.

refreshing

Timed refreshing state

src_object

The object which owns the UI.

state

Topic state used to determine status/interactability.

status

The status/visibility of the UI.

title

The title of the UI.

user

The mob who opened/is using the UI.

window

The window_id for browse() and onclose().

window_key

Key that is used for remembering the window geometry.

window_size

Deprecated: Window size.

Proc Details

New

public

Create a new UI.

required user mob The mob who opened/is using the UI. required src_object datum The object or datum which owns the UI. required interface string The interface used to render the UI. optional title string The title of the UI. optional ui_x int Deprecated: Window width. optional ui_y int Deprecated: Window height.

return datum/tgui The requested UI.

close

public

Close the UI.

optional can_be_suspended bool

get_payload

private

Package the data to send to the UI, as JSON.

return list

on_act_message

Wrapper for behavior to potentially wait until the next tick if the server is overloaded

on_message

private

Callback for handling incoming tgui messages.

open

public

Open this UI (and initialize it with data).

return bool - TRUE if a new pooled window is opened, FALSE in all other situations including if a new pooled window didn't open because one already exists.

process

private

Run an update cycle for this UI. Called internally by SStgui every second or so.

process_status

private

Updates the status, and returns TRUE if status has changed.

send_asset

public

Makes an asset available to use in tgui.

required asset datum/asset

return bool - true if an asset was actually sent

send_full_update

public

Send a full update to the client (includes static data).

optional custom_data list Custom data to send instead of ui_data. optional force bool Send an update even if UI is not interactive.

send_update

public

Send a partial update to the client (excludes static data).

optional custom_data list Custom data to send instead of ui_data. optional force bool Send an update even if UI is not interactive.

set_autoupdate

public

Enable/disable auto-updating of the UI.

required value bool Enable/disable auto-updating.

set_mouse_hook

public

Enable/disable passing through byond mouse events to the window

required value bool Enable/disable hooking.

set_state

public

Replace current ui.state with a new one.

required state datum/ui_state/state Next state