mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +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
|
/obj/item/integrated_circuit/output/video_camera
|
||||||
name = "video camera circuit"
|
name = "video camera circuit"
|
||||||
desc = "This small camera allows a remote viewer to see what it sees."
|
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"
|
icon_state = "video_camera"
|
||||||
w_class = ITEMSIZE_SMALL
|
w_class = ITEMSIZE_SMALL
|
||||||
complexity = 10
|
complexity = 10
|
||||||
inputs = list(
|
inputs = list(
|
||||||
"camera name" = IC_PINTYPE_STRING,
|
"camera name" = IC_PINTYPE_STRING,
|
||||||
|
"camera network" = IC_PINTYPE_STRING,
|
||||||
"camera active" = IC_PINTYPE_BOOLEAN
|
"camera active" = IC_PINTYPE_BOOLEAN
|
||||||
)
|
)
|
||||||
inputs_default = list("1" = "video camera circuit")
|
inputs_default = list(
|
||||||
|
"1" = "video camera circuit",
|
||||||
|
"2" = "research"
|
||||||
|
)
|
||||||
outputs = list()
|
outputs = list()
|
||||||
activators = list()
|
activators = list()
|
||||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||||
@@ -280,6 +293,11 @@
|
|||||||
|
|
||||||
/obj/item/integrated_circuit/output/video_camera/New()
|
/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)
|
camera = new(src)
|
||||||
on_data_written()
|
on_data_written()
|
||||||
|
|
||||||
@@ -298,10 +316,20 @@
|
|||||||
/obj/item/integrated_circuit/output/video_camera/on_data_written()
|
/obj/item/integrated_circuit/output/video_camera/on_data_written()
|
||||||
if(camera)
|
if(camera)
|
||||||
var/cam_name = get_pin_data(IC_INPUT, 1)
|
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))
|
if(!isnull(cam_name))
|
||||||
camera.c_tag = cam_name
|
camera.c_tag = cam_name
|
||||||
|
camera.replace_networks(list(cam_network))
|
||||||
set_camera_status(cam_active)
|
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()
|
/obj/item/integrated_circuit/output/video_camera/power_fail()
|
||||||
if(camera)
|
if(camera)
|
||||||
|
|||||||
@@ -9,10 +9,12 @@
|
|||||||
switch(network)
|
switch(network)
|
||||||
if(NETWORK_THUNDER)
|
if(NETWORK_THUNDER)
|
||||||
return 0
|
return 0
|
||||||
if(NETWORK_ENGINE,NETWORK_ALARM_ATMOS,NETWORK_ALARM_FIRE,NETWORK_ALARM_POWER)
|
if(NETWORK_ENGINE,NETWORK_ENGINEERING,NETWORK_ALARM_ATMOS,NETWORK_ALARM_FIRE,NETWORK_ALARM_POWER)
|
||||||
return access_engine
|
return access_engine
|
||||||
if(NETWORK_CIRCUITS)
|
if(NETWORK_CIRCUITS)
|
||||||
return access_research
|
return access_research
|
||||||
|
if(NETWORK_MINE)
|
||||||
|
return access_qm
|
||||||
if(NETWORK_ERT)
|
if(NETWORK_ERT)
|
||||||
return access_cent_specops
|
return access_cent_specops
|
||||||
//VOREStation Add Start
|
//VOREStation Add Start
|
||||||
|
|||||||
Reference in New Issue
Block a user