mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Largely ported from the work done at Baystation in https://github.com/Baystation12/Baystation12/pull/17460 and later commits. - Shuttles no longer require a separate area for each location they jump to. Instead destinations are indicated by landmark objects, which are not necessarily exclusive to that shuttle. This means that more than one shuttle could use the same docking port (not at the same time of course). - Enhanced shuttle control computers to use nanoui if they didn't. - Organizes shuttle datum code a bit better so there is less re-inventing the wheel in subtypes. - Allows the possibility of shuttles (or destinations) that start on late-loaded maps. - Deprecate the "extra" shuttle areas that are no longer needed and update shuttle areas in unit tests This all required a bit of infrastructure improvements. - ChangeArea proc, for changing the area of a turf. - Fixed lighting overlays actually being able to be destroyed. - Added a few utility macros and procs. - Added "turf translation" procs which are like move_contents_to but more flexible.
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
// Provides remote access to a controller (since they must be unique).
|
|
/obj/machinery/dummy_airlock_controller
|
|
name = "airlock control terminal"
|
|
icon = 'icons/obj/airlock_machines.dmi'
|
|
icon_state = "airlock_control_standby"
|
|
layer = ABOVE_OBJ_LAYER
|
|
var/id_tag
|
|
|
|
var/datum/topic_state/remote/remote_state
|
|
var/obj/machinery/embedded_controller/radio/airlock/master_controller
|
|
|
|
/obj/machinery/dummy_airlock_controller/process()
|
|
if(master_controller)
|
|
appearance = master_controller
|
|
. = ..()
|
|
|
|
/obj/machinery/dummy_airlock_controller/Initialize()
|
|
. = ..()
|
|
if(id_tag)
|
|
for(var/obj/machinery/embedded_controller/radio/airlock/_master in SSmachines.machinery)
|
|
if(_master.id_tag == id_tag)
|
|
master_controller = _master
|
|
master_controller.dummy_terminals += src
|
|
break
|
|
if(!master_controller)
|
|
qdel(src)
|
|
else
|
|
remote_state = new /datum/topic_state/remote(src, master_controller)
|
|
|
|
/obj/machinery/dummy_airlock_controller/Destroy()
|
|
if(master_controller)
|
|
master_controller.dummy_terminals -= src
|
|
if(remote_state)
|
|
qdel(remote_state)
|
|
remote_state = null
|
|
return ..()
|
|
|
|
/obj/machinery/dummy_airlock_controller/interface_interact(var/mob/user)
|
|
open_remote_ui(user)
|
|
return TRUE
|
|
|
|
/obj/machinery/dummy_airlock_controller/proc/open_remote_ui(var/mob/user)
|
|
if(master_controller)
|
|
appearance = master_controller
|
|
return master_controller.ui_interact(user, state = remote_state)
|
|
|
|
/obj/machinery/dummy_airlock_controller/powered(var/chan = -1, var/area/check_area = null)
|
|
if(master_controller)
|
|
var/area/A = get_area(master_controller)
|
|
return master_controller.powered(chan, A)
|
|
return ..()
|