From cfe665842eeb15ab05ccd0969556c789403e1a88 Mon Sep 17 00:00:00 2001 From: TDSSS <32099540+TDSSS@users.noreply.github.com> Date: Tue, 11 Aug 2020 20:32:19 +0200 Subject: [PATCH] WIP --- code/modules/mining/laborcamp/laborshuttle.dm | 2 +- code/modules/shuttle/ert.dm | 4 +- code/modules/shuttle/shuttle.dm | 6 +- code/modules/shuttle/syndicate.dm | 2 +- .../tgui/interfaces/ShuttleConsole.js | 72 +++++++++++++++++++ .../tgui/interfaces/shuttle_console.js | 0 tgui/packages/tgui/public/tgui.bundle.js | 4 +- 7 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/ShuttleConsole.js delete mode 100644 tgui/packages/tgui/interfaces/shuttle_console.js diff --git a/code/modules/mining/laborcamp/laborshuttle.dm b/code/modules/mining/laborcamp/laborshuttle.dm index 8e585eb15b0..26ffc7b352e 100644 --- a/code/modules/mining/laborcamp/laborshuttle.dm +++ b/code/modules/mining/laborcamp/laborshuttle.dm @@ -14,7 +14,7 @@ circuit = /obj/item/circuitboard/labor_shuttle/one_way req_access = list( ) -/obj/machinery/computer/shuttle/labor/one_way/Topic(href, href_list) +/obj/machinery/computer/shuttle/labor/one_way/Topic(href, href_list) //TODO make those work, too if(href_list["move"]) var/obj/docking_port/mobile/M = SSshuttle.getShuttle("laborcamp") if(!M) diff --git a/code/modules/shuttle/ert.dm b/code/modules/shuttle/ert.dm index 356ca9687dc..4340a9e2f96 100644 --- a/code/modules/shuttle/ert.dm +++ b/code/modules/shuttle/ert.dm @@ -6,13 +6,13 @@ resistance_flags = INDESTRUCTIBLE flags = NODECONSTRUCT -/obj/machinery/computer/shuttle/ert/Topic(href, href_list) +/obj/machinery/computer/shuttle/ert/Topic(href, href_list) //TODO convert this, too if(href_list["move"]) var/authorized_roles = list(SPECIAL_ROLE_ERT, SPECIAL_ROLE_DEATHSQUAD) if(!((usr.mind.assigned_role in authorized_roles) || is_admin(usr))) message_admins("Potential ERT shuttle hijack, ERT shuttle moved by unauthorized user: [key_name_admin(usr)]") ..() - + /obj/machinery/computer/camera_advanced/shuttle_docker/ert name = "specops navigation computer" diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 8ddbf3c88ea..9ec2375d548 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -773,13 +773,13 @@ return connect() add_fingerprint(user) - ui_interact(user) + tgui_interact(user) //note to self, new stuff. Also TODO: remove dumb comments once you know how tgui works, ya dork /obj/machinery/computer/shuttle/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) - ui = new(user, src, ui_key, "shuttle_console.js", name, 300, 300, master_ui, state) + ui = new(user, src, ui_key, "ShuttleConsole", name, 300, 300, master_ui, state) ui.open() /obj/machinery/computer/shuttle/tgui_data(mob/user) @@ -823,7 +823,7 @@ to_chat(usr, "Invalid shuttle requested.") else to_chat(usr, "Unable to comply.") - return 1 + return TRUE diff --git a/code/modules/shuttle/syndicate.dm b/code/modules/shuttle/syndicate.dm index f9ec738b167..6197f3c10f6 100644 --- a/code/modules/shuttle/syndicate.dm +++ b/code/modules/shuttle/syndicate.dm @@ -18,7 +18,7 @@ circuit = /obj/item/circuitboard/shuttle/syndicate/recall possible_destinations = "syndicate_away" -/obj/machinery/computer/shuttle/syndicate/Topic(href, href_list) +/obj/machinery/computer/shuttle/syndicate/Topic(href, href_list) // TODO convert this too if(href_list["move"]) if(challenge && world.time < SYNDICATE_CHALLENGE_TIMER) to_chat(usr, "You've issued a combat challenge to the station! You've got to give them at least [round(((SYNDICATE_CHALLENGE_TIMER - world.time) / 10) / 60)] more minutes to allow them to prepare.") diff --git a/tgui/packages/tgui/interfaces/ShuttleConsole.js b/tgui/packages/tgui/interfaces/ShuttleConsole.js new file mode 100644 index 00000000000..793442e6040 --- /dev/null +++ b/tgui/packages/tgui/interfaces/ShuttleConsole.js @@ -0,0 +1,72 @@ +import { useBackend } from '../backend'; +import { Button, LabeledList, Box, Section } from '../components'; +import { Window } from '../layouts'; +import { LabeledListItem } from '../components/LabeledList'; + +export const ShuttleConsole = (props, context) => { + const { act, data } = useBackend(context); + // get stuff + return ( + + + + + {data.status ? ( + data.status + ) : ( + + *MISSING* + + )} + + + {!!data.shuttle && (// only show this stuff if there's a shuttle + <> + {!!data.docking_ports_len && ( + // I am not sure if I am nesting this stuff right... + <> + {data.docking_ports.map(port => ( +