Skip to content

Commit

Permalink
+repair +gui
Browse files Browse the repository at this point in the history
  • Loading branch information
ihatethisengine committed Feb 26, 2024
1 parent 763e9eb commit 4a8cc52
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
28 changes: 28 additions & 0 deletions code/game/machinery/doors/multi_tile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,34 @@
/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/ex_act(severity)
return

/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/attackby(obj/item/item, mob/user)
if(HAS_TRAIT(item, TRAIT_TOOL_MULTITOOL))
var/direction
switch(id)
if("starboard_door")
direction = "starboard"
if("port_door")
direction = "port"
if("aft_door")
direction = "aft"
if(!linked_dropship || !linked_dropship.door_control.door_controllers[direction])
return ..()
var/datum/door_controller/single/control = linked_dropship.door_control.door_controllers[direction]
if (control.status != SHUTTLE_DOOR_BROKEN)
return ..()
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_ENGI))
to_chat(user, SPAN_WARNING("You don't seem to understand how to restore remote connection to [src]."))
return
to_chat(user, SPAN_WARNING("You begin to restore remote connection to [src]."))
if(!do_after(user, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_BUILD))
to_chat(user, SPAN_WARNING("You fail to restore remote connection to [src]."))
return
unlock(TRUE)
close(FALSE)
control.status = SHUTTLE_DOOR_UNLOCKED
to_chat(user, SPAN_WARNING("You successfully restored remote connection to [src]."))
return
..()

/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/unlock()
if(is_reserved_level(z))
Expand Down
22 changes: 16 additions & 6 deletions tgui/packages/tgui/interfaces/DropshipFlightControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ import { Window } from '../layouts';
import { Box, Button, Flex, Icon, ProgressBar, Section, Stack } from '../components';
import { LaunchButton, CancelLaunchButton, DisabledScreen, InFlightCountdown, LaunchCountdown, NavigationProps, ShuttleRecharge, DockingPort } from './NavigationShuttle';

const DoorStatusEnum = {
SHUTTLE_DOOR_BROKEN: -1,
SHUTTLE_DOOR_UNLOCKED: 0,
SHUTTLE_DOOR_LOCKED: 1,
} as const;

type DoorStatusEnums = typeof DoorStatusEnum[keyof typeof DoorStatusEnum];

interface DoorStatus {
id: string;
value: -1 | 0 | 1;
value: DoorStatusEnums;
}

interface AutomatedControl {
Expand Down Expand Up @@ -40,7 +48,7 @@ const DropshipDoorControl = () => {
.filter((x) => x.id === 'all')
.map((x) => (
<>
{x.value === 0 && (
{x.value === DoorStatusEnum.SHUTTLE_DOOR_UNLOCKED && (
<Button
disabled={disable_door_controls}
onClick={() =>
Expand All @@ -54,7 +62,7 @@ const DropshipDoorControl = () => {
</Button>
)}

{x.value === 1 && (
{x.value === DoorStatusEnum.SHUTTLE_DOOR_LOCKED && (
<Button
disabled={disable_door_controls}
onClick={() =>
Expand All @@ -77,8 +85,10 @@ const DropshipDoorControl = () => {
return (
<Stack.Item key={x.id}>
<>
{x.value === -1 && <Button icon="ban">No response</Button>}
{x.value === 0 && (
{x.value === DoorStatusEnum.SHUTTLE_DOOR_BROKEN && (
<Button icon="ban">No response</Button>
)}
{x.value === DoorStatusEnum.SHUTTLE_DOOR_UNLOCKED && (
<Button
onClick={() =>
act('door-control', {
Expand All @@ -90,7 +100,7 @@ const DropshipDoorControl = () => {
Lock {name}
</Button>
)}
{x.value === 1 && (
{x.value === DoorStatusEnum.SHUTTLE_DOOR_LOCKED && (
<Button
disabled={disable_door_controls}
onClick={() =>
Expand Down

0 comments on commit 4a8cc52

Please sign in to comment.