[MIRROR] Moves most circuit component defines to files to reduce the amount of scattered code. (#7450)

* Moves most circuit defines to files (#60705)

Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>

* Moves most circuit component defines to files to reduce the amount of scattered code.

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
This commit is contained in:
SkyratBot
2021-08-08 02:41:46 +01:00
committed by GitHub
co-authored by Watermelon914 Watermelon914
parent 2c7f3a302d
commit 47bb16ee3d
11 changed files with 79 additions and 76 deletions
@@ -1,3 +1,6 @@
#define COMP_RADIO_PUBLIC "public"
#define COMP_RADIO_PRIVATE "private"
/**
* # Radio Component
*
@@ -66,3 +69,6 @@
return
trigger_output.set_output(COMPONENT_SIGNAL)
#undef COMP_RADIO_PUBLIC
#undef COMP_RADIO_PRIVATE
@@ -34,28 +34,17 @@
/obj/item/circuit_component/soundemitter/populate_options()
var/static/component_options = list(
COMP_SOUND_BUZZ,
COMP_SOUND_BUZZ_TWO,
COMP_SOUND_CHIME,
COMP_SOUND_HONK,
COMP_SOUND_PING,
COMP_SOUND_SAD,
COMP_SOUND_WARN,
COMP_SOUND_SLOWCLAP,
"Buzz" = 'sound/machines/buzz-sigh.ogg',
"Buzz Twice" = 'sound/machines/buzz-two.ogg',
"Chime" = 'sound/machines/chime.ogg',
"Honk" = 'sound/items/bikehorn.ogg',
"Ping" = 'sound/machines/ping.ogg',
"Sad Trombone" = 'sound/misc/sadtrombone.ogg',
"Warn" = 'sound/machines/warning-buzzer.ogg',
"Slow Clap" = 'sound/machines/slowclap.ogg',
)
sound_file = add_option_port("Sound Option", component_options)
var/static/options_to_sound = list(
COMP_SOUND_BUZZ = 'sound/machines/buzz-sigh.ogg',
COMP_SOUND_BUZZ_TWO = 'sound/machines/buzz-two.ogg',
COMP_SOUND_CHIME = 'sound/machines/chime.ogg',
COMP_SOUND_HONK = 'sound/items/bikehorn.ogg',
COMP_SOUND_PING = 'sound/machines/ping.ogg',
COMP_SOUND_SAD = 'sound/misc/sadtrombone.ogg',
COMP_SOUND_WARN = 'sound/machines/warning-buzzer.ogg',
COMP_SOUND_SLOWCLAP = 'sound/machines/slowclap.ogg',
)
options_map = options_to_sound
options_map = component_options
/obj/item/circuit_component/soundemitter/input_received(datum/port/input/port)
@@ -1,3 +1,7 @@
#define COMP_PROC_GLOBAL "Global"
#define COMP_PROC_OBJECT "Object"
/**
* # Proc Call Component
*
@@ -63,3 +67,6 @@
GLOB.AdminProcCaller = null
output_value.set_output(result)
#undef COMP_PROC_GLOBAL
#undef COMP_PROC_OBJECT
@@ -1,3 +1,6 @@
#define COMP_BAR_OVERLAY_VERTICAL "Vertical"
#define COMP_BAR_OVERLAY_HORIZONTAL "Horizontal"
/**
* # Bar Overlay Component
*
@@ -54,3 +57,6 @@
cool_overlay,
owner,
))
#undef COMP_BAR_OVERLAY_VERTICAL
#undef COMP_BAR_OVERLAY_HORIZONTAL
@@ -1,3 +1,10 @@
#define COMP_ARITHMETIC_ADD "Add"
#define COMP_ARITHMETIC_SUBTRACT "Subtract"
#define COMP_ARITHMETIC_MULTIPLY "Multiply"
#define COMP_ARITHMETIC_DIVIDE "Divide"
#define COMP_ARITHMETIC_MIN "Minimum"
#define COMP_ARITHMETIC_MAX "Maximum"
/**
* # Arithmetic Component
*
@@ -73,3 +80,9 @@
output.set_output(result)
#undef COMP_ARITHMETIC_ADD
#undef COMP_ARITHMETIC_SUBTRACT
#undef COMP_ARITHMETIC_MULTIPLY
#undef COMP_ARITHMETIC_DIVIDE
#undef COMP_ARITHMETIC_MIN
#undef COMP_ARITHMETIC_MAX
@@ -1,3 +1,7 @@
#define COMP_LOGIC_AND "AND"
#define COMP_LOGIC_OR "OR"
#define COMP_LOGIC_XOR "XOR"
/**
* # Logic Component
*
@@ -47,3 +51,7 @@
return FALSE
if(.)
return TRUE
#undef COMP_LOGIC_AND
#undef COMP_LOGIC_OR
#undef COMP_LOGIC_XOR
@@ -1,3 +1,6 @@
#define COMP_TEXT_LOWER "To Lower"
#define COMP_TEXT_UPPER "To Upper"
/**
* # Text Component
*
@@ -47,3 +50,5 @@
output.set_output(result)
#undef COMP_TEXT_LOWER
#undef COMP_TEXT_UPPER
@@ -1,3 +1,6 @@
/// The minimum delay value that the delay component can have.
#define COMP_DELAY_MIN_VALUE 0.1
/**
* # Delay Component
*
@@ -36,3 +39,5 @@
addtimer(CALLBACK(output, /datum/port/output.proc/set_output, trigger.input_value), delay*10)
else
output.set_output(trigger.input_value)
#undef COMP_DELAY_MIN_VALUE
@@ -1,3 +1,6 @@
#define COMP_TYPECHECK_MOB "organism"
#define COMP_TYPECHECK_HUMAN "humanoid"
/**
* # Typecheck Component
*
@@ -43,3 +46,6 @@
if(COMP_TYPECHECK_HUMAN)
return ishuman(input_val)
#undef COMP_TYPECHECK_MOB
#undef COMP_TYPECHECK_HUMAN