Paradise Station 13 - Modules - TypesVar Details - Proc Details

datum

Vars

status_traitsStatus traits attached to this datum
tgui_shared_statesglobal

Procs

CanProcCallProc to check if a datum allows proc calls on it
GetComponentReturn any component assigned to this datum of the given type
GetComponentsGet all components of a given type that are attached to this datum
GetExactComponentReturn any component assigned to this datum of the exact given type
LoadComponentGet existing component of type, or create it and return a reference to it
RegisterSignalRegister to listen for a signal from the passed in target
RegisterSignalsRegisters multiple signals to the same proc.
TakeComponentTransfer this component to another parent
TransferComponentTransfer a single component from the source datum, to the target.
TransferComponentsTransfer all components to target
UIDGets or creates the UID of a datum
UnregisterSignalStop listening to a given signal from target
_AddComponentCreates an instance of new_type in the datum and attaches to it as parent
_AddElementFinds the singleton for the element type given and attaches it to src
_RemoveElementFinds the singleton for the element type given and detaches it from src You only need additional arguments beyond the type if you're using ELEMENT_BESPOKE
_SendSignalInternal proc to handle most all of the signaling procedure
p_theyThese are generally cheaper than looping contents so they go first
signal_qdel
string_assoc_listCaches associative lists with non-numeric stringify-able index keys and stringify-able values (text/typepath -> text/path/number).
ui_actpublic
ui_base_html
ui_closepublic
ui_datapublic
ui_hostprivate
ui_interacttgui external
ui_modal_actCall this from a proc that is called in ui_act() to process modal actions
ui_modal_answerCalls the source's currently assigned modal's (if there is one) on_answer() proc. Private.
ui_modal_bentoOpens a bento input UI modal
ui_modal_booleanOpens a yes/no UI modal
ui_modal_choiceOpens a dropdown input UI modal
ui_modal_clearClears the current modal for a given datum
ui_modal_dataCall this from ui_data() to return modal information if needed
ui_modal_inputOpens a text input UI modal
ui_modal_messageOpens a message UI modal
ui_modal_newRegisters a given modal to a source. Private.
ui_modal_preprocess_answerPasses an answer from JS through the modal's proc.
ui_static_datapublic
ui_statustgui states
update_static_datapublic

Var Details

status_traits

Status traits attached to this datum

tgui_shared_states

global

Associative list of JSON-encoded shared states that were set by tgui clients.

Proc Details

CanProcCall

Proc to check if a datum allows proc calls on it

Returns TRUE if you can call a proc on the datum, FALSE if you cant

GetComponent

Return any component assigned to this datum of the given type

This will throw an error if it's possible to have more than one component of that type on the parent

Arguments:

GetComponents

Get all components of a given type that are attached to this datum

Arguments:

GetExactComponent

Return any component assigned to this datum of the exact given type

This will throw an error if it's possible to have more than one component of that type on the parent

Arguments:

LoadComponent

Get existing component of type, or create it and return a reference to it

Use this if the item needs to exist at the time of this call, but may not have been created before now

Arguments:

RegisterSignal

Register to listen for a signal from the passed in target

This sets up a listening relationship such that when the target object emits a signal the source datum this proc is called upon, will recieve a callback to the given proctype Return values from procs registered must be a bitfield

Arguments:

RegisterSignals

Registers multiple signals to the same proc.

TakeComponent

Transfer this component to another parent

Component is taken from source datum

Arguments:

TransferComponent

Transfer a single component from the source datum, to the target.

Arguments:

TransferComponents

Transfer all components to target

All components from source datum are taken

Arguments:

UID

Gets or creates the UID of a datum

BYOND refs are recycled, so this system prevents that. If a datum does not have a UID when this proc is ran, one will be created Returns the UID of the datum

UnregisterSignal

Stop listening to a given signal from target

Breaks the relationship between target and source datum, removing the callback when the signal fires

Doesn't care if a registration exists or not

Arguments:

_AddComponent

Creates an instance of new_type in the datum and attaches to it as parent

Sends the COMSIG_COMPONENT_ADDED signal to the datum

Returns the component that was created. Or the old component in a dupe situation where COMPONENT_DUPE_UNIQUE was set

If this tries to add a component to an incompatible type, the component will be deleted and the result will be null. This is very unperformant, try not to do it

Properly handles duplicate situations based on the dupe_mode var

_AddElement

Finds the singleton for the element type given and attaches it to src

_RemoveElement

Finds the singleton for the element type given and detaches it from src You only need additional arguments beyond the type if you're using ELEMENT_BESPOKE

_SendSignal

Internal proc to handle most all of the signaling procedure

Will runtime if used on datums with an empty component list

Use the SEND_SIGNAL define instead

p_they

These are generally cheaper than looping contents so they go first

signal_qdel

Signal qdel

Proc intended to be used when someone wants the src datum to be qdeled when a certain signal is sent to them.

Example usage: RegisterSignal(item, COMSIG_PARENT_QDELETING, TYPE_PROC_REF(/datum, signal_qdel))

string_assoc_list

Caches associative lists with non-numeric stringify-able index keys and stringify-able values (text/typepath -> text/path/number).

ui_act

public

Called on a UI when the UI receieves a href. Think of this as Topic(). Returns TRUE if the UI should be updated, and FALSE if not.

ui_base_html

ui_close

public

Called on a UI's object when the UI is closed, not to be confused with client/verb/uiclose(), which closes the ui window

ui_data

public

Data to be sent to the UI. This must be implemented for a UI to work.

ui_host

private

The UI's host object (usually src_object). This allows modules/datums to have the UI attached to them, and be a part of another object.

ui_interact

tgui external

Contains all external tgui declarations.

public

Used to open and update UIs. If this proc is not implemented properly, the UI will not update correctly.

ui_modal_act

Call this from a proc that is called in ui_act() to process modal actions

Example: /obj/machinery/chem_master/proc/ui_act_modal You can then switch based on the return value and show different modals depending on the answer. Arguments:

ui_modal_answer

Calls the source's currently assigned modal's (if there is one) on_answer() proc. Private.

Arguments:

ui_modal_bento

Opens a bento input UI modal

Internally checks if the answer is in the list of choices. Arguments:

ui_modal_boolean

Opens a yes/no UI modal

Arguments:

ui_modal_choice

Opens a dropdown input UI modal

Internally checks if the answer is in the list of choices. Arguments:

ui_modal_clear

Clears the current modal for a given datum

Arguments:

ui_modal_data

Call this from ui_data() to return modal information if needed

Arguments:

ui_modal_input

Opens a text input UI modal

Arguments:

ui_modal_message

Opens a message UI modal

Arguments:

ui_modal_new

Registers a given modal to a source. Private.

Arguments:

ui_modal_preprocess_answer

Passes an answer from JS through the modal's proc.

Used namely for cutting the text short if it's longer than an input modal's max_length. Arguments:

ui_static_data

public

Static Data to be sent to the UI. Static data differs from normal data in that it's large data that should be sent infrequently This is implemented optionally for heavy uis that would be sending a lot of redundant data frequently. Gets squished into one object on the frontend side, but the static part is cached.

ui_status

tgui states

Base state and helpers for states. Just does some sanity checks, implement a state for in-depth checks.

public

Checks the UI state for a mob.

required user mob The mob who opened/is using the UI. required state datum/ui_state The state to check.

return UI_state The state of the UI.

update_static_data

public

Forces an update on static data. Should be done manually whenever something happens to change static data.