Skip to content

Commit

Permalink
Made various fixes requested and made it so alarm stops when launch b…
Browse files Browse the repository at this point in the history
…utton is pressed.
  • Loading branch information
hislittlecuzingames committed Nov 20, 2023
2 parents e1aa1ab + eabb463 commit c35cde6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
14 changes: 11 additions & 3 deletions code/modules/shuttle/computers/dropship_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@
msg_admin_niche(log)
log_interact(user, msg = "[log]")
shuttle.send_for_flyby()
stop_playing_launch_announcement_alarm()
return TRUE

update_equipment(is_optimised, FALSE)
Expand Down Expand Up @@ -413,6 +414,7 @@
var/log = "[key_name(user)] launched the dropship [src.shuttleId] on transport."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
stop_playing_launch_announcement_alarm()
return TRUE
if("button-push")
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
Expand Down Expand Up @@ -476,11 +478,17 @@
shuttle.alarm_sound_loop.start()
shuttle.playing_launch_announcement_alarm = TRUE
return
if ("stop_play_launch_announcement_alarm")
shuttle.alarm_sound_loop.stop()
shuttle.playing_launch_announcement_alarm = FALSE
if ("stop_playing_launch_announcement_alarm")
stop_playing_launch_announcement_alarm()
return

/obj/structure/machinery/computer/shuttle/dropship/flight/proc/stop_playing_launch_announcement_alarm()
var/obj/docking_port/mobile/marine_dropship/shuttle = SSshuttle.getShuttle(shuttleId)

shuttle.alarm_sound_loop.stop()
shuttle.playing_launch_announcement_alarm = FALSE
return

/obj/structure/machinery/computer/shuttle/dropship/flight/lz1
icon = 'icons/obj/structures/machinery/computer.dmi'
icon_state = "shuttle"
Expand Down
27 changes: 11 additions & 16 deletions tgui/packages/tgui/interfaces/DropshipFlightControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ const DropshipDoorControl = (_, context) => {
<Button
disabled={disable_door_controls}
onClick={() =>
act('door-control', { interaction: 'lock', location: 'all' })
act('door-control', {
interaction: 'lock',
location: 'all',
})
}
icon="triangle-exclamation">
Lockdown
Expand Down Expand Up @@ -278,13 +281,13 @@ const AutopilotConfig = (props, context) => {
);
};

const StopPlayLaunchAnnouncementAlarm = (_, context) => {
const StopLaunchAnnouncementAlarm = (_, context) => {
const { act } = useBackend<NavigationProps>(context);
return (
<Button
icon="ban"
onClick={() => {
act('stop_play_launch_announcement_alarm');
act('stop_playing_launch_announcement_alarm');
}}>
Stop Alarm
</Button>
Expand Down Expand Up @@ -315,19 +318,11 @@ const LaunchAnnouncementAlarm = (_, context) => {
<Section
title="Launch Announcement Alarm"
buttons={
<>
{!data.playing_launch_announcement_alarm && (
<PlayLaunchAnnouncementAlarm />
)}

{data.playing_launch_announcement_alarm && (
<Button
onClick={() => act('stop_play_launch_announcement_alarm')}
icon="triangle-exclamation">
Stop Launch Alarm
</Button>
)}
</>
!data.playing_launch_announcement_alarm ? (
<PlayLaunchAnnouncementAlarm />
) : (
<StopLaunchAnnouncementAlarm />
)
}
/>
);
Expand Down

0 comments on commit c35cde6

Please sign in to comment.