This commit is contained in:
SinTwo
2016-08-15 10:33:53 -04:00
parent 288768b903
commit 8a5e045921

View File

@@ -14,17 +14,17 @@
var/cache_id = 0 var/cache_id = 0
circuit = /obj/item/weapon/circuitboard/security circuit = /obj/item/weapon/circuitboard/security
New() /obj/machinery/computer/security/New()
if(!network) if(!network)
network = station_networks.Copy() network = station_networks.Copy()
..() ..()
if(network.len) if(network.len)
current_network = network[1] current_network = network[1]
attack_ai(var/mob/user as mob) /obj/machinery/computer/security/attack_ai(var/mob/user as mob)
return attack_hand(user) return attack_hand(user)
check_eye(var/mob/user as mob) /obj/machinery/computer/security/check_eye(var/mob/user as mob)
if (user.stat || ((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded) && !istype(user, /mob/living/silicon))) //user can't see - not sure why canmove is here. if (user.stat || ((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded) && !istype(user, /mob/living/silicon))) //user can't see - not sure why canmove is here.
return -1 return -1
if(!current_camera) if(!current_camera)
@@ -34,7 +34,7 @@
reset_current() reset_current()
return viewflag return viewflag
ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) /obj/machinery/computer/security/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1)
if(src.z > 6) return if(src.z > 6) return
if(stat & (NOPOWER|BROKEN)) return if(stat & (NOPOWER|BROKEN)) return
if(user.stat) return if(user.stat) return
@@ -46,6 +46,8 @@
data["networks"] = network ? network : list() data["networks"] = network ? network : list()
if(current_network) if(current_network)
data["cameras"] = camera_repository.cameras_in_network(current_network) data["cameras"] = camera_repository.cameras_in_network(current_network)
if(current_camera)
switch_to_camera(user, current_camera)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui) if (!ui)
@@ -59,7 +61,7 @@
ui.set_initial_data(data) ui.set_initial_data(data)
ui.open() ui.open()
Topic(href, href_list) /obj/machinery/computer/security/Topic(href, href_list)
if(..()) if(..())
return 1 return 1
if(href_list["switch_camera"]) if(href_list["switch_camera"])
@@ -88,7 +90,7 @@
else else
. = ..() . = ..()
attack_hand(var/mob/user as mob) /obj/machinery/computer/security/attack_hand(var/mob/user as mob)
if (src.z > 6) if (src.z > 6)
user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!" user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
return return
@@ -98,7 +100,7 @@
user.set_machine(src) user.set_machine(src)
ui_interact(user) ui_interact(user)
proc/switch_to_camera(var/mob/user, var/obj/machinery/camera/C) /obj/machinery/computer/security/proc/switch_to_camera(var/mob/user, var/obj/machinery/camera/C)
//don't need to check if the camera works for AI because the AI jumps to the camera location and doesn't actually look through cameras. //don't need to check if the camera works for AI because the AI jumps to the camera location and doesn't actually look through cameras.
if(isAI(user)) if(isAI(user))
var/mob/living/silicon/ai/A = user var/mob/living/silicon/ai/A = user
@@ -118,7 +120,7 @@
return 1 return 1
//Camera control: moving. //Camera control: moving.
proc/jump_on_click(var/mob/user,var/A) /obj/machinery/computer/security/proc/jump_on_click(var/mob/user,var/A)
if(user.machine != src) if(user.machine != src)
return return
var/obj/machinery/camera/jump_to var/obj/machinery/camera/jump_to