From d7e7202403fb671161171d3168652a6bddbbcbed Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Sun, 15 Oct 2023 21:22:02 +0200 Subject: [PATCH 1/2] Revert "changed flyby tgui (#4600)" This reverts commit 9b31e08332cab8e9d68a5d07b2344814b07feb79. --- code/__DEFINES/shuttles.dm | 1 - .../shuttle/computers/dropship_computer.dm | 32 +++++++------------ .../tgui/interfaces/DropshipFlightControl.tsx | 9 +++++- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/code/__DEFINES/shuttles.dm b/code/__DEFINES/shuttles.dm index e650ebacb8e3..d283656ccae6 100644 --- a/code/__DEFINES/shuttles.dm +++ b/code/__DEFINES/shuttles.dm @@ -115,7 +115,6 @@ #define ALMAYER_DROPSHIP_LZ1 "almayer-hangar-lz1" #define ALMAYER_DROPSHIP_LZ2 "almayer-hangar-lz2" -#define DROPSHIP_FLYBY_ID "special_flight" #define DROPSHIP_LZ1 "dropship-lz1" #define DROPSHIP_LZ2 "dropship-lz2" diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index 15b6a6ca6e87..954c91d9ca54 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -320,22 +320,13 @@ .["primary_lz"] = SSticker.mode.active_lz?.linked_lz if(shuttle.destination) .["target_destination"] = shuttle.in_flyby? "Flyby" : shuttle.destination.name + .["destinations"] = list() .["door_status"] = is_remote ? list() : shuttle.get_door_data() + .["flight_configuration"] = is_set_flyby ? "flyby" : "ferry" .["has_flyby_skill"] = skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT) - .["destinations"] = list() - // add flight - .["destinations"] += list( - list( - "id" = DROPSHIP_FLYBY_ID, - "name" = "Flyby", - "available" = TRUE, - "error" = FALSE - ) - ) - for(var/obj/docking_port/stationary/dock in compatible_landing_zones) var/dock_reserved = FALSE for(var/obj/docking_port/mobile/other_shuttle in SSshuttle.mobile) @@ -371,16 +362,15 @@ to_chat(usr, SPAN_WARNING("You can't move to a new destination right now.")) return TRUE + if(is_set_flyby && !skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT)) + to_chat(user, SPAN_WARNING("You don't have the skill to perform a flyby.")) + return FALSE var/is_optimised = FALSE // automatically apply optimisation if user is a pilot if(skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT)) is_optimised = TRUE update_equipment(is_optimised) - var/dock_id = params["target"] - if(dock_id == DROPSHIP_FLYBY_ID) - if(!skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT)) - to_chat(user, SPAN_WARNING("You don't have the skill to perform a flyby.")) - return FALSE + if(is_set_flyby) to_chat(user, SPAN_NOTICE("You begin the launch sequence for a flyby.")) link.log_ares_flight(user.name, "Launched Dropship [shuttle.name] on a flyby.") var/log = "[key_name(user)] launched the dropship [src.shuttleId] on flyby." @@ -388,19 +378,19 @@ log_interact(user, msg = "[log]") shuttle.send_for_flyby() return TRUE - + var/dockId = params["target"] var/list/local_data = ui_data(user) var/found = FALSE playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1) for(var/destination in local_data["destinations"]) - if(destination["id"] == dock_id) + if(destination["id"] == dockId) found = TRUE break if(!found) - log_admin("[key_name(user)] may be attempting a href dock exploit on [src] with target location \"[dock_id]\"") - to_chat(user, SPAN_WARNING("The [dock_id] dock is not available at this time.")) + log_admin("[key_name(user)] may be attempting a href dock exploit on [src] with target location \"[dockId]\"") + to_chat(user, SPAN_WARNING("The [dockId] dock is not available at this time.")) return - var/obj/docking_port/stationary/dock = SSshuttle.getDock(dock_id) + var/obj/docking_port/stationary/dock = SSshuttle.getDock(dockId) var/dock_reserved = FALSE for(var/obj/docking_port/mobile/other_shuttle in SSshuttle.mobile) if(dock == other_shuttle.destination) diff --git a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx index 289bb53d777a..6943c96a79fa 100644 --- a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx +++ b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx @@ -317,7 +317,14 @@ const RenderScreen = (props, context) => { return ( <> {data.can_set_automated === 1 && } - {data.shuttle_mode === 'idle' && } + {data.can_fly_by === 1 && + (data.shuttle_mode === 'idle' || data.shuttle_mode === 'called') && ( + + )} + {data.shuttle_mode === 'idle' && + data.flight_configuration !== 'flyby' && ( + + )} {data.shuttle_mode === 'igniting' && } {data.shuttle_mode === 'pre-arrival' && } {data.shuttle_mode === 'recharging' && } From 96f32c2de0316a11000765959b82fe1b4ae59327 Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Sun, 15 Oct 2023 21:40:21 +0200 Subject: [PATCH 2/2] Update DropshipFlightControl.tsx --- .../tgui/interfaces/DropshipFlightControl.tsx | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx index 6943c96a79fa..06bbcdb773d7 100644 --- a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx +++ b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx @@ -129,6 +129,9 @@ export const DropshipDestinationSelection = (_, context) => { selected={siteselection} onClick={(value) => { setSiteSelection(value); + if (data.flight_configuration === 'flyby') { + act('set-ferry'); + } act('button-push'); }} /> @@ -190,27 +193,20 @@ const FlybyControl = (props, context) => { className="flybyControl" buttons={ <> - {data.flight_configuration === 'flyby' && ( - - )} - {data.has_flyby_skill === 1 && data.flight_configuration === 'ferry' && ( - )} {data.has_flyby_skill === 1 && data.shuttle_mode === 'called' && ( )} - {data.has_flyby_skill === 1 && data.shuttle_mode === 'idle' && ( - - )} } /> @@ -321,10 +317,7 @@ const RenderScreen = (props, context) => { (data.shuttle_mode === 'idle' || data.shuttle_mode === 'called') && ( )} - {data.shuttle_mode === 'idle' && - data.flight_configuration !== 'flyby' && ( - - )} + {data.shuttle_mode === 'idle' && } {data.shuttle_mode === 'igniting' && } {data.shuttle_mode === 'pre-arrival' && } {data.shuttle_mode === 'recharging' && }