mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
[MIRROR] Circuits constants chips now keep their data on save/load (#6012)
* Circuits constants chips now keep their data on save/load * Fixes constants chips (#36315)
This commit is contained in:
committed by
Poojawa
parent
dac99faf65
commit
fd63838558
@@ -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.
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user