mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-14 02:43:16 +00:00
Makes the code compatible with 515.1594+
Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword
And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.
@tgstation/commit-access Since the .proc/stuff is pretty big change.
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
68 lines
2.3 KiB
Plaintext
68 lines
2.3 KiB
Plaintext
/**
|
|
* # Assembly Shell
|
|
*
|
|
* An assembly that triggers and can be triggered by wires.
|
|
*/
|
|
/obj/item/assembly/wiremod
|
|
name = "circuit assembly"
|
|
desc = "A small electronic device that can house an integrated circuit."
|
|
icon_state = "wiremod"
|
|
attachable = TRUE
|
|
|
|
/obj/item/assembly/wiremod/Initialize(mapload)
|
|
. = ..()
|
|
AddComponent(/datum/component/shell, list(
|
|
new /obj/item/circuit_component/assembly_input(),
|
|
new /obj/item/circuit_component/assembly_output(),
|
|
), SHELL_CAPACITY_SMALL)
|
|
|
|
/obj/item/assembly/wiremod/examine(mob/user)
|
|
. = ..()
|
|
. += span_notice("You can also [secured && "un"]secure [src] by right-clicking it with a screwdriver, even if an integrated circuit is attached.")
|
|
|
|
// This is to bypass removing the circuit with a screwdriver left-click
|
|
/obj/item/assembly/wiremod/screwdriver_act_secondary(mob/living/user, obj/item/tool)
|
|
screwdriver_act(user, tool)
|
|
|
|
/obj/item/circuit_component/assembly_input
|
|
display_name = "Assembly Input"
|
|
desc = "Triggers when pulsed by an attached wire or assembly."
|
|
|
|
var/datum/port/output/signal
|
|
|
|
/obj/item/circuit_component/assembly_input/populate_ports()
|
|
signal = add_output_port("Signal", PORT_TYPE_SIGNAL)
|
|
|
|
/obj/item/circuit_component/assembly_input/register_shell(atom/movable/shell)
|
|
RegisterSignal(shell, list(COMSIG_ASSEMBLY_PULSED, COMSIG_ITEM_ATTACK_SELF), PROC_REF(on_pulsed))
|
|
|
|
/obj/item/circuit_component/assembly_input/unregister_shell(atom/movable/shell)
|
|
UnregisterSignal(shell, list(COMSIG_ASSEMBLY_PULSED, COMSIG_ITEM_ATTACK_SELF))
|
|
|
|
/obj/item/circuit_component/assembly_input/proc/on_pulsed(datum/source, mob/pulser)
|
|
SIGNAL_HANDLER
|
|
signal.set_output(COMPONENT_SIGNAL)
|
|
|
|
/obj/item/circuit_component/assembly_output
|
|
display_name = "Assembly Output"
|
|
desc = "Pulses an attached wire or assembly when triggered."
|
|
|
|
var/obj/item/assembly/attached_assembly
|
|
|
|
var/datum/port/input/signal
|
|
|
|
/obj/item/circuit_component/assembly_output/populate_ports()
|
|
signal = add_input_port("Signal", PORT_TYPE_SIGNAL)
|
|
|
|
/obj/item/circuit_component/assembly_output/register_shell(atom/movable/shell)
|
|
. = ..()
|
|
if(isassembly(shell))
|
|
attached_assembly = shell
|
|
|
|
/obj/item/circuit_component/assembly_output/unregister_shell(atom/movable/shell)
|
|
attached_assembly = null
|
|
return ..()
|
|
|
|
/obj/item/circuit_component/assembly_output/input_received(datum/port/input/port, list/return_values)
|
|
attached_assembly.pulse(FALSE)
|