Yogstation 13 - Modules - TypesDefine Details

code/__DEFINES/dcs/flags.dm

COMPONENT_INCOMPATIBLEReturn this from /datum/component/Initialize or /datum/component/OnTransfer or /datum/component/on_source_add to have the component be deleted if it's applied to an incorrect type. parent must not be modified if this is to be returned. This will be noted in the runtime logs
COMPONENT_NOTRANSFERReturned in PostTransfer to prevent transfer, similar to COMPONENT_INCOMPATIBLE
ELEMENT_INCOMPATIBLEReturn value to cancel attaching
ELEMENT_DETACH_ON_HOST_DESTROYCauses the detach proc to be called when the host object is being deleted. Should only be used if you need to perform cleanup not related to the host object. You do not need this if you are only unregistering signals, for instance. You would need it if you are doing something like removing the target from a processing list.
ELEMENT_DETACHCauses the detach proc to be called when the host object is being deleted
ELEMENT_BESPOKEOnly elements created with the same arguments given after argument_hash_start_idx share an element instance The arguments are the same when the text and number values are the same and all other values have the same ref
ELEMENT_COMPLEX_DETACHCauses all detach arguments to be passed to detach instead of only being used to identify the element When this is used your Detach proc should have the same signature as your Attach proc
ELEMENT_DONT_SORT_LIST_ARGSElements with this flag will have their datum lists arguments compared as is, without the contents being sorted alpha-numerically first. This is good for those elements where the position of the keys matter, like in the case of color matrices.
ELEMENT_NO_LIST_UNIT_TESTElements with this flag will be ignored by the dcs_check_list_arguments test. A good example is connect_loc, for which it's pratically undoable unless we force every signal proc to have a different name.
COMPONENT_DUPE_HIGHLANDERold component is deleted (default)
COMPONENT_DUPE_ALLOWEDduplicates allowed
COMPONENT_DUPE_UNIQUEnew component is deleted
COMPONENT_DUPE_SOURCESComponent uses source tracking to manage adding and removal logic. Add a source/spawn to/the component by using AddComponentFrom(source, component_type, args...) Removing the last source will automatically remove the component from the parent. Arguments will be passed to on_source_add(source, args...); ensure that Initialize and on_source_add have the same signature.
COMPONENT_DUPE_UNIQUE_PASSARGSold component is given the initialization args of the new
COMPONENT_DUPE_SELECTIVEeach component of the same type is consulted as to whether the duplicate should be allowed

Define Details

COMPONENT_DUPE_ALLOWED

duplicates allowed

COMPONENT_DUPE_HIGHLANDER

old component is deleted (default)

COMPONENT_DUPE_SELECTIVE

each component of the same type is consulted as to whether the duplicate should be allowed

COMPONENT_DUPE_SOURCES

Component uses source tracking to manage adding and removal logic. Add a source/spawn to/the component by using AddComponentFrom(source, component_type, args...) Removing the last source will automatically remove the component from the parent. Arguments will be passed to on_source_add(source, args...); ensure that Initialize and on_source_add have the same signature.

COMPONENT_DUPE_UNIQUE

new component is deleted

COMPONENT_DUPE_UNIQUE_PASSARGS

old component is given the initialization args of the new

COMPONENT_INCOMPATIBLE

Return this from /datum/component/Initialize or /datum/component/OnTransfer or /datum/component/on_source_add to have the component be deleted if it's applied to an incorrect type. parent must not be modified if this is to be returned. This will be noted in the runtime logs

COMPONENT_NOTRANSFER

Returned in PostTransfer to prevent transfer, similar to COMPONENT_INCOMPATIBLE

ELEMENT_BESPOKE

Only elements created with the same arguments given after argument_hash_start_idx share an element instance The arguments are the same when the text and number values are the same and all other values have the same ref

ELEMENT_COMPLEX_DETACH

Causes all detach arguments to be passed to detach instead of only being used to identify the element When this is used your Detach proc should have the same signature as your Attach proc

ELEMENT_DETACH

Causes the detach proc to be called when the host object is being deleted

ELEMENT_DETACH_ON_HOST_DESTROY

Causes the detach proc to be called when the host object is being deleted. Should only be used if you need to perform cleanup not related to the host object. You do not need this if you are only unregistering signals, for instance. You would need it if you are doing something like removing the target from a processing list.

ELEMENT_DONT_SORT_LIST_ARGS

Elements with this flag will have their datum lists arguments compared as is, without the contents being sorted alpha-numerically first. This is good for those elements where the position of the keys matter, like in the case of color matrices.

ELEMENT_INCOMPATIBLE

Return value to cancel attaching

ELEMENT_NO_LIST_UNIT_TEST

Elements with this flag will be ignored by the dcs_check_list_arguments test. A good example is connect_loc, for which it's pratically undoable unless we force every signal proc to have a different name.