Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed flyby tgui #4600

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
#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"

Expand Down
32 changes: 21 additions & 11 deletions code/modules/shuttle/computers/dropship_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,22 @@
.["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)
Expand Down Expand Up @@ -359,35 +368,36 @@
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)
if(is_set_flyby)
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
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."
msg_admin_niche(log)
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"] == dockId)
if(destination["id"] == dock_id)
found = TRUE
break
if(!found)
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."))
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."))
return
var/obj/docking_port/stationary/dock = SSshuttle.getDock(dockId)
var/obj/docking_port/stationary/dock = SSshuttle.getDock(dock_id)
var/dock_reserved = FALSE
for(var/obj/docking_port/mobile/other_shuttle in SSshuttle.mobile)
if(dock == other_shuttle.destination)
Expand Down
9 changes: 1 addition & 8 deletions tgui/packages/tgui/interfaces/DropshipFlightControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,7 @@ const RenderScreen = (props, context) => {
return (
<>
{data.can_set_automated === 1 && <AutopilotConfig />}
{data.can_fly_by === 1 &&
(data.shuttle_mode === 'idle' || data.shuttle_mode === 'called') && (
<FlybyControl />
)}
{data.shuttle_mode === 'idle' &&
data.flight_configuration !== 'flyby' && (
<DropshipDestinationSelection />
)}
{data.shuttle_mode === 'idle' && <DropshipDestinationSelection />}
{data.shuttle_mode === 'igniting' && <LaunchCountdown />}
{data.shuttle_mode === 'pre-arrival' && <TouchdownCooldown />}
{data.shuttle_mode === 'recharging' && <ShuttleRecharge />}
Expand Down