mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #12907 from foopwo/smileyouareoncamera
Integrated circuit camera can now use different networks, plus modular computer camera access change
This commit is contained in:
@@ -263,15 +263,28 @@
|
||||
/obj/item/integrated_circuit/output/video_camera
|
||||
name = "video camera circuit"
|
||||
desc = "This small camera allows a remote viewer to see what it sees."
|
||||
extended_desc = "The camera is linked to the Research camera network."
|
||||
var/list/networks = list(
|
||||
"research" = NETWORK_CIRCUITS,
|
||||
"engine" = NETWORK_ENGINE,
|
||||
"engineering" = NETWORK_ENGINEERING,
|
||||
"mining" = NETWORK_MINE,
|
||||
"medical" = NETWORK_MEDICAL,
|
||||
"entertainment" = NETWORK_THUNDER,
|
||||
"security" = NETWORK_SECURITY,
|
||||
"command" = NETWORK_COMMAND
|
||||
)
|
||||
icon_state = "video_camera"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
complexity = 10
|
||||
inputs = list(
|
||||
"camera name" = IC_PINTYPE_STRING,
|
||||
"camera network" = IC_PINTYPE_STRING,
|
||||
"camera active" = IC_PINTYPE_BOOLEAN
|
||||
)
|
||||
inputs_default = list("1" = "video camera circuit")
|
||||
inputs_default = list(
|
||||
"1" = "video camera circuit",
|
||||
"2" = "research"
|
||||
)
|
||||
outputs = list()
|
||||
activators = list()
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
@@ -280,6 +293,11 @@
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/New()
|
||||
..()
|
||||
extended_desc = list()
|
||||
extended_desc += "Network choices are; "
|
||||
extended_desc += jointext(networks, ", ")
|
||||
extended_desc += "."
|
||||
extended_desc = jointext(extended_desc, null)
|
||||
camera = new(src)
|
||||
on_data_written()
|
||||
|
||||
@@ -298,10 +316,20 @@
|
||||
/obj/item/integrated_circuit/output/video_camera/on_data_written()
|
||||
if(camera)
|
||||
var/cam_name = get_pin_data(IC_INPUT, 1)
|
||||
var/cam_active = get_pin_data(IC_INPUT, 2)
|
||||
var/cam_network = get_pin_data(IC_INPUT, 2)
|
||||
var/cam_active = get_pin_data(IC_INPUT, 3)
|
||||
if(!isnull(cam_name))
|
||||
camera.c_tag = cam_name
|
||||
camera.replace_networks(list(cam_network))
|
||||
set_camera_status(cam_active)
|
||||
if(isnull(cam_network))
|
||||
camera.clear_all_networks()
|
||||
return
|
||||
var/selected_network = networks[cam_network]
|
||||
if(!selected_network)
|
||||
camera.clear_all_networks()
|
||||
return
|
||||
camera.replace_networks(list(selected_network))
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/power_fail()
|
||||
if(camera)
|
||||
|
||||
Reference in New Issue
Block a user