/tg/ Station 13 - Modules - TypesProc Details

ammo_hud

Procs

get_hudResolves the ammo HUD screen object for a given holder or item.
on_droppedHandles disabling the ammo HUD when the item is dropped.
on_equippedHandles enabling the ammo HUD when the item is equipped.
on_hands_swapUpdates the ammo HUD when the mob swaps active hands.
should_updateDetermines whether the given item should currently update the ammo HUD.
update_ballisticUpdates the ammo HUD for ballistic firearms.
update_energyUpdates the ammo HUD for energy-based firearms.
update_hudDispatches an ammo HUD update based on the item's type.
update_welderUpdates the ammo HUD for welding tools.

Proc Details

get_hud

Resolves the ammo HUD screen object for a given holder or item.

Attempts to locate the human mob currently responsible for displaying the ammo HUD, either via an explicitly provided holder or by checking the item's current location.

Will return null if no valid human HUD exists or if the mob has not initialized their HUD yet.

Arguments:

Returns:

on_dropped

Handles disabling the ammo HUD when the item is dropped.

Removes the HUD-displaying trait from the dropped item and disables the ammo HUD if no other held items are currently displaying it.

Also unregisters the hand-swap signal from the dropper to prevent stale callbacks after the item leaves their hands.

Signal handler for COMSIG_ITEM_DROPPED.

Arguments:

on_equipped

Handles enabling the ammo HUD when the item is equipped.

Ensures the equipper is a human and is actively holding the item. If a valid ammo HUD is available, it is enabled and the item is marked as displaying an ammo HUD via a trait.

Also registers a hand-swap signal when both hands are holding HUD-capable items to ensure the display reflects the active hand.

Signal handler for COMSIG_ITEM_EQUIPPED.

Arguments:

on_hands_swap

Updates the ammo HUD when the mob swaps active hands.

Ensures the newly active held item is eligible for ammo HUD display before refreshing the HUD contents to reflect the active hand.

Signal handler for COMSIG_MOB_SWAP_HANDS.

Arguments:

should_update

Determines whether the given item should currently update the ammo HUD.

Prevents inactive-hand items from updating the HUD while another actively held item is already responsible for displaying ammo data.

This avoids conflicting updates when both hands contain HUD-capable items.

Arguments:

Returns:

update_ballistic

Updates the ammo HUD for ballistic firearms.

Displays remaining ammunition using digit overlays and handles special states such as missing magazines or empty weapons.

Signal handler for COMSIG_UPDATE_AMMO_HUD and COMSIG_GUN_CHAMBER_PROCESSED.

Arguments:

update_energy

Updates the ammo HUD for energy-based firearms.

Displays current battery percentage and per-shot energy cost using maptext overlays, with color-coded thresholds for low power states.

Signal handler for COMSIG_UPDATE_AMMO_HUD and COMSIG_GUN_CHAMBER_PROCESSED.

Arguments:

update_hud

Dispatches an ammo HUD update based on the item's type.

Routes the update call to the appropriate handler for ballistic guns, energy guns, or welding tools.

Arguments:

update_welder

Updates the ammo HUD for welding tools.

Displays remaining fuel amount and welding state using digit overlays. Handles empty fuel tanks and active flame indication.

Signal handler for COMSIG_UPDATE_AMMO_HUD.

Arguments: