/tg/ Station 13 - Modules - TypesProc Details

tgui

Procs

close_all_uisprivate
close_uisprivate
close_user_uisprivate
get_open_uiprivate
on_closeprivate
on_logoutprivate
on_openprivate
on_transferprivate
try_update_uitgui subsystem
update_uisprivate
update_user_uisprivate

Proc Details

close_all_uis

private

Close ALL UIs

return int The number of UIs closed.

close_uis

private

Close all UIs attached to src_object.

required src_object datum The object/datum which owns the UIs.

return int The number of UIs closed.

close_user_uis

private

Close all UIs belonging to a user.

required user mob The mob who opened/is using the UI. optional src_object datum If provided, only close UIs belonging this src_object. optional ui_key string If provided, only close UIs with this UI key.

return int The number of UIs closed.

get_open_ui

private

Get an open UI given a user, src_object, and ui_key.

required user mob The mob who opened/is using the UI. required src_object datum The object/datum which owns the UI. required ui_key string The ui_key of the UI.

return datum/tgui The found UI.

on_close

private

Remove a UI from the list of open UIs.

required ui datum/tgui The UI to be removed.

return bool If the UI was removed or not.

on_logout

private

Handle client logout, by closing all their UIs.

required user mob The mob which logged out.

return int The number of UIs closed.

on_open

private

Add a UI to the list of open UIs.

required ui datum/tgui The UI to be added.

on_transfer

private

Handle clients switching mobs, by transferring their UIs.

required user source The client's original mob. required user target The client's new mob.

return bool If the UIs were transferred.

try_update_ui

tgui subsystem

Contains all tgui state and subsystem code.

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

public

Get an open UI given a user, src_object, and ui_key and try to update it with data.

required user mob The mob who opened/is using the UI. required src_object datum The object/datum which owns the UI. required ui_key string The ui_key of the UI. optional ui datum/tgui The UI to be updated, if it exists. optional force_open bool If the UI should be re-opened instead of updated.

return datum/tgui The found UI.

update_uis

private

Update all UIs attached to src_object.

required src_object datum The object/datum which owns the UIs.

return int The number of UIs updated.

update_user_uis

private

Update all UIs belonging to a user.

required user mob The mob who opened/is using the UI. optional src_object datum If provided, only update UIs belonging this src_object. optional ui_key string If provided, only update UIs with this UI key.

return int The number of UIs updated.