|
15 | 15 | var/list/concurrent_users = list()
|
16 | 16 |
|
17 | 17 | // Stuff needed to render the map
|
18 |
| - var/atom/movable/screen/map_view/cam_screen |
19 |
| - /// All the plane masters that need to be applied. |
20 |
| - var/atom/movable/screen/background/cam_background |
| 18 | + var/atom/movable/screen/map_view/camera/cam_screen |
21 | 19 |
|
22 | 20 | interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_REQUIRES_SIGHT
|
23 | 21 |
|
|
34 | 32 | // Initialize map objects
|
35 | 33 | cam_screen = new
|
36 | 34 | cam_screen.generate_view(map_name)
|
37 |
| - cam_background = new |
38 |
| - cam_background.assigned_map = map_name |
39 |
| - cam_background.del_on_map_removal = FALSE |
40 | 35 |
|
41 | 36 | /obj/machinery/computer/security/Destroy()
|
42 | 37 | QDEL_NULL(cam_screen)
|
43 |
| - QDEL_NULL(cam_background) |
44 | 38 | return ..()
|
45 | 39 |
|
46 | 40 | /obj/machinery/computer/security/connect_to_shuttle(mapload, obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
|
|
67 | 61 | if(length(concurrent_users) == 1 && is_living)
|
68 | 62 | playsound(src, 'sound/machines/terminal_on.ogg', 25, FALSE)
|
69 | 63 | use_power(active_power_usage)
|
70 |
| - // Register map objects |
71 |
| - cam_screen.display_to(user) |
72 |
| - user.client.register_map_obj(cam_background) |
73 | 64 | // Open UI
|
74 | 65 | ui = new(user, src, "CameraConsole", name)
|
75 | 66 | ui.open()
|
| 67 | + // Register map objects |
| 68 | + cam_screen.display_to(user, ui.window) |
76 | 69 |
|
77 | 70 | /obj/machinery/computer/security/ui_status(mob/user)
|
78 | 71 | . = ..()
|
|
126 | 119 | /obj/machinery/computer/security/proc/update_active_camera_screen()
|
127 | 120 | // Show static if can't use the camera
|
128 | 121 | if(!active_camera?.can_use())
|
129 |
| - show_camera_static() |
| 122 | + cam_screen.show_camera_static() |
130 | 123 | return
|
131 | 124 |
|
132 | 125 | var/list/visible_turfs = list()
|
|
154 | 147 | var/size_x = bbox[3] - bbox[1] + 1
|
155 | 148 | var/size_y = bbox[4] - bbox[2] + 1
|
156 | 149 |
|
157 |
| - cam_screen.vis_contents = visible_turfs |
158 |
| - cam_background.icon_state = "clear" |
159 |
| - cam_background.fill_rect(1, 1, size_x, size_y) |
| 150 | + cam_screen.show_camera(visible_turfs, size_x, size_y) |
160 | 151 |
|
161 | 152 | /obj/machinery/computer/security/ui_close(mob/user)
|
162 | 153 | . = ..()
|
|
173 | 164 | playsound(src, 'sound/machines/terminal_off.ogg', 25, FALSE)
|
174 | 165 | use_power(0)
|
175 | 166 |
|
176 |
| -/obj/machinery/computer/security/proc/show_camera_static() |
177 |
| - cam_screen.vis_contents.Cut() |
| 167 | +/atom/movable/screen/map_view/camera |
| 168 | + /// All the plane masters that need to be applied. |
| 169 | + var/atom/movable/screen/background/cam_background |
| 170 | + |
| 171 | +/atom/movable/screen/map_view/camera/Destroy() |
| 172 | + QDEL_NULL(cam_background) |
| 173 | + return ..() |
| 174 | + |
| 175 | +/atom/movable/screen/map_view/camera/generate_view(map_key) |
| 176 | + . = ..() |
| 177 | + cam_background = new |
| 178 | + cam_background.del_on_map_removal = FALSE |
| 179 | + cam_background.assigned_map = assigned_map |
| 180 | + |
| 181 | +/atom/movable/screen/map_view/camera/display_to_client(client/show_to) |
| 182 | + show_to.register_map_obj(cam_background) |
| 183 | + . = ..() |
| 184 | + |
| 185 | +/atom/movable/screen/map_view/camera/proc/show_camera(list/visible_turfs, size_x, size_y) |
| 186 | + vis_contents = visible_turfs |
| 187 | + cam_background.icon_state = "clear" |
| 188 | + cam_background.fill_rect(1, 1, size_x, size_y) |
| 189 | + |
| 190 | +/atom/movable/screen/map_view/camera/proc/show_camera_static() |
| 191 | + vis_contents.Cut() |
178 | 192 | cam_background.icon_state = "scanline2"
|
179 | 193 | cam_background.fill_rect(1, 1, DEFAULT_MAP_SIZE, DEFAULT_MAP_SIZE)
|
180 | 194 |
|
181 | 195 | // SECURITY MONITORS
|
182 |
| - |
183 | 196 | /obj/machinery/computer/security/wooden_tv
|
184 | 197 | name = "security camera monitor"
|
185 | 198 | desc = "An old TV hooked into the station's camera network."
|
|
0 commit comments