procs
This commit is contained in:
@@ -155,9 +155,9 @@
|
||||
|
||||
/obj/item/circuit_component/module/add_to(obj/item/integrated_circuit/added_to)
|
||||
. = ..()
|
||||
RegisterSignal(added_to, COMSIG_CIRCUIT_SET_CELL, .proc/handle_set_cell)
|
||||
RegisterSignal(added_to, COMSIG_CIRCUIT_SET_ON, .proc/handle_set_on)
|
||||
RegisterSignal(added_to, COMSIG_CIRCUIT_SET_SHELL, .proc/handle_set_shell)
|
||||
RegisterSignal(added_to, COMSIG_CIRCUIT_SET_CELL, PROC_REF(handle_set_cell))
|
||||
RegisterSignal(added_to, COMSIG_CIRCUIT_SET_ON, PROC_REF(handle_set_on))
|
||||
RegisterSignal(added_to, COMSIG_CIRCUIT_SET_SHELL, PROC_REF(handle_set_shell))
|
||||
internal_circuit.set_cell(added_to.cell)
|
||||
internal_circuit.set_shell(added_to.shell)
|
||||
internal_circuit.set_on(added_to.on)
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
/obj/item/circuit_component/mmi/register_shell(atom/movable/shell)
|
||||
. = ..()
|
||||
RegisterSignal(shell, COMSIG_PARENT_ATTACKBY, .proc/handle_attack_by)
|
||||
RegisterSignal(shell, COMSIG_PARENT_ATTACKBY, PROC_REF(handle_attack_by))
|
||||
|
||||
/obj/item/circuit_component/mmi/unregister_shell(atom/movable/shell)
|
||||
UnregisterSignal(shell, COMSIG_PARENT_ATTACKBY)
|
||||
@@ -103,8 +103,8 @@
|
||||
if(to_add.brainmob)
|
||||
update_mmi_mob(to_add, null, to_add.brainmob)
|
||||
brain = to_add
|
||||
RegisterSignal(to_add, COMSIG_PARENT_QDELETING, .proc/remove_current_brain)
|
||||
RegisterSignal(to_add, COMSIG_MOVABLE_MOVED, .proc/mmi_moved)
|
||||
RegisterSignal(to_add, COMSIG_PARENT_QDELETING, PROC_REF(remove_current_brain))
|
||||
RegisterSignal(to_add, COMSIG_MOVABLE_MOVED, PROC_REF(mmi_moved))
|
||||
|
||||
/obj/item/circuit_component/mmi/proc/mmi_moved(atom/movable/mmi)
|
||||
SIGNAL_HANDLER
|
||||
@@ -134,7 +134,7 @@
|
||||
UnregisterSignal(old_mmi, COMSIG_MOB_CLICKON)
|
||||
if(new_mmi)
|
||||
new_mmi.remote_control = src
|
||||
RegisterSignal(new_mmi, COMSIG_MOB_CLICKON, .proc/handle_mmi_attack)
|
||||
RegisterSignal(new_mmi, COMSIG_MOB_CLICKON, PROC_REF(handle_mmi_attack))
|
||||
|
||||
/obj/item/circuit_component/mmi/relaymove(mob/living/user, direct)
|
||||
if(user != brain.brainmob)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/obj/item/circuit_component/counter_overlay/register_shell(atom/movable/shell)
|
||||
if(istype(shell, /obj/item/organ/cyberimp/bci))
|
||||
bci = shell
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed)
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, PROC_REF(on_organ_removed))
|
||||
|
||||
/obj/item/circuit_component/counter_overlay/unregister_shell(atom/movable/shell)
|
||||
bci = null
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
/obj/item/circuit_component/object_overlay/register_shell(atom/movable/shell)
|
||||
if(istype(shell, /obj/item/organ/cyberimp/bci))
|
||||
bci = shell
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed)
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, PROC_REF(on_organ_removed))
|
||||
|
||||
/obj/item/circuit_component/object_overlay/unregister_shell(atom/movable/shell)
|
||||
bci = null
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/obj/item/circuit_component/target_intercept/register_shell(atom/movable/shell)
|
||||
if(istype(shell, /obj/item/organ/cyberimp/bci))
|
||||
bci = shell
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed)
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, PROC_REF(on_organ_removed))
|
||||
|
||||
/obj/item/circuit_component/target_intercept/unregister_shell(atom/movable/shell)
|
||||
bci = null
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
data_package = add_output_port("Data Package", PORT_TYPE_ANY)
|
||||
secondary_package = add_output_port("Secondary Package", PORT_TYPE_ANY)
|
||||
enc_key = add_input_port("Encryption Key", PORT_TYPE_STRING)
|
||||
RegisterSignal(src, COMSIG_COMPONENT_NTNET_RECEIVE, .proc/ntnet_receive)
|
||||
RegisterSignal(src, COMSIG_COMPONENT_NTNET_RECEIVE, PROC_REF(ntnet_receive))
|
||||
|
||||
/obj/item/circuit_component/ntnet_receive/populate_options()
|
||||
var/static/component_options = list(
|
||||
|
||||
@@ -66,5 +66,5 @@
|
||||
remove_current_variable()
|
||||
current_variable = variable
|
||||
current_variable.add_listener(src)
|
||||
RegisterSignal(current_variable, COMSIG_PARENT_QDELETING, .proc/remove_current_variable)
|
||||
RegisterSignal(current_variable, COMSIG_PARENT_QDELETING, PROC_REF(remove_current_variable))
|
||||
value.set_datatype(variable.datatype)
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
|
||||
/obj/machinery/module_duplicator/proc/print_module(list/design)
|
||||
flick("module-fab-print", src)
|
||||
addtimer(CALLBACK(src, .proc/finish_module_print, design), 1.6 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(finish_module_print), design), 1.6 SECONDS)
|
||||
|
||||
/obj/machinery/module_duplicator/proc/finish_module_print(list/design)
|
||||
var/obj/item/circuit_component/module/module = new(drop_location())
|
||||
@@ -333,7 +333,7 @@
|
||||
data["materials"] = list(/datum/material/glass = total_cost)
|
||||
|
||||
flick("module-fab-scan", src)
|
||||
addtimer(CALLBACK(src, .proc/finish_module_scan, user, data), 1.4 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(finish_module_scan), user, data), 1.4 SECONDS)
|
||||
|
||||
/obj/machinery/module_duplicator/proc/finish_module_scan(mob/user, data)
|
||||
scanned_designs += list(data)
|
||||
|
||||
@@ -74,7 +74,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
|
||||
|
||||
GLOB.integrated_circuits += src
|
||||
|
||||
RegisterSignal(src, COMSIG_ATOM_USB_CABLE_TRY_ATTACH, .proc/on_atom_usb_cable_try_attach)
|
||||
RegisterSignal(src, COMSIG_ATOM_USB_CABLE_TRY_ATTACH, PROC_REF(on_atom_usb_cable_try_attach))
|
||||
|
||||
/obj/item/integrated_circuit/loaded/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -148,7 +148,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
|
||||
set_on(TRUE)
|
||||
SEND_SIGNAL(src, COMSIG_CIRCUIT_SET_SHELL, new_shell)
|
||||
shell = new_shell
|
||||
RegisterSignal(shell, COMSIG_PARENT_QDELETING, .proc/remove_current_shell)
|
||||
RegisterSignal(shell, COMSIG_PARENT_QDELETING, PROC_REF(remove_current_shell))
|
||||
for(var/obj/item/circuit_component/attached_component as anything in attached_components)
|
||||
attached_component.register_shell(shell)
|
||||
// Their input ports may be updated with user values, but the outputs haven't updated
|
||||
@@ -202,7 +202,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
|
||||
to_add.rel_y = rand(COMPONENT_MIN_RANDOM_POS, COMPONENT_MAX_RANDOM_POS) - screen_y
|
||||
to_add.parent = src
|
||||
attached_components += to_add
|
||||
RegisterSignal(to_add, COMSIG_MOVABLE_MOVED, .proc/component_move_handler)
|
||||
RegisterSignal(to_add, COMSIG_MOVABLE_MOVED, PROC_REF(component_move_handler))
|
||||
SStgui.update_uis(src)
|
||||
|
||||
if(shell)
|
||||
@@ -545,7 +545,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
|
||||
if(!add_component(component, usr))
|
||||
qdel(component)
|
||||
return
|
||||
RegisterSignal(component, COMSIG_CIRCUIT_COMPONENT_REMOVED, .proc/clear_setter_or_getter)
|
||||
RegisterSignal(component, COMSIG_CIRCUIT_COMPONENT_REMOVED, PROC_REF(clear_setter_or_getter))
|
||||
setter_and_getter_count++
|
||||
if("move_screen")
|
||||
screen_x = text2num(params["screen_x"])
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
say("Marked [target].")
|
||||
marked_atom = target
|
||||
RegisterSignal(marked_atom, COMSIG_PARENT_QDELETING, .proc/cleanup_marked_atom)
|
||||
RegisterSignal(marked_atom, COMSIG_PARENT_QDELETING, PROC_REF(cleanup_marked_atom))
|
||||
update_icon()
|
||||
flick("multitool_circuit_flick", src)
|
||||
playsound(src.loc, 'sound/misc/compiler-stage2.ogg', 30, TRUE)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
UnregisterSignal(value, COMSIG_PARENT_QDELETING)
|
||||
src.value = datatype_handler.convert_value(src, value)
|
||||
if(isatom(value))
|
||||
RegisterSignal(value, COMSIG_PARENT_QDELETING, .proc/null_value)
|
||||
RegisterSignal(value, COMSIG_PARENT_QDELETING, PROC_REF(null_value))
|
||||
SEND_SIGNAL(src, COMSIG_PORT_SET_VALUE, value)
|
||||
|
||||
/**
|
||||
@@ -167,9 +167,9 @@
|
||||
*/
|
||||
/datum/port/input/proc/connect(datum/port/output/output)
|
||||
connected_ports |= output
|
||||
RegisterSignal(output, COMSIG_PORT_SET_VALUE, .proc/receive_value)
|
||||
RegisterSignal(output, COMSIG_PORT_SET_TYPE, .proc/check_type)
|
||||
RegisterSignal(output, COMSIG_PORT_DISCONNECT, .proc/disconnect)
|
||||
RegisterSignal(output, COMSIG_PORT_SET_VALUE, PROC_REF(receive_value))
|
||||
RegisterSignal(output, COMSIG_PORT_SET_TYPE, PROC_REF(check_type))
|
||||
RegisterSignal(output, COMSIG_PORT_DISCONNECT, PROC_REF(disconnect))
|
||||
// For signals, we don't update the input to prevent sending a signal when connecting ports.
|
||||
if(!(datatype_handler.datatype_flags & DATATYPE_FLAG_AVOID_VALUE_UPDATE))
|
||||
set_input(output.value)
|
||||
@@ -199,7 +199,7 @@
|
||||
*/
|
||||
/datum/port/input/proc/receive_value(datum/port/output/output, value)
|
||||
SIGNAL_HANDLER
|
||||
SScircuit_component.add_callback(CALLBACK(src, .proc/set_input, value))
|
||||
SScircuit_component.add_callback(CALLBACK(src, PROC_REF(set_input), value))
|
||||
|
||||
/// Signal handler proc to null the input if an atom is deleted. An update is not sent because this was not set by anything.
|
||||
/datum/port/proc/null_value(datum/source)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/obj/item/usb_cable/Initialize(mapload)
|
||||
. = ..()
|
||||
RegisterSignal(src, COMSIG_MOVABLE_MOVED, .proc/on_moved)
|
||||
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
|
||||
|
||||
/obj/item/usb_cable/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -85,9 +85,9 @@
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/usb_cable/proc/register_circuit_signals()
|
||||
RegisterSignal(attached_circuit, COMSIG_MOVABLE_MOVED, .proc/on_moved)
|
||||
RegisterSignal(attached_circuit, COMSIG_PARENT_QDELETING, .proc/on_circuit_qdeling)
|
||||
RegisterSignal(attached_circuit.shell, COMSIG_MOVABLE_MOVED, .proc/on_moved)
|
||||
RegisterSignal(attached_circuit, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
|
||||
RegisterSignal(attached_circuit, COMSIG_PARENT_QDELETING, PROC_REF(on_circuit_qdeling))
|
||||
RegisterSignal(attached_circuit.shell, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
|
||||
|
||||
/obj/item/usb_cable/proc/unregister_circuit_signals(obj/item/integrated_circuit/old_circuit)
|
||||
UnregisterSignal(attached_circuit, list(
|
||||
|
||||
@@ -84,9 +84,9 @@
|
||||
. = ..()
|
||||
if(istype(shell, /obj/machinery/door/airlock))
|
||||
attached_airlock = shell
|
||||
RegisterSignal(shell, COMSIG_AIRLOCK_SET_BOLT, .proc/on_airlock_set_bolted)
|
||||
RegisterSignal(shell, COMSIG_AIRLOCK_OPEN, .proc/on_airlock_open)
|
||||
RegisterSignal(shell, COMSIG_AIRLOCK_CLOSE, .proc/on_airlock_closed)
|
||||
RegisterSignal(shell, COMSIG_AIRLOCK_SET_BOLT, PROC_REF(on_airlock_set_bolted))
|
||||
RegisterSignal(shell, COMSIG_AIRLOCK_OPEN, PROC_REF(on_airlock_open))
|
||||
RegisterSignal(shell, COMSIG_AIRLOCK_CLOSE, PROC_REF(on_airlock_closed))
|
||||
|
||||
/obj/item/circuit_component/airlock/unregister_shell(atom/movable/shell)
|
||||
attached_airlock = null
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/circuit_component/bot/register_shell(atom/movable/shell)
|
||||
RegisterSignal(shell, COMSIG_ATOM_ATTACK_HAND, .proc/on_attack_hand)
|
||||
RegisterSignal(shell, COMSIG_ATOM_ATTACK_HAND, PROC_REF(on_attack_hand))
|
||||
|
||||
/obj/item/circuit_component/bot/unregister_shell(atom/movable/shell)
|
||||
UnregisterSignal(shell, COMSIG_ATOM_ATTACK_HAND)
|
||||
|
||||
@@ -185,8 +185,8 @@
|
||||
charge_action = new(src)
|
||||
bci.actions += list(charge_action)
|
||||
|
||||
RegisterSignal(shell, COMSIG_ORGAN_IMPLANTED, .proc/on_organ_implanted)
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed)
|
||||
RegisterSignal(shell, COMSIG_ORGAN_IMPLANTED, PROC_REF(on_organ_implanted))
|
||||
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, PROC_REF(on_organ_removed))
|
||||
|
||||
/obj/item/circuit_component/bci_core/unregister_shell(atom/movable/shell)
|
||||
var/obj/item/organ/cyberimp/bci/bci = shell
|
||||
@@ -224,9 +224,9 @@
|
||||
user_port.set_output(owner)
|
||||
user = WEAKREF(owner)
|
||||
|
||||
RegisterSignal(owner, COMSIG_PARENT_EXAMINE, .proc/on_examine)
|
||||
RegisterSignal(owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT, .proc/on_borg_charge)
|
||||
RegisterSignal(owner, COMSIG_LIVING_ELECTROCUTE_ACT, .proc/on_electrocute)
|
||||
RegisterSignal(owner, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
|
||||
RegisterSignal(owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT, PROC_REF(on_borg_charge))
|
||||
RegisterSignal(owner, COMSIG_LIVING_ELECTROCUTE_ACT, PROC_REF(on_electrocute))
|
||||
|
||||
/obj/item/circuit_component/bci_core/proc/on_organ_removed(datum/source, mob/living/carbon/owner)
|
||||
SIGNAL_HANDLER
|
||||
@@ -459,9 +459,9 @@
|
||||
locked = TRUE
|
||||
|
||||
set_busy(TRUE, "[initial(icon_state)]_raising")
|
||||
addtimer(CALLBACK(src, .proc/set_busy, TRUE, "[initial(icon_state)]_active"), 1 SECONDS)
|
||||
addtimer(CALLBACK(src, .proc/set_busy, TRUE, "[initial(icon_state)]_falling"), 2 SECONDS)
|
||||
addtimer(CALLBACK(src, .proc/complete_process, locked_state), 3 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(set_busy), TRUE, "[initial(icon_state)]_active"), 1 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(set_busy), TRUE, "[initial(icon_state)]_falling"), 2 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(complete_process), locked_state), 3 SECONDS)
|
||||
|
||||
/obj/machinery/bci_implanter/proc/complete_process(locked_state)
|
||||
locked = locked_state
|
||||
@@ -513,7 +513,7 @@
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
|
||||
return FALSE
|
||||
|
||||
addtimer(CALLBACK(src, .proc/start_process), 1 SECONDS)
|
||||
addtimer(CALLBACK(src, PROC_REF(start_process)), 1 SECONDS)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/bci_implanter/relaymove(mob/living/user, direction)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
signal = add_output_port("Signal", PORT_TYPE_SIGNAL)
|
||||
|
||||
/obj/item/circuit_component/compact_remote/register_shell(atom/movable/shell)
|
||||
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF, .proc/send_trigger)
|
||||
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF, PROC_REF(send_trigger))
|
||||
|
||||
/obj/item/circuit_component/compact_remote/unregister_shell(atom/movable/shell)
|
||||
UnregisterSignal(shell, COMSIG_ITEM_ATTACK_SELF)
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
right = add_output_port("Extra Signal", PORT_TYPE_SIGNAL)
|
||||
|
||||
/obj/item/circuit_component/controller/register_shell(atom/movable/shell)
|
||||
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF, .proc/send_trigger)
|
||||
RegisterSignal(shell, COMSIG_CLICK_ALT, .proc/send_alternate_signal)
|
||||
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF_SECONDARY, .proc/send_right_signal)
|
||||
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF, PROC_REF(send_trigger))
|
||||
RegisterSignal(shell, COMSIG_CLICK_ALT, PROC_REF(send_alternate_signal))
|
||||
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF_SECONDARY, PROC_REF(send_right_signal))
|
||||
|
||||
/obj/item/circuit_component/controller/unregister_shell(atom/movable/shell)
|
||||
UnregisterSignal(shell, list(
|
||||
|
||||
@@ -105,8 +105,8 @@
|
||||
if(istype(shell, /obj/structure/money_bot))
|
||||
attached_bot = shell
|
||||
total_money.set_output(attached_bot.stored_money)
|
||||
RegisterSignal(shell, COMSIG_PARENT_ATTACKBY, .proc/handle_money_insert)
|
||||
RegisterSignal(shell, COMSIG_MONEYBOT_ADD_MONEY, .proc/handle_money_update)
|
||||
RegisterSignal(shell, COMSIG_PARENT_ATTACKBY, PROC_REF(handle_money_insert))
|
||||
RegisterSignal(shell, COMSIG_MONEYBOT_ADD_MONEY, PROC_REF(handle_money_update))
|
||||
|
||||
/obj/item/circuit_component/money_bot/unregister_shell(atom/movable/shell)
|
||||
UnregisterSignal(shell, list(
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
signal = add_output_port("Scanned", PORT_TYPE_SIGNAL)
|
||||
|
||||
/obj/item/circuit_component/wiremod_scanner/register_shell(atom/movable/shell)
|
||||
RegisterSignal(shell, COMSIG_ITEM_AFTERATTACK, .proc/handle_afterattack)
|
||||
RegisterSignal(shell, COMSIG_ITEM_AFTERATTACK, PROC_REF(handle_afterattack))
|
||||
|
||||
/obj/item/circuit_component/wiremod_scanner/unregister_shell(atom/movable/shell)
|
||||
UnregisterSignal(shell, COMSIG_ITEM_AFTERATTACK)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
deltimer(scanline_timer)
|
||||
add_overlay(type)
|
||||
if(duration)
|
||||
scanline_timer = addtimer(CALLBACK(src, .proc/set_scanline, "passive"), duration, TIMER_STOPPABLE)
|
||||
scanline_timer = addtimer(CALLBACK(src, PROC_REF(set_scanline), "passive"), duration, TIMER_STOPPABLE)
|
||||
|
||||
/obj/item/circuit_component/scanner_gate
|
||||
display_name = "Scanner Gate"
|
||||
@@ -53,7 +53,7 @@
|
||||
. = ..()
|
||||
if(istype(shell, /obj/structure/scanner_gate_shell))
|
||||
attached_gate = shell
|
||||
RegisterSignal(attached_gate, COMSIG_SCANGATE_SHELL_PASS, .proc/on_trigger)
|
||||
RegisterSignal(attached_gate, COMSIG_SCANGATE_SHELL_PASS, PROC_REF(on_trigger))
|
||||
|
||||
/obj/item/circuit_component/scanner_gate/unregister_shell(atom/movable/shell)
|
||||
UnregisterSignal(attached_gate, COMSIG_SCANGATE_SHELL_PASS)
|
||||
|
||||
Reference in New Issue
Block a user