mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-21 03:56:47 +01:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user