id_access
Vars | |
access_flag_string_by_flag | Dictionary of access flag string representations. Keys are bitflags. Values are their associated names. |
---|---|
accesses_by_flag | Dictionary of access lists. Keys are access flag names. Values are lists of all accesses as part of that access. |
accesses_by_region | Dictionary of accesses based on station region. Keys are region strings. Values are lists of accesses. |
all_region_access_tgui | Specially formatted list for sending access levels to tgui interfaces. |
centcom_job_templates | Helper list containing all trim paths that can be used as Centcom templates. |
desc_by_access | Dictionary of access names. Keys are access levels. Values are their associated names. |
flags_by_access | Dictionary of access flags. Keys are accesses. Values are their associated bitflags. |
spare_id_safe_code | The roundstart generated code for the spare ID safe. This is given to the Captain on shift start. If there's no Captain, it's given to the HoP. If there's no HoP |
station_job_templates | Helper list containing all trim paths that can be used as job templates. Intended to be used alongside logic for ACCESS_CHANGE_IDS. Grab templates from sub_department_managers_tgui for Head of Staff restrictions. |
station_pda_templates | Helper list containing all PDA paths that can be painted by station machines. Intended to be used alongside logic for ACCESS_CHANGE_IDS. Grab templates from sub_department_managers_tgui for Head of Staff restrictions. |
station_regions | Helper list containing all station regions. |
sub_department_managers_tgui | List of accesses for the Heads of each sub-department alongside the regions they control and their job name. |
trim_singletons_by_path | Dictionary of trim singletons. Keys are paths. Values are their associated singletons. |
wildcard_flags_by_wildcard | Dictionary of wildcard compatibility flags. Keys are strings for the wildcards. Values are their associated flags. |
Procs | |
add_trim_access_to_card | Adds the accesses associated with a trim to an ID card. |
apply_trim_to_card | Applies a trim singleton to a card. |
apply_trim_to_chameleon_card | |
get_access_desc | Returns the access description associated with any given access level. |
get_access_flag | Returns the access bitflags associated with any given access level. |
get_flag_access_list | Returns the list of all accesses associated with any given access flag. |
get_region_access_list | Builds and returns a list of accesses from a list of regions. |
refresh_job_trim_singletons | Called by [/datum/controller/subsystem/ticker/proc/setup] |
remove_trim_from_card | Removes a trim from an ID card. Also removes all accesses from it too. |
remove_trim_from_chameleon_card | Removes a trim from a chameleon ID card. |
setup_access_descriptions | Setup dictionary that converts access levels to text descriptions. |
setup_access_flags | Build access flag lists. |
setup_region_lists | Populates the region lists with data about which accesses correspond to which regions. |
setup_tgui_lists | Creates various data structures that primarily get fed to tgui interfaces, although these lists are used in other places. |
setup_trim_singletons | Instantiate trim singletons and add them to a list. |
setup_wildcard_dict | Set up dictionary to convert wildcard names to flags. |
tally_access | Tallies up all accesses the card has that have flags greater than or equal to the access_flag supplied. |
Var Details
access_flag_string_by_flag
Dictionary of access flag string representations. Keys are bitflags. Values are their associated names.
accesses_by_flag
Dictionary of access lists. Keys are access flag names. Values are lists of all accesses as part of that access.
accesses_by_region
Dictionary of accesses based on station region. Keys are region strings. Values are lists of accesses.
all_region_access_tgui
Specially formatted list for sending access levels to tgui interfaces.
centcom_job_templates
Helper list containing all trim paths that can be used as Centcom templates.
desc_by_access
Dictionary of access names. Keys are access levels. Values are their associated names.
flags_by_access
Dictionary of access flags. Keys are accesses. Values are their associated bitflags.
spare_id_safe_code
The roundstart generated code for the spare ID safe. This is given to the Captain on shift start. If there's no Captain, it's given to the HoP. If there's no HoP
station_job_templates
Helper list containing all trim paths that can be used as job templates. Intended to be used alongside logic for ACCESS_CHANGE_IDS. Grab templates from sub_department_managers_tgui for Head of Staff restrictions.
station_pda_templates
Helper list containing all PDA paths that can be painted by station machines. Intended to be used alongside logic for ACCESS_CHANGE_IDS. Grab templates from sub_department_managers_tgui for Head of Staff restrictions.
station_regions
Helper list containing all station regions.
sub_department_managers_tgui
List of accesses for the Heads of each sub-department alongside the regions they control and their job name.
trim_singletons_by_path
Dictionary of trim singletons. Keys are paths. Values are their associated singletons.
wildcard_flags_by_wildcard
Dictionary of wildcard compatibility flags. Keys are strings for the wildcards. Values are their associated flags.
Proc Details
add_trim_access_to_card
Adds the accesses associated with a trim to an ID card.
Clears the card's existing access levels first. Primarily intended for applying trim templates to cards. Will attempt to add as many ordinary access levels as it can, without consuming any wildcards. Will then attempt to apply the trim-specific wildcards after.
Arguments:
- id_card - The ID card to remove the trim from.
apply_trim_to_card
Applies a trim singleton to a card.
Returns FALSE if the trim could not be applied due to being incompatible with the card. Incompatibility is defined as a card not being able to hold all the trim's required wildcards. Returns TRUE otherwise. Arguments:
- id_card - ID card to apply the trim_path to.
- trim_path - A trim path to apply to the card. Grabs the trim's associated singleton and applies it.
- copy_access - Boolean value. If true, the trim's access is also copied to the card.
apply_trim_to_chameleon_card
-
Applies a trim to a chameleon card. This is purely visual, utilising the card's override vars.
-
Arguments:
-
- id_card - The chameleon card to apply the trim visuals to.
-
- trim_path - A trim path to apply to the card. Grabs the trim's associated singleton and applies it.
-
- check_forged - Boolean value. If TRUE, will not overwrite the card's assignment if the card has been forged.
get_access_desc
Returns the access description associated with any given access level.
In proc form due to accesses being stored in the list as text instead of numbers. Arguments:
- access - Access as either pure number or as a string representation of the number.
get_access_flag
Returns the access bitflags associated with any given access level.
In proc form due to accesses being stored in the list as text instead of numbers. Arguments:
- access - Access as either pure number or as a string representation of the number.
get_flag_access_list
Returns the list of all accesses associated with any given access flag.
In proc form due to accesses being stored in the list as text instead of numbers. Arguments:
- flag - The flag to get access for as either a pure number of string representation of the flag.
get_region_access_list
Builds and returns a list of accesses from a list of regions.
Arguments:
- regions - A list of region defines.
refresh_job_trim_singletons
Called by [/datum/controller/subsystem/ticker/proc/setup]
This runs through every /datum/id_trim/job singleton and ensures that its access is setup according to appropriate config entries.
remove_trim_from_card
Removes a trim from an ID card. Also removes all accesses from it too.
Arguments:
- id_card - The ID card to remove the trim from.
remove_trim_from_chameleon_card
Removes a trim from a chameleon ID card.
Arguments:
- id_card - The ID card to remove the trim from.
setup_access_descriptions
Setup dictionary that converts access levels to text descriptions.
setup_access_flags
Build access flag lists.
setup_region_lists
Populates the region lists with data about which accesses correspond to which regions.
setup_tgui_lists
Creates various data structures that primarily get fed to tgui interfaces, although these lists are used in other places.
setup_trim_singletons
Instantiate trim singletons and add them to a list.
setup_wildcard_dict
Set up dictionary to convert wildcard names to flags.
tally_access
Tallies up all accesses the card has that have flags greater than or equal to the access_flag supplied.
Returns the number of accesses that have flags matching access_flag or a higher tier access. Arguments:
- id_card - The ID card to tally up access for.
- access_flag - The minimum access flag required for an access to be tallied up.