TG Signal Port (#18741)

* click code start

* snake_span

* Update click.dm

* Update click.dm

* Update click.dm

* WIP signal organization

* Moooore signals

* cuffs

* decon

* whoops

* revert this

* Proper name

* movable moved

* These

* Theeese

* Sort these

* Update cyborg.dm
This commit is contained in:
Cameron Lennox
2025-12-09 17:50:52 -05:00
committed by GitHub
parent b73ce78164
commit 7ff489ec36
185 changed files with 4359 additions and 1299 deletions
@@ -6,12 +6,12 @@
disposal_owner = parent
RegisterSignal(disposal_owner, COMSIG_DISPOSAL_FLUSH, PROC_REF(on_flush))
RegisterSignal(disposal_owner, COMSIG_DISPOSAL_RECEIVING, PROC_REF(on_recieve))
RegisterSignal(disposal_owner, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
RegisterSignal(disposal_owner, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
/datum/component/disposal_system_connection/Destroy()
UnregisterSignal(disposal_owner, COMSIG_DISPOSAL_FLUSH)
UnregisterSignal(disposal_owner, COMSIG_DISPOSAL_RECEIVING)
UnregisterSignal(disposal_owner, COMSIG_PARENT_EXAMINE)
UnregisterSignal(disposal_owner, COMSIG_ATOM_EXAMINE)
disposal_owner = null
. = ..()
@@ -15,7 +15,7 @@
// Mob
host_mob = parent
RegisterSignal(host_mob, COMSIG_LIVING_LIFE, PROC_REF(on_mob_action))
RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(on_mob_action))
RegisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(on_mob_action))
RegisterSignal(host_mob, COMSIG_MOB_LOGOUT, PROC_REF(on_mob_logout))
// Machine
@@ -34,7 +34,7 @@
linked_machine.in_use = FALSE
linked_machine = null
// Mob
UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED)
UnregisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE)
UnregisterSignal(host_mob, COMSIG_LIVING_LIFE)
UnregisterSignal(host_mob, COMSIG_MOB_LOGOUT)
host_mob.reset_perspective() // Required, because our machine may have been operating a remote view
@@ -76,11 +76,11 @@
// can we insert into this container
if(!(mat_container_flags & MATCONTAINER_NO_INSERT))
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attackby))
//to see available materials
if(mat_container_flags & MATCONTAINER_EXAMINE)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
//drop sheets when object is deconstructed but not deleted
RegisterSignal(parent, COMSIG_OBJ_DECONSTRUCT, PROC_REF(drop_sheets))
@@ -89,9 +89,9 @@
var/list/signals = list()
if(!(mat_container_flags & MATCONTAINER_NO_INSERT))
signals += COMSIG_PARENT_ATTACKBY
signals += COMSIG_ATOM_ATTACKBY
if(mat_container_flags & MATCONTAINER_EXAMINE)
signals += COMSIG_PARENT_EXAMINE
signals += COMSIG_ATOM_EXAMINE
signals += COMSIG_OBJ_DECONSTRUCT
UnregisterSignal(parent, signals)
@@ -114,14 +114,14 @@
. = ..()
if(var_name == NAMEOF(src, mat_container_flags) && parent)
if(!(old_flags & MATCONTAINER_EXAMINE) && mat_container_flags & MATCONTAINER_EXAMINE)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
else if(old_flags & MATCONTAINER_EXAMINE && !(mat_container_flags & MATCONTAINER_EXAMINE))
UnregisterSignal(parent, COMSIG_PARENT_EXAMINE)
UnregisterSignal(parent, COMSIG_ATOM_EXAMINE)
if(old_flags & MATCONTAINER_NO_INSERT && !(mat_container_flags & MATCONTAINER_NO_INSERT))
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attackby))
else if(!(old_flags & MATCONTAINER_NO_INSERT) && mat_container_flags & MATCONTAINER_NO_INSERT)
UnregisterSignal(parent, COMSIG_PARENT_ATTACKBY)
UnregisterSignal(parent, COMSIG_ATOM_ATTACKBY)
/**
* 3 Types of Procs
@@ -654,7 +654,7 @@
* sheet_amt: number of sheets to extract
* [material][datum/material]: type of sheets present in this container to extract
* [target][atom]: drop location
* [atom][context]: context - the atom performing the operation, this is the last argument sent in COMSIG_MATCONTAINER_SHEETS_RETRIEVED and is used mostly for silo logging
* [atom][context]: context - the atom performing the operation, this is the last argument sent in COMSIG_MATCONTAINER_STACK_RETRIEVED and is used mostly for silo logging
*/
/datum/component/material_container/proc/retrieve_sheets(sheet_amt, datum/material/material, atom/target = null, atom/context = parent)
//do we support sheets of this material
@@ -684,7 +684,7 @@
use_amount_mat(new_sheets.amount * SHEET_MATERIAL_AMOUNT, material)
sheet_amt -= new_sheets.amount
//send signal
SEND_SIGNAL(src, COMSIG_MATCONTAINER_SHEETS_RETRIEVED, new_sheets, context)
SEND_SIGNAL(src, COMSIG_MATCONTAINER_STACK_RETRIEVED, new_sheets, context)
//no point merging anything into an already full stack
if(new_sheets.amount == new_sheets.max_amount)
continue
@@ -43,7 +43,7 @@ handles linking back and forth.
if(force_connect || (mapload && (T.z in using_map.station_levels)))
connect_to_silo = TRUE
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, PROC_REF(on_item_insert))
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(on_item_insert))
if(mapload) // wait for silo to initialize during mapload
SSticker.OnRoundstart(CALLBACK(src, PROC_REF(_PrepareStorage), connect_to_silo))
@@ -23,7 +23,7 @@
// Setup signaling
var/list/CL = carrier.GetComponents(type)
connector_number = CL.len + 1
RegisterSignal(carrier, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
RegisterSignal(carrier, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
RegisterSignal(carrier, COMSIG_MOVABLE_MOVED, PROC_REF(move_react))
RegisterSignal(carrier, COMSIG_HOSE_FORCEPUMP, PROC_REF(force_pump))
carrier.verbs |= /atom/proc/disconnect_hose
@@ -32,7 +32,7 @@
/datum/component/hose_connector/Destroy()
STOP_PROCESSING(SSobj, src)
UnregisterSignal(carrier, COMSIG_PARENT_EXAMINE)
UnregisterSignal(carrier, COMSIG_ATOM_EXAMINE)
UnregisterSignal(carrier, COMSIG_MOVABLE_MOVED)
UnregisterSignal(carrier, COMSIG_HOSE_FORCEPUMP)
carrier.verbs -= /atom/proc/disconnect_hose
+3 -3
View File
@@ -83,12 +83,12 @@
//Parent at top of heirarchy moved.
/datum/component/recursive_move/proc/top_moved(var/atom/movable/am, var/atom/new_loc, var/atom/old_loc)
SIGNAL_HANDLER
SEND_SIGNAL(holder, COMSIG_OBSERVER_MOVED, old_loc, new_loc)
SEND_SIGNAL(holder, COMSIG_MOVABLE_ATTEMPTED_MOVE, old_loc, new_loc)
//One of the parents other than the top parent moved.
/datum/component/recursive_move/proc/heirarchy_changed(var/atom/old_loc, var/atom/movable/am, var/atom/new_loc)
SIGNAL_HANDLER
SEND_SIGNAL(holder, COMSIG_OBSERVER_MOVED, old_loc, new_loc)
SEND_SIGNAL(holder, COMSIG_MOVABLE_ATTEMPTED_MOVE, old_loc, new_loc)
//Rebuild our list of parents
reset_parents()
setup_parents()
@@ -130,4 +130,4 @@
/obj/item/bananapeel/test/Initialize(mapload)
. = ..()
AddComponent(/datum/component/recursive_move)
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(shmove))
RegisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(shmove))
+12 -12
View File
@@ -43,17 +43,17 @@
// Handle relayed movement
if(settings.relay_movement)
RegisterSignal(host_mob, COMSIG_MOB_RELAY_MOVEMENT, PROC_REF(handle_relay_movement))
RegisterSignal(host_mob, COMSIG_LIVING_HANDLE_VISION, PROC_REF(handle_mob_vision_update))
RegisterSignal(host_mob, COMSIG_MOB_HANDLE_VISION, PROC_REF(handle_mob_vision_update))
// Hud overrides
if(settings.override_entire_hud)
RegisterSignal(host_mob, COMSIG_LIVING_HANDLE_HUD, PROC_REF(handle_hud_override))
RegisterSignal(host_mob, COMSIG_MOB_HANDLE_HUD, PROC_REF(handle_hud_override))
if(settings.override_health_hud)
RegisterSignal(host_mob, COMSIG_LIVING_HANDLE_HUD_HEALTH_ICON, PROC_REF(handle_hud_health))
RegisterSignal(host_mob, COMSIG_MOB_HANDLE_HUD_HEALTH_ICON, PROC_REF(handle_hud_health))
if(settings.override_darkvision_hud)
RegisterSignal(host_mob, COMSIG_LIVING_HANDLE_HUD_DARKSIGHT, PROC_REF(handle_hud_darkvision))
RegisterSignal(host_mob, COMSIG_MOB_HANDLE_HUD_DARKSIGHT, PROC_REF(handle_hud_darkvision))
// Recursive move component fires this, we only want it to handle stuff like being inside a paicard when releasing turf lock
if(isturf(focused_on))
RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(handle_recursive_moved))
RegisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(handle_recursive_moved))
// Focus on remote view
remote_view_target = focused_on
if(host_mob != remote_view_target) // Some items just offset our view, so we set ourselves as the view target, don't double dip if so!
@@ -88,20 +88,20 @@
if(settings.will_blind)
UnregisterSignal(host_mob, COMSIG_LIVING_STATUS_BLIND)
if(isturf(remote_view_target))
UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED)
UnregisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE)
if(settings.will_death)
UnregisterSignal(host_mob, COMSIG_MOB_DEATH)
// Handle relayed movement
if(settings.relay_movement)
UnregisterSignal(host_mob, COMSIG_MOB_RELAY_MOVEMENT)
UnregisterSignal(host_mob, COMSIG_LIVING_HANDLE_VISION)
UnregisterSignal(host_mob, COMSIG_MOB_HANDLE_VISION)
// Hud overrides
if(settings.override_entire_hud)
UnregisterSignal(host_mob, COMSIG_LIVING_HANDLE_HUD)
UnregisterSignal(host_mob, COMSIG_MOB_HANDLE_HUD)
if(settings.override_health_hud)
UnregisterSignal(host_mob, COMSIG_LIVING_HANDLE_HUD_HEALTH_ICON)
UnregisterSignal(host_mob, COMSIG_MOB_HANDLE_HUD_HEALTH_ICON)
if(settings.override_darkvision_hud)
UnregisterSignal(host_mob, COMSIG_LIVING_HANDLE_HUD_DARKSIGHT)
UnregisterSignal(host_mob, COMSIG_MOB_HANDLE_HUD_DARKSIGHT)
// Cleanup remote view
if(host_mob != remote_view_target) // If target is not ourselves
UnregisterSignal(remote_view_target, COMSIG_QDELETING)
@@ -419,13 +419,13 @@
. = ..()
// Items can be nested deeply, so we need to update on any parent reorganization or actual move.
host_mob.AddComponent(/datum/component/recursive_move)
RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(handle_recursive_moved)) // Doesn't need override, basetype only ever registers this signal if we're looking at a turf
RegisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(handle_recursive_moved)) // Doesn't need override, basetype only ever registers this signal if we're looking at a turf
// Check our inmob state
if(ismob(find_topmost_atom()))
needs_to_decouple = TRUE
/datum/component/remote_view/mob_holding_item/Destroy(force)
UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED)
UnregisterSignal(host_mob, COMSIG_MOVABLE_MOVED)
. = ..()
/datum/component/remote_view/mob_holding_item/handle_status_effects(datum/source, amount, ignore_canstun)
+5 -5
View File
@@ -11,14 +11,14 @@
host_item.verbs += /obj/item/proc/toggle_tethered_handheld
host_item.actions_types += list(/datum/action/item_action/swap_tethered_item) // AddComponent for this must be called before . = ..() in Initilize()
RegisterSignal(host_item, COMSIG_ITEM_ATTACK_SELF, PROC_REF(on_attackself))
RegisterSignal(host_item, COMSIG_PARENT_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(host_item, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(host_item, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
// Link handheld
make_handheld()
/datum/component/tethered_item/Destroy()
UnregisterSignal(host_item, COMSIG_ITEM_ATTACK_SELF)
UnregisterSignal(host_item, COMSIG_PARENT_ATTACKBY)
UnregisterSignal(host_item, COMSIG_ATOM_ATTACKBY)
UnregisterSignal(host_item, COMSIG_MOVABLE_MOVED)
host_item.verbs -= /obj/item/proc/toggle_tethered_handheld
host_item = null
@@ -32,12 +32,12 @@
// Anything that uses this component must intercept attack_hand() and emit COMSIG_ITEM_ATTACK_SELF.
// This stops you from removing the item from your backpack slot while trying to take the handheld item out.
// There's no way to block the item pickup code, so it has to be done this way. Unfortunately.
// Will return COMPONENT_NO_INTERACT if the component handled the action. Otherwise attack_hand() should resolve normally.
// Will return COMPONENT_CANCEL_ATTACK_CHAIN if the component handled the action. Otherwise attack_hand() should resolve normally.
/datum/component/tethered_item/proc/on_attackself(obj/item/source, mob/living/carbon/human/user)
SIGNAL_HANDLER
if(hand_held.loc != host_item)
reattach_handheld()
return COMPONENT_NO_INTERACT
return COMPONENT_CANCEL_ATTACK_CHAIN
//Detach the handset into the user's hands
if(!slot_check())
if(ismob(host_item.loc))
@@ -49,7 +49,7 @@
host_item.update_icon()
hand_held.update_icon()
to_chat(user,span_notice("You remove \the [hand_held] from \the [host_item]."))
return COMPONENT_NO_INTERACT
return COMPONENT_CANCEL_ATTACK_CHAIN
// Signal registry for handheld item
/datum/component/tethered_item/proc/make_handheld()
+2 -2
View File
@@ -88,10 +88,10 @@
RegisterSignal(parent, COMSIG_STUN_EFFECT_ACT, PROC_REF(check_taser))
RegisterSignal(parent, COMSIG_MOB_ROLLED_DICE, PROC_REF(check_roll))
RegisterSignal(parent, COMSIG_HUMAN_ON_CATCH_THROW, PROC_REF(check_throw))
RegisterSignal(parent, COMSIG_PICKED_UP_ITEM, PROC_REF(check_pickup))
RegisterSignal(parent, COMSIG_ITEM_PICKUP, PROC_REF(check_pickup))
/datum/component/omen/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_ON_CARBON_SLIP, COMSIG_MOVABLE_MOVED, COMSIG_STUN_EFFECT_ACT, COMSIG_MOVED_DOWN_STAIRS, COMSIG_MOB_ROLLED_DICE, COMSIG_HUMAN_ON_CATCH_THROW, COMSIG_PICKED_UP_ITEM))
UnregisterSignal(parent, list(COMSIG_ON_CARBON_SLIP, COMSIG_MOVABLE_MOVED, COMSIG_STUN_EFFECT_ACT, COMSIG_MOVED_DOWN_STAIRS, COMSIG_MOB_ROLLED_DICE, COMSIG_HUMAN_ON_CATCH_THROW, COMSIG_ITEM_PICKUP))
/datum/component/omen/proc/consume_omen()
incidents_left--