Files
Bubberstation/code/modules/admin/verbs/shuttlepanel.dm
John Willard 253613c1c3 [MDB IGNORE] Shuttle engine code improvement and fixes (#69516)
* A lot of shuttle code improvements

* Makes use of ``as anything`` in many places
* Adds mapload to connect_to_shuttle()
* Renames many vars, including shuttle 'id' var to 'shuttle_id' and engine 'state' to 'engine_state'.
* Engines now weakref their attached ship, and disconnect when unwrenched from it.
* Removes check for force when deleting a mobile docking port, being deleted should still clear your stuff, regardless of being forced.

Because of all the above, I was able to remove a few pointless checks scattered around, like engine's alter_engine_power()

* better comment for port_id

* Fixes Cargo, Arrivals, and Pirate ships.

* Merge branch 'master' into shuttlecode-oh-no

* last few

* fixes the CI

* fixes

* Fixes infinite engines

* Revert "Merge branch 'master' into shuttlecode-oh-no"

This reverts commit 94eba37de9fe3f4a01dc40bb064771b764f379e3.

* trammies

* whiteship tram

* Makes use of ?. instead

apparently this is what weakrefs use, so 🤷

* i hate supernovaa41

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>

* removes lateinit that I never implemented

* adds _ref to weakref var name

* small change to weld time define

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
2022-09-07 11:43:54 -04:00

77 lines
2.3 KiB
Plaintext

/datum/admins/proc/open_shuttlepanel()
set category = "Admin.Events"
set name = "Shuttle Manipulator"
set desc = "Opens the shuttle manipulator UI."
if(!check_rights(R_ADMIN))
return
SSshuttle.ui_interact(usr)
/obj/docking_port/mobile/proc/admin_fly_shuttle(mob/user)
var/list/options = list()
for(var/port in SSshuttle.stationary_docking_ports)
if (istype(port, /obj/docking_port/stationary/transit))
continue // please don't do this
var/obj/docking_port/stationary/S = port
if (canDock(S) == SHUTTLE_CAN_DOCK)
options[S.name || S.shuttle_id] = S
options += "--------"
options += "Infinite Transit"
options += "Delete Shuttle"
options += "Into The Sunset (delete & greentext 'escape')"
var/selection = tgui_input_list(user, "Select where to fly [name || shuttle_id]:", "Fly Shuttle", options)
if(isnull(selection))
return
switch(selection)
if("Infinite Transit")
destination = null
mode = SHUTTLE_IGNITING
setTimer(ignitionTime)
if("Delete Shuttle")
if(tgui_alert(user, "Really delete [name || shuttle_id]?", "Delete Shuttle", list("Cancel", "Really!")) != "Really!")
return
jumpToNullSpace()
if("Into The Sunset (delete & greentext 'escape')")
if(tgui_alert(user, "Really delete [name || shuttle_id] and greentext escape objectives?", "Delete Shuttle", list("Cancel", "Really!")) != "Really!")
return
intoTheSunset()
else
if(options[selection])
request(options[selection])
/obj/docking_port/mobile/emergency/admin_fly_shuttle(mob/user)
return // use the existing verbs for this
/obj/docking_port/mobile/arrivals/admin_fly_shuttle(mob/user)
switch(tgui_alert(user, "Would you like to fly the arrivals shuttle once or change its destination?", "Fly Shuttle", list("Fly", "Retarget", "Cancel")))
if("Cancel")
return
if("Fly")
return ..()
var/list/options = list()
for(var/port in SSshuttle.stationary_docking_ports)
if (istype(port, /obj/docking_port/stationary/transit))
continue // please don't do this
var/obj/docking_port/stationary/S = port
if (canDock(S) == SHUTTLE_CAN_DOCK)
options[S.name || S.shuttle_id] = S
var/selection = tgui_input_list(user, "New arrivals destination", "Fly Shuttle", options)
if(isnull(selection))
return
target_dock = options[selection]
if(!QDELETED(target_dock))
destination = target_dock