diff --git a/code/modules/integrated_electronics/core/saved_circuits.dm b/code/modules/integrated_electronics/core/saved_circuits.dm index 8833f6872f..e0395d6ede 100644 --- a/code/modules/integrated_electronics/core/saved_circuits.dm +++ b/code/modules/integrated_electronics/core/saved_circuits.dm @@ -3,6 +3,7 @@ // Saves type, modified name and modified inputs (if any) to a list // The list is converted to JSON down the line. +//"Special" is not verified at any point except for by the circuit itself. /obj/item/integrated_circuit/proc/save() var/list/component_params = list() var/init_name = initial(name) @@ -38,8 +39,14 @@ if(saved_inputs.len) component_params["inputs"] = saved_inputs + var/special = save_special() + if(special) + component_params["special"] = special + return component_params +/obj/item/integrated_circuit/proc/save_special() + return // Verifies a list of component parameters // Returns null on success, error name on failure @@ -100,7 +107,11 @@ pin.write_data_to_pin(input_value) // TODO: support for special input types, such as internal refs and maybe typepaths + if(component_params["special"]) + load_special(component_params["special"]) +/obj/item/integrated_circuit/proc/load_special(special_data) + return // Saves type and modified name (if any) to a list // The list is converted to JSON down the line. diff --git a/code/modules/integrated_electronics/subtypes/memory.dm b/code/modules/integrated_electronics/subtypes/memory.dm index 8d187a4b2a..0531dda533 100644 --- a/code/modules/integrated_electronics/subtypes/memory.dm +++ b/code/modules/integrated_electronics/subtypes/memory.dm @@ -84,6 +84,16 @@ var/datum/integrated_io/O = outputs[1] O.push_data() +/obj/item/integrated_circuit/memory/constant/save_special() + var/datum/integrated_io/O = outputs[1] + if(istext(O.data) || isnum(O.data)) + return O.data + +/obj/item/integrated_circuit/memory/constant/load_special(special_data) + var/datum/integrated_io/O = outputs[1] + if(istext(special_data) || isnum(special_data)) + O.data = special_data + /obj/item/integrated_circuit/memory/constant/attack_self(mob/user) var/datum/integrated_io/O = outputs[1] if(!user.IsAdvancedToolUser())