mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Rewrite examine() to pass a list around
This commit is contained in:
@@ -172,13 +172,10 @@
|
||||
return id_card
|
||||
|
||||
/obj/item/device/electronic_assembly/examine(mob/user)
|
||||
. = ..(user, 1)
|
||||
if(.)
|
||||
. = ..()
|
||||
if(Adjacent(user))
|
||||
for(var/obj/item/integrated_circuit/IC in contents)
|
||||
IC.external_examine(user)
|
||||
// for(var/obj/item/integrated_circuit/output/screen/S in contents)
|
||||
// if(S.stuff_to_display)
|
||||
// to_chat(user, "There's a little screen labeled '[S.name]', which displays '[S.stuff_to_display]'.")
|
||||
. += IC.external_examine(user)
|
||||
if(opened)
|
||||
interact(user)
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
..()
|
||||
|
||||
/obj/item/clothing/examine(mob/user)
|
||||
. = ..()
|
||||
if(IC)
|
||||
IC.examine(user)
|
||||
..()
|
||||
. += IC.examine(user)
|
||||
|
||||
/obj/item/clothing/CtrlShiftClick(mob/user)
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
return
|
||||
|
||||
/obj/item/device/assembly/electronic_assembly/examine(mob/user)
|
||||
.=..(user, 1)
|
||||
. = ..()
|
||||
if(EA)
|
||||
for(var/obj/item/integrated_circuit/IC in EA.contents)
|
||||
IC.external_examine(user)
|
||||
. += IC.external_examine(user)
|
||||
|
||||
/obj/item/device/assembly/electronic_assembly/verb/toggle()
|
||||
set src in usr
|
||||
|
||||
@@ -4,28 +4,29 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
*/
|
||||
|
||||
/obj/item/integrated_circuit/examine(mob/user)
|
||||
interact(user)
|
||||
external_examine(user)
|
||||
. = ..()
|
||||
. += external_examine(user)
|
||||
interact(user)
|
||||
|
||||
// This should be used when someone is examining while the case is opened.
|
||||
/obj/item/integrated_circuit/proc/internal_examine(mob/user)
|
||||
to_chat(user, "This board has [inputs.len] input pin\s, [outputs.len] output pin\s and [activators.len] activation pin\s.")
|
||||
. = list()
|
||||
. += "This board has [inputs.len] input pin\s, [outputs.len] output pin\s and [activators.len] activation pin\s."
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
if(I.linked.len)
|
||||
to_chat(user, "The '[I]' is connected to [I.get_linked_to_desc()].")
|
||||
. += "The '[I]' is connected to [I.get_linked_to_desc()]."
|
||||
for(var/datum/integrated_io/O in outputs)
|
||||
if(O.linked.len)
|
||||
to_chat(user, "The '[O]' is connected to [O.get_linked_to_desc()].")
|
||||
. += "The '[O]' is connected to [O.get_linked_to_desc()]."
|
||||
for(var/datum/integrated_io/activate/A in activators)
|
||||
if(A.linked.len)
|
||||
to_chat(user, "The '[A]' is connected to [A.get_linked_to_desc()].")
|
||||
any_examine(user)
|
||||
. += "The '[A]' is connected to [A.get_linked_to_desc()]."
|
||||
. += any_examine(user)
|
||||
interact(user)
|
||||
|
||||
// This should be used when someone is examining from an 'outside' perspective, e.g. reading a screen or LED.
|
||||
/obj/item/integrated_circuit/proc/external_examine(mob/user)
|
||||
any_examine(user)
|
||||
return any_examine(user)
|
||||
|
||||
/obj/item/integrated_circuit/proc/any_examine(mob/user)
|
||||
return
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
..()
|
||||
|
||||
/obj/item/integrated_circuit/memory/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
var/i
|
||||
for(i = 1, i <= outputs.len, i++)
|
||||
var/datum/integrated_io/O = outputs[i]
|
||||
@@ -30,7 +30,7 @@
|
||||
data = "[d]"
|
||||
else if(!isnull(O.data))
|
||||
data = O.data
|
||||
to_chat(user, "\The [src] has [data] saved to address [i].")
|
||||
. += "\The [src] has [data] saved to address [i]."
|
||||
|
||||
/obj/item/integrated_circuit/memory/do_work()
|
||||
for(var/i = 1 to inputs.len)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
stuff_to_display = null
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/any_examine(mob/user)
|
||||
to_chat(user, "There is a little screen labeled '[name]', which displays [!isnull(stuff_to_display) ? "'[stuff_to_display]'" : "nothing"].")
|
||||
return "There is a little screen labeled '[name]', which displays [!isnull(stuff_to_display) ? "'[stuff_to_display]'" : "nothing"]."
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/do_work()
|
||||
var/datum/integrated_io/I = inputs[1]
|
||||
@@ -333,7 +333,7 @@
|
||||
else
|
||||
text_output += "\an ["\improper[initial_name]"] labeled '[name]'"
|
||||
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]>¤</font>" : "unlit."]"
|
||||
to_chat(user,jointext(text_output,null))
|
||||
return jointext(text_output,null)
|
||||
|
||||
/obj/item/integrated_circuit/output/led/red
|
||||
name = "red LED"
|
||||
|
||||
Reference in New Issue
Block a user