Input ports now connect to multiple output ports. Remove combiner. (#60494)

* tgui bsod

* debug disconnections

* prelim

* recomment

* set_value -> put ._.

* DAMN IT

* reinsert subsystem

* prepare

* unditch signals

* remove combiner

* remove combiner some more

* how did router.dm get here? deleting.

* These two COMSIGS should be one.

* critical typo

* inline cast

* have your signals

* Have your set_input & set_output.

* make compile

* upgrade save/load to n-to-n-wires

* have your documentation

* have your unsafe proc

* pay no attention to the compile errors

* unlist the ref

* paste my for block back in ._.

* fix manual input

* oops pushed too soon

* Have your !port.connected_to?.length

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
This commit is contained in:
Gurkenglas
2021-08-11 17:48:29 +02:00
committed by GitHub
parent e64b101750
commit e0fad671fd
66 changed files with 280 additions and 386 deletions
@@ -45,11 +45,11 @@
/obj/item/circuit_component/light/input_received(datum/port/input/port)
. = ..()
brightness.set_input(clamp(brightness.input_value || 0, 0, max_power), FALSE)
red.set_input(clamp(red.input_value, 0, 255), FALSE)
blue.set_input(clamp(blue.input_value, 0, 255), FALSE)
green.set_input(clamp(green.input_value, 0, 255), FALSE)
var/list/hsl = rgb2hsl(red.input_value || 0, green.input_value || 0, blue.input_value || 0)
brightness.set_input(clamp(brightness.value || 0, 0, max_power))
red.set_input(clamp(red.value, 0, 255))
blue.set_input(clamp(blue.value, 0, 255))
green.set_input(clamp(green.value, 0, 255))
var/list/hsl = rgb2hsl(red.value || 0, green.value || 0, blue.value || 0)
var/list/light_col = hsl2rgb(hsl[1], hsl[2], max(min_lightness, hsl[3]))
shell_light_color = rgb(light_col[1], light_col[2], light_col[3])
if(.)
@@ -60,9 +60,9 @@
/obj/item/circuit_component/light/proc/set_atom_light(atom/movable/target_atom)
// Clamp anyways just for safety
var/bright_val = min(max(brightness.input_value || 0, 0), max_power)
var/bright_val = min(max(brightness.value || 0, 0), max_power)
target_atom.set_light_power(bright_val)
target_atom.set_light_range(bright_val)
target_atom.set_light_color(shell_light_color)
target_atom.set_light_on(!!on.input_value)
target_atom.set_light_on(!!on.value)
@@ -66,10 +66,10 @@
if(COMPONENT_TRIGGERED_BY(eject, port))
remove_current_brain()
if(COMPONENT_TRIGGERED_BY(send, port))
if(!message.input_value)
if(!message.value)
return
var/msg_str = copytext(html_encode(message.input_value), 1, max_length)
var/msg_str = copytext(html_encode(message.value), 1, max_length)
var/mob/living/target = brain.brainmob
if(!target)
@@ -49,15 +49,15 @@
if(.)
return
var/target_X = input_X.input_value
var/target_X = input_X.value
if(isnull(target_X))
return
var/target_Y = input_Y.input_value
var/target_Y = input_Y.value
if(isnull(target_Y))
return
var/atom/path_id = id_card.input_value
var/atom/path_id = id_card.value
if(path_id && !istype(path_id, /obj/item/card/id))
path_id = null
failed.set_output(COMPONENT_SIGNAL)
@@ -20,7 +20,7 @@
if(.)
return
var/atom/target_atom = target.input_value
var/atom/target_atom = target.value
if(!target_atom)
return
@@ -45,27 +45,27 @@
/obj/item/circuit_component/radio/input_received(datum/port/input/port)
. = ..()
freq.set_input(sanitize_frequency(freq.input_value, TRUE), FALSE)
freq.set_input(sanitize_frequency(freq.value, TRUE))
if(.)
return
var/frequency = freq.input_value
var/frequency = freq.value
SSradio.remove_object(src, current_freq)
radio_connection = SSradio.add_object(src, frequency, RADIO_SIGNALER)
current_freq = frequency
if(COMPONENT_TRIGGERED_BY(trigger_input, port))
var/datum/signal/signal = new(list("code" = round(code.input_value) || 0, "key" = parent?.owner_id))
var/datum/signal/signal = new(list("code" = round(code.value) || 0, "key" = parent?.owner_id))
radio_connection.post_signal(src, signal)
/obj/item/circuit_component/radio/receive_signal(datum/signal/signal)
. = FALSE
if(!signal)
return
if(signal.data["code"] != round(code.input_value || 0))
if(signal.data["code"] != round(code.value || 0))
return
if(public_options.input_value == COMP_RADIO_PRIVATE && parent?.owner_id != signal.data["key"])
if(public_options.value == COMP_RADIO_PRIVATE && parent?.owner_id != signal.data["key"])
return
trigger_output.set_output(COMPONENT_SIGNAL)
@@ -49,18 +49,18 @@
/obj/item/circuit_component/soundemitter/input_received(datum/port/input/port)
. = ..()
volume.set_input(clamp(volume.input_value, 0, 100), FALSE)
frequency.set_input(clamp(frequency.input_value, -100, 100), FALSE)
volume.set_input(clamp(volume.value, 0, 100))
frequency.set_input(clamp(frequency.value, -100, 100))
if(.)
return
if(TIMER_COOLDOWN_CHECK(parent, COOLDOWN_CIRCUIT_SOUNDEMITTER))
return
var/sound_to_play = options_map[sound_file.input_value]
var/sound_to_play = options_map[sound_file.value]
if(!sound_to_play)
return
playsound(src, sound_to_play, volume.input_value, frequency != 0, frequency = frequency.input_value)
playsound(src, sound_to_play, volume.value, frequency != 0, frequency = frequency.value)
TIMER_COOLDOWN_START(parent, COOLDOWN_CIRCUIT_SOUNDEMITTER, sound_cooldown)
@@ -30,11 +30,11 @@
if(TIMER_COOLDOWN_CHECK(parent, COOLDOWN_CIRCUIT_SPEECH))
return
if(message.input_value)
if(message.value)
var/atom/movable/shell = parent.shell
// Prevents appear as the individual component if there is a shell.
if(shell)
shell.say(message.input_value)
shell.say(message.value)
else
say(message.input_value)
say(message.value)
TIMER_COOLDOWN_START(parent, COOLDOWN_CIRCUIT_SPEECH, speech_cooldown)