Goonstation 13 - Modules - TypesVar Details - Proc Details

/datum/hud

Vars

hud_zonesassoc list of hud zones with the format:

Procs

add_elem_no_adjustadds an element without adjusting positions automatically - manually set instead. no safety checking
add_hud_zonedefines a hud zone within the bounds of the screen at the supplied coordinates
adjust_offsetinternal use only. accepts a zone and an element, and then tries to position that element in the zone based on current element positions.
debug_print_alldebug purposes only, call this to print ALL of the information you could ever need
del_elem_no_adjustremoves an element without adjusting positions automatically - will probably fuck stuff up if theres any dynamically positioned elements
get_elementreturns /atom/movable/screen/hud with in zone_alias with alias elem_alias
register_elementadds a hud element (which will be associated with elem_alias) to the elements list of the hud zone associated with zone_alias.
remove_hud_zoneremoves a hud zone and deletes all elements inside of it
screen_boundary_checkreturns true if a rectangle defined by coords is within screen dimensions, false if it isnt
set_elem_positionused to manually set the position of an element relative to the BOTTOM LEFT corner of a hud zone. no safety checks
unregister_elementremoves hud element "element_alias" from the hud zone "zone_alias" and deletes it, then readjusts offsets
zone_overlap_checkreturns true if a rectangle defined by coords doesnt overlap with any existing hud zone, false if it does

Var Details

hud_zones

assoc list of hud zones with the format:

list(

"zone_alias" = list(

	"coords" = list( // list of 2 coordinate pairs for the lower left corner and the upper right corner of the hud zone
		x_low = num, y_low = num, x_high = num, y_high = num

	"elements" = list( // list of all visible hud elements in the hud zone
		"elem_alias" = screenobj // screenobj is the hud object that is visible on the players screen

	"horizontal_edge" = "" // what horizontal edge of the zone elements are initially added from. should be EAST or WEST.

	"vertical_edge" = "" // what vertical edge of the zone elements are intially added from. should be NORTH or SOUTH.

	"horizontal_offset" = num // offset for the horizontal placement of elements, used when placing new elements so they dont overlap

	"vertical_offset" = num // offset for the horizontal placement of elements, used when placing new elements so they dont overlap

Proc Details

add_elem_no_adjust

adds an element without adjusting positions automatically - manually set instead. no safety checking

add_hud_zone

defines a hud zone within the bounds of the screen at the supplied coordinates

coords: assoc list with format list(x_low = num, y_low = num, x_high = num, y_high = num) x_low and y_low are the x and y coordinates of the bottom left corner of the zone x_high and y_high are the x and y coordinates of the top right corner of the zone

alias: string, key for the hud zone, used like this: src.hud_zones["[alias]"]

horizontal_edge: what horizontal side of the hud zone are new elements added from? can be EAST or WEST for example, if its EAST then the first element is added at the right edge of the zone the second element is added to the left side of the first element the third element is added to the left side of the second element, etc.

vertical_edge: what vertical side of the hud zone are new elements added from? can be NORTH or SOUTH for example, if its NORTH then the first element is added at the top edge of the zone the second element is added to the bottom side of the first element the third element is added to the bottom side of the second element, etc.

adjust_offset

internal use only. accepts a zone and an element, and then tries to position that element in the zone based on current element positions.

debug_print_all

debug purposes only, call this to print ALL of the information you could ever need

del_elem_no_adjust

removes an element without adjusting positions automatically - will probably fuck stuff up if theres any dynamically positioned elements

get_element

returns /atom/movable/screen/hud with in zone_alias with alias elem_alias

register_element

adds a hud element (which will be associated with elem_alias) to the elements list of the hud zone associated with zone_alias.

remove_hud_zone

removes a hud zone and deletes all elements inside of it

screen_boundary_check

returns true if a rectangle defined by coords is within screen dimensions, false if it isnt

set_elem_position

used to manually set the position of an element relative to the BOTTOM LEFT corner of a hud zone. no safety checks

unregister_element

removes hud element "element_alias" from the hud zone "zone_alias" and deletes it, then readjusts offsets

zone_overlap_check

returns true if a rectangle defined by coords doesnt overlap with any existing hud zone, false if it does