From c600289da2aafabc9cc7762c863e530948b54284 Mon Sep 17 00:00:00 2001 From: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Date: Tue, 16 Jul 2024 03:38:29 -0500 Subject: [PATCH] Express Console Supremacy (#2994) ## About The Pull Request Cuts out the old cargo console the express was a subtype, combining behaviors so there is only one. I would like to add the shopping list feature back so we can pool shipments together since most of our packs are now 1 item. ## Why It's Good For The Game Easier code managment ## Changelog :cl: refactor: refactored express console to not be a subtype of the cargo console and replacing it. /:cl: --- .../JungleRuins/jungle_cavecrew.dmm | 2 +- .../SpaceRuins/singularity_lab.dmm | 2 +- _maps/outpost/hangar/nt_asteroid_20x20.dmm | 2 +- _maps/outpost/hangar/nt_asteroid_40x20.dmm | 2 +- _maps/outpost/hangar/nt_asteroid_40x40.dmm | 2 +- _maps/outpost/hangar/nt_asteroid_56x20.dmm | 2 +- _maps/outpost/hangar/nt_asteroid_56x40.dmm | 2 +- _maps/outpost/nanotrasen_asteroid.dmm | 2 +- .../independent/independent_beluga.dmm | 2 +- .../shuttles/independent/independent_box.dmm | 2 +- .../independent/independent_bubble.dmm | 2 +- .../independent/independent_dwayne.dmm | 2 +- .../independent/independent_junker.dmm | 2 +- .../shuttles/independent/independent_kilo.dmm | 2 +- .../independent/independent_lagoon.dmm | 2 +- .../independent/independent_mudskipper.dmm | 2 +- .../independent/independent_rigger.dmm | 2 +- .../independent/independent_schmiedeberg.dmm | 2 +- .../independent/independent_shetland.dmm | 2 +- .../independent/independent_sunskipper.dmm | 2 +- _maps/shuttles/inteq/inteq_colossus.dmm | 2 +- _maps/shuttles/inteq/inteq_hound.dmm | 2 +- _maps/shuttles/inteq/inteq_talos.dmm | 2 +- _maps/shuttles/inteq/inteq_valor.dmm | 2 +- _maps/shuttles/inteq/inteq_vaquero.dmm | 2 +- .../shuttles/nanotrasen/nanotrasen_delta.dmm | 2 +- .../shuttles/nanotrasen/nanotrasen_gecko.dmm | 2 +- .../shuttles/nanotrasen/nanotrasen_heron.dmm | 2 +- _maps/shuttles/nanotrasen/nanotrasen_meta.dmm | 4 +- .../shuttles/nanotrasen/nanotrasen_mimir.dmm | 2 +- .../shuttles/nanotrasen/nanotrasen_osprey.dmm | 2 +- .../shuttles/nanotrasen/nanotrasen_ranger.dmm | 2 +- .../nanotrasen/nanotrasen_skipper.dmm | 2 +- _maps/shuttles/pgf/pgf_crying_sun.dmm | 2 +- _maps/shuttles/roumain/srm_elder.dmm | 2 +- _maps/shuttles/solgov/solgov_chronicle.dmm | 2 +- _maps/shuttles/solgov/solgov_inkwell.dmm | 2 +- _maps/shuttles/solgov/solgov_paracelsus.dmm | 2 +- .../syndicate/syndicate_cybersun_kansatsu.dmm | 2 +- .../syndicate/syndicate_gorlex_hyena.dmm | 2 +- .../syndicate/syndicate_gorlex_komodo.dmm | 2 +- .../syndicate/syndicate_litieguai.dmm | 2 +- .../shuttles/syndicate/syndicate_panacea.dmm | 2 +- .../syndicate/syndicate_twinkleshine.dmm | 2 +- check_regex.yaml | 2 +- .../circuitboards/computer_circuitboards.dm | 12 +- code/game/objects/structures/salvaging.dm | 2 +- code/modules/cargo/console.dm | 370 +++++++----- code/modules/cargo/expressconsole.dm | 262 --------- code/modules/cargo/supplypod_beacon.dm | 28 +- .../research/designs/mining_designs.dm | 2 +- shiptest.dme | 2 +- tgui/packages/tgui/interfaces/Cargo.js | 533 ------------------ .../OutpostCommunications/Catalog.js | 190 +++++++ .../index.tsx} | 39 +- .../interfaces/OutpostCommunications/types.ts | 28 + 56 files changed, 509 insertions(+), 1051 deletions(-) delete mode 100644 code/modules/cargo/expressconsole.dm delete mode 100644 tgui/packages/tgui/interfaces/Cargo.js create mode 100644 tgui/packages/tgui/interfaces/OutpostCommunications/Catalog.js rename tgui/packages/tgui/interfaces/{OutpostCommunications.tsx => OutpostCommunications/index.tsx} (88%) create mode 100644 tgui/packages/tgui/interfaces/OutpostCommunications/types.ts diff --git a/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm b/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm index 781ae59a84f4..dec4c65755f9 100644 --- a/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm +++ b/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm @@ -1762,7 +1762,7 @@ /turf/open/floor/plasteel/tech, /area/ruin/jungle/cavecrew/security) "vr" = ( -/obj/machinery/computer/cargo/express, +/obj/machinery/computer/cargo, /turf/open/floor/plasteel/patterned, /area/ruin/jungle/cavecrew/cargo) "vH" = ( diff --git a/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm b/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm index 45591d25dde5..99ccda138d00 100644 --- a/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm +++ b/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm @@ -3490,7 +3490,7 @@ /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer2{ dir = 9 }, -/obj/machinery/computer/cargo/express, +/obj/machinery/computer/cargo, /turf/open/floor/carpet/nanoweave/beige, /area/ruin/space/has_grav/singularitylab/cargo) "nT" = ( diff --git a/_maps/outpost/hangar/nt_asteroid_20x20.dmm b/_maps/outpost/hangar/nt_asteroid_20x20.dmm index 118f810e93f8..858d984f4603 100644 --- a/_maps/outpost/hangar/nt_asteroid_20x20.dmm +++ b/_maps/outpost/hangar/nt_asteroid_20x20.dmm @@ -370,7 +370,7 @@ }, /area/hangar) "jw" = ( -/obj/machinery/computer/cargo/express, +/obj/machinery/computer/cargo, /obj/structure/railing{ dir = 8; layer = 4.1 diff --git a/_maps/outpost/hangar/nt_asteroid_40x20.dmm b/_maps/outpost/hangar/nt_asteroid_40x20.dmm index b57c4972362c..312e0443aeea 100644 --- a/_maps/outpost/hangar/nt_asteroid_40x20.dmm +++ b/_maps/outpost/hangar/nt_asteroid_40x20.dmm @@ -839,7 +839,7 @@ }, /area/hangar) "tH" = ( -/obj/machinery/computer/cargo/express, +/obj/machinery/computer/cargo, /obj/item/toy/plush/knight{ pixel_y = 25; pixel_x = 9 diff --git a/_maps/outpost/hangar/nt_asteroid_40x40.dmm b/_maps/outpost/hangar/nt_asteroid_40x40.dmm index 48649aedf4d8..005b657e38ee 100644 --- a/_maps/outpost/hangar/nt_asteroid_40x40.dmm +++ b/_maps/outpost/hangar/nt_asteroid_40x40.dmm @@ -60,7 +60,7 @@ /obj/effect/turf_decal/techfloor{ dir = 4 }, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/machinery/light/directional/east, diff --git a/_maps/outpost/hangar/nt_asteroid_56x20.dmm b/_maps/outpost/hangar/nt_asteroid_56x20.dmm index 9dac115ca5e7..11ba5baac070 100644 --- a/_maps/outpost/hangar/nt_asteroid_56x20.dmm +++ b/_maps/outpost/hangar/nt_asteroid_56x20.dmm @@ -284,7 +284,7 @@ }, /area/hangar) "kx" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8; pixel_x = 7 }, diff --git a/_maps/outpost/hangar/nt_asteroid_56x40.dmm b/_maps/outpost/hangar/nt_asteroid_56x40.dmm index a3018e28aa32..5d66d8966d0b 100644 --- a/_maps/outpost/hangar/nt_asteroid_56x40.dmm +++ b/_maps/outpost/hangar/nt_asteroid_56x40.dmm @@ -723,7 +723,7 @@ }, /area/hangar) "Ed" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8; pixel_x = 7 }, diff --git a/_maps/outpost/nanotrasen_asteroid.dmm b/_maps/outpost/nanotrasen_asteroid.dmm index d1a184d736fc..816befea0002 100644 --- a/_maps/outpost/nanotrasen_asteroid.dmm +++ b/_maps/outpost/nanotrasen_asteroid.dmm @@ -5585,7 +5585,7 @@ /turf/open/floor/concrete/reinforced, /area/outpost/maintenance/aft) "tW" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/effect/turf_decal/techfloor{ diff --git a/_maps/shuttles/independent/independent_beluga.dmm b/_maps/shuttles/independent/independent_beluga.dmm index 1eae63fcac48..c8ef49a3b35e 100644 --- a/_maps/shuttles/independent/independent_beluga.dmm +++ b/_maps/shuttles/independent/independent_beluga.dmm @@ -4742,7 +4742,7 @@ /area/ship/crew) "UO" = ( /obj/effect/turf_decal/industrial/traffic/corner, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /obj/machinery/light/directional/south, diff --git a/_maps/shuttles/independent/independent_box.dmm b/_maps/shuttles/independent/independent_box.dmm index 0e1e4e9439b5..577290c6581c 100644 --- a/_maps/shuttles/independent/independent_box.dmm +++ b/_maps/shuttles/independent/independent_box.dmm @@ -1802,7 +1802,7 @@ /obj/effect/turf_decal/corner/opaque/blue{ dir = 4 }, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /obj/machinery/firealarm/directional/south, diff --git a/_maps/shuttles/independent/independent_bubble.dmm b/_maps/shuttles/independent/independent_bubble.dmm index c34ad8349987..08fd116f2536 100644 --- a/_maps/shuttles/independent/independent_bubble.dmm +++ b/_maps/shuttles/independent/independent_bubble.dmm @@ -1164,7 +1164,7 @@ }, /obj/item/circuitboard/computer/selling_pad_control, /obj/item/circuitboard/machine/selling_pad, -/obj/item/circuitboard/computer/cargo/express, +/obj/item/circuitboard/computer/cargo, /obj/structure/closet/crate/engineering, /turf/open/floor/plasteel, /area/ship/cargo) diff --git a/_maps/shuttles/independent/independent_dwayne.dmm b/_maps/shuttles/independent/independent_dwayne.dmm index ef1435cb1558..668e1e164530 100644 --- a/_maps/shuttles/independent/independent_dwayne.dmm +++ b/_maps/shuttles/independent/independent_dwayne.dmm @@ -1974,7 +1974,7 @@ /obj/effect/turf_decal/corner/opaque/blue/half{ dir = 4 }, -/obj/machinery/computer/cargo/express/retro{ +/obj/machinery/computer/cargo/retro{ dir = 8 }, /turf/open/floor/plasteel/dark, diff --git a/_maps/shuttles/independent/independent_junker.dmm b/_maps/shuttles/independent/independent_junker.dmm index a5b4354e7456..136e6e6e17fb 100644 --- a/_maps/shuttles/independent/independent_junker.dmm +++ b/_maps/shuttles/independent/independent_junker.dmm @@ -2277,7 +2277,7 @@ }, /obj/effect/decal/cleanable/glass, /obj/structure/safe/floor, -/obj/item/circuitboard/computer/cargo/express, +/obj/item/circuitboard/computer/cargo, /turf/open/floor/pod/dark, /area/ship/crew/office) "Rj" = ( diff --git a/_maps/shuttles/independent/independent_kilo.dmm b/_maps/shuttles/independent/independent_kilo.dmm index a4c390afde8d..0f1f92a475c8 100644 --- a/_maps/shuttles/independent/independent_kilo.dmm +++ b/_maps/shuttles/independent/independent_kilo.dmm @@ -1252,7 +1252,7 @@ /area/ship/crew) "sW" = ( /obj/effect/turf_decal/industrial/outline/yellow, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/machinery/airalarm/directional/east, diff --git a/_maps/shuttles/independent/independent_lagoon.dmm b/_maps/shuttles/independent/independent_lagoon.dmm index 14823f92db63..77b0d605e91b 100644 --- a/_maps/shuttles/independent/independent_lagoon.dmm +++ b/_maps/shuttles/independent/independent_lagoon.dmm @@ -256,7 +256,7 @@ /turf/open/floor/plasteel, /area/ship/external) "bt" = ( -/obj/machinery/computer/cargo/express/retro{ +/obj/machinery/computer/cargo/retro{ dir = 4 }, /turf/open/floor/plasteel/patterned/cargo_one, diff --git a/_maps/shuttles/independent/independent_mudskipper.dmm b/_maps/shuttles/independent/independent_mudskipper.dmm index f82cdc7ba748..d7a3341b8927 100644 --- a/_maps/shuttles/independent/independent_mudskipper.dmm +++ b/_maps/shuttles/independent/independent_mudskipper.dmm @@ -913,7 +913,7 @@ /obj/structure/sign/warning/incident{ pixel_x = -32 }, -/obj/machinery/computer/cargo/express/retro{ +/obj/machinery/computer/cargo/retro{ dir = 4 }, /turf/open/floor/plasteel/tech/grid, diff --git a/_maps/shuttles/independent/independent_rigger.dmm b/_maps/shuttles/independent/independent_rigger.dmm index daf3cf9ecdb3..42a9f999f3f7 100644 --- a/_maps/shuttles/independent/independent_rigger.dmm +++ b/_maps/shuttles/independent/independent_rigger.dmm @@ -2231,7 +2231,7 @@ /obj/machinery/atmospherics/components/unary/vent_pump/on/layer2{ dir = 4 }, -/obj/machinery/computer/cargo/express, +/obj/machinery/computer/cargo, /obj/item/radio/intercom/directional/north, /turf/open/floor/carpet/blue, /area/ship/bridge) diff --git a/_maps/shuttles/independent/independent_schmiedeberg.dmm b/_maps/shuttles/independent/independent_schmiedeberg.dmm index 454e7503cb52..ce7b407a4731 100644 --- a/_maps/shuttles/independent/independent_schmiedeberg.dmm +++ b/_maps/shuttles/independent/independent_schmiedeberg.dmm @@ -756,7 +756,7 @@ /turf/open/floor/wood/walnut, /area/ship/crew/canteen) "ka" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /obj/item/radio/intercom/directional/south, diff --git a/_maps/shuttles/independent/independent_shetland.dmm b/_maps/shuttles/independent/independent_shetland.dmm index e269c70cfefa..f147aeb82276 100644 --- a/_maps/shuttles/independent/independent_shetland.dmm +++ b/_maps/shuttles/independent/independent_shetland.dmm @@ -5464,7 +5464,7 @@ /obj/effect/turf_decal/corner/opaque/neutral/three_quarters{ dir = 1 }, -/obj/machinery/computer/cargo/express/retro, +/obj/machinery/computer/cargo/retro, /turf/open/floor/plasteel/telecomms_floor, /area/ship/bridge) "VD" = ( diff --git a/_maps/shuttles/independent/independent_sunskipper.dmm b/_maps/shuttles/independent/independent_sunskipper.dmm index 113230223069..de92179a11f7 100644 --- a/_maps/shuttles/independent/independent_sunskipper.dmm +++ b/_maps/shuttles/independent/independent_sunskipper.dmm @@ -2050,7 +2050,7 @@ /turf/open/floor/plasteel/tech, /area/ship/cargo) "AP" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ icon_state = "computer-right"; dir = 8 }, diff --git a/_maps/shuttles/inteq/inteq_colossus.dmm b/_maps/shuttles/inteq/inteq_colossus.dmm index 870a12949973..5925b9c0acdd 100644 --- a/_maps/shuttles/inteq/inteq_colossus.dmm +++ b/_maps/shuttles/inteq/inteq_colossus.dmm @@ -852,7 +852,7 @@ /area/ship/hallway/fore) "iX" = ( /obj/item/radio/intercom/wideband/directional/south, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /obj/effect/turf_decal/borderfloor, diff --git a/_maps/shuttles/inteq/inteq_hound.dmm b/_maps/shuttles/inteq/inteq_hound.dmm index 5616d1d2d4b0..da82ccbf26b7 100644 --- a/_maps/shuttles/inteq/inteq_hound.dmm +++ b/_maps/shuttles/inteq/inteq_hound.dmm @@ -1580,7 +1580,7 @@ dir = 1 }, /obj/effect/turf_decal/steeldecal/steel_decals_central4, -/obj/machinery/computer/cargo/express, +/obj/machinery/computer/cargo, /obj/item/radio/intercom/wideband/directional/north{ pixel_y = 25; pixel_x = 6 diff --git a/_maps/shuttles/inteq/inteq_talos.dmm b/_maps/shuttles/inteq/inteq_talos.dmm index 7a4a3bec6618..491853b5266c 100644 --- a/_maps/shuttles/inteq/inteq_talos.dmm +++ b/_maps/shuttles/inteq/inteq_talos.dmm @@ -2329,7 +2329,7 @@ /turf/open/floor/plasteel/tech, /area/ship/security/armory) "os" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/effect/turf_decal/corner/opaque/brown{ diff --git a/_maps/shuttles/inteq/inteq_valor.dmm b/_maps/shuttles/inteq/inteq_valor.dmm index 1d0c4910e49e..0b41578dd31b 100644 --- a/_maps/shuttles/inteq/inteq_valor.dmm +++ b/_maps/shuttles/inteq/inteq_valor.dmm @@ -3855,7 +3855,7 @@ /turf/open/floor/plasteel/patterned, /area/ship/cargo) "Ko" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /obj/effect/turf_decal/corner/opaque/brown{ diff --git a/_maps/shuttles/inteq/inteq_vaquero.dmm b/_maps/shuttles/inteq/inteq_vaquero.dmm index 23a80717b42f..9e8f7d6c81f5 100644 --- a/_maps/shuttles/inteq/inteq_vaquero.dmm +++ b/_maps/shuttles/inteq/inteq_vaquero.dmm @@ -2897,7 +2897,7 @@ /turf/open/floor/plasteel/tech, /area/ship/cargo) "TK" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/effect/turf_decal/corner/opaque/yellow, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm b/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm index b723b020aa36..e5890b401cfa 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm @@ -2530,7 +2530,7 @@ /turf/open/floor/plasteel/dark, /area/ship/bridge) "Lv" = ( -/obj/machinery/computer/cargo/express/retro{ +/obj/machinery/computer/cargo/retro{ dir = 8 }, /obj/effect/turf_decal/corner/opaque/nsorange, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm b/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm index b05fd520c158..351f188e3369 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm @@ -4283,7 +4283,7 @@ /turf/open/floor/plasteel/grimy, /area/ship/crew) "RK" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 4 }, /obj/item/radio/intercom/directional/west, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm b/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm index b92747f3a3e2..0a0c9dead99f 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm @@ -10099,7 +10099,7 @@ /turf/open/floor/plasteel/tech, /area/ship/engineering) "LS" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/structure/railing{ diff --git a/_maps/shuttles/nanotrasen/nanotrasen_meta.dmm b/_maps/shuttles/nanotrasen/nanotrasen_meta.dmm index 9abfe4c6c6cb..663a567b8bbc 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_meta.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_meta.dmm @@ -1107,7 +1107,7 @@ /turf/open/floor/plasteel/dark, /area/ship/cargo) "dg" = ( -/obj/machinery/computer/cargo/express/retro{ +/obj/machinery/computer/cargo/retro{ dir = 8 }, /obj/effect/turf_decal/corner/opaque/blue/three_quarters{ @@ -2647,7 +2647,7 @@ /area/ship/cargo) "Du" = ( /obj/effect/turf_decal/corner/transparent/neutral/full, -/obj/machinery/computer/cargo/express/retro{ +/obj/machinery/computer/cargo/retro{ dir = 8 }, /obj/effect/decal/cleanable/dirt/dust, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm b/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm index f5ffea852281..928fc6bd90ee 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_mimir.dmm @@ -4024,7 +4024,7 @@ /turf/open/floor/plasteel, /area/ship/security/prison) "xT" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /turf/open/floor/plasteel/telecomms_floor, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm b/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm index 774f1d57cc40..0c860abb9e20 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm @@ -95,7 +95,7 @@ /obj/structure/disposalpipe/segment{ dir = 8 }, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/effect/turf_decal/corner/opaque/brown{ diff --git a/_maps/shuttles/nanotrasen/nanotrasen_ranger.dmm b/_maps/shuttles/nanotrasen/nanotrasen_ranger.dmm index a106a307bb18..342ffb8fa928 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_ranger.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_ranger.dmm @@ -464,7 +464,7 @@ /turf/open/floor/plasteel/white, /area/ship/hallway/port) "eE" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /turf/open/floor/plasteel/tech, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm index f910af5043c8..f9aeea662f05 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm @@ -4235,7 +4235,7 @@ "JA" = ( /obj/machinery/atmospherics/pipe/simple/supply/hidden/layer2, /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer4, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /turf/open/floor/plasteel/dark, diff --git a/_maps/shuttles/pgf/pgf_crying_sun.dmm b/_maps/shuttles/pgf/pgf_crying_sun.dmm index 919770509bec..e016ef725525 100644 --- a/_maps/shuttles/pgf/pgf_crying_sun.dmm +++ b/_maps/shuttles/pgf/pgf_crying_sun.dmm @@ -464,7 +464,7 @@ /turf/open/floor/plasteel/telecomms_floor, /area/ship/hallway/port) "dK" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/structure/catwalk/over/plated_catwalk/dark, diff --git a/_maps/shuttles/roumain/srm_elder.dmm b/_maps/shuttles/roumain/srm_elder.dmm index e4a85560cb67..5ef138ad19db 100644 --- a/_maps/shuttles/roumain/srm_elder.dmm +++ b/_maps/shuttles/roumain/srm_elder.dmm @@ -3609,7 +3609,7 @@ /turf/open/floor/wood/maple, /area/ship/crew/cryo) "Sg" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/effect/turf_decal/spline/fancy/wood{ diff --git a/_maps/shuttles/solgov/solgov_chronicle.dmm b/_maps/shuttles/solgov/solgov_chronicle.dmm index 13e78929b4dc..012261bda246 100644 --- a/_maps/shuttles/solgov/solgov_chronicle.dmm +++ b/_maps/shuttles/solgov/solgov_chronicle.dmm @@ -350,7 +350,7 @@ /turf/open/floor/wood, /area/ship/crew) "da" = ( -/obj/machinery/computer/cargo/express/solgov{ +/obj/machinery/computer/cargo/solgov{ dir = 4 }, /obj/item/radio/intercom/directional/west, diff --git a/_maps/shuttles/solgov/solgov_inkwell.dmm b/_maps/shuttles/solgov/solgov_inkwell.dmm index da2a6b032eaa..86781cc2e251 100644 --- a/_maps/shuttles/solgov/solgov_inkwell.dmm +++ b/_maps/shuttles/solgov/solgov_inkwell.dmm @@ -2139,7 +2139,7 @@ /turf/open/floor/plasteel/mono, /area/ship/cargo) "nO" = ( -/obj/machinery/computer/cargo/express/solgov, +/obj/machinery/computer/cargo/solgov, /turf/open/floor/wood/maple, /area/ship/bridge) "nR" = ( diff --git a/_maps/shuttles/solgov/solgov_paracelsus.dmm b/_maps/shuttles/solgov/solgov_paracelsus.dmm index b099e500aee9..1235af6da913 100644 --- a/_maps/shuttles/solgov/solgov_paracelsus.dmm +++ b/_maps/shuttles/solgov/solgov_paracelsus.dmm @@ -2725,7 +2725,7 @@ /obj/structure/railing/wood{ dir = 8 }, -/obj/machinery/computer/cargo/express/solgov{ +/obj/machinery/computer/cargo/solgov{ dir = 4 }, /obj/effect/turf_decal/siding/wood{ diff --git a/_maps/shuttles/syndicate/syndicate_cybersun_kansatsu.dmm b/_maps/shuttles/syndicate/syndicate_cybersun_kansatsu.dmm index 41faf816d827..ffc2472b5dec 100644 --- a/_maps/shuttles/syndicate/syndicate_cybersun_kansatsu.dmm +++ b/_maps/shuttles/syndicate/syndicate_cybersun_kansatsu.dmm @@ -258,7 +258,7 @@ /turf/open/floor/plasteel/stairs, /area/ship/cargo) "fk" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/machinery/button/door{ diff --git a/_maps/shuttles/syndicate/syndicate_gorlex_hyena.dmm b/_maps/shuttles/syndicate/syndicate_gorlex_hyena.dmm index 7c7a34fd2690..ae46dc0286f3 100644 --- a/_maps/shuttles/syndicate/syndicate_gorlex_hyena.dmm +++ b/_maps/shuttles/syndicate/syndicate_gorlex_hyena.dmm @@ -952,7 +952,7 @@ "pI" = ( /obj/item/radio/intercom/wideband/directional/east, /obj/effect/decal/cleanable/dirt/dust, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 1 }, /obj/effect/turf_decal/borderfloorblack, diff --git a/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm b/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm index 7c323e43dbe0..bfbdc4e43e04 100644 --- a/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm +++ b/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm @@ -3507,7 +3507,7 @@ /turf/open/floor/mineral/plastitanium/red, /area/ship/hallway/central) "HI" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ layer = 3 }, /obj/effect/turf_decal/techfloor{ diff --git a/_maps/shuttles/syndicate/syndicate_litieguai.dmm b/_maps/shuttles/syndicate/syndicate_litieguai.dmm index c2e92f15f167..09ad85bc606f 100644 --- a/_maps/shuttles/syndicate/syndicate_litieguai.dmm +++ b/_maps/shuttles/syndicate/syndicate_litieguai.dmm @@ -2608,7 +2608,7 @@ /turf/open/floor/plasteel/white, /area/ship/hallway/central) "TA" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /turf/open/floor/plasteel/dark, diff --git a/_maps/shuttles/syndicate/syndicate_panacea.dmm b/_maps/shuttles/syndicate/syndicate_panacea.dmm index a55e39dd9e27..702798048e53 100644 --- a/_maps/shuttles/syndicate/syndicate_panacea.dmm +++ b/_maps/shuttles/syndicate/syndicate_panacea.dmm @@ -887,7 +887,7 @@ /turf/open/floor/suns/dark/plain, /area/ship/crew/office/lobby) "fG" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /turf/open/floor/suns/dark, diff --git a/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm index 9967d69f6d07..1adef58948fe 100644 --- a/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm +++ b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm @@ -1580,7 +1580,7 @@ /obj/effect/turf_decal/corner/opaque/syndiered/half{ dir = 4 }, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8; icon_state = "computer-left" }, diff --git a/check_regex.yaml b/check_regex.yaml index 3b5e13a650e5..441f1e44d743 100644 --- a/check_regex.yaml +++ b/check_regex.yaml @@ -31,7 +31,7 @@ standards: - exactly: [4, "/mob text paths", '"/mob'] - exactly: [43, "/obj text paths", '"/obj'] - exactly: [0, "/turf text paths", '"/turf'] - - exactly: [117, "text2path uses", "text2path"] + - exactly: [116, "text2path uses", "text2path"] - exactly: [18, "world<< uses", 'world[ \t]*<<'] - exactly: [0, "world.log<< uses", 'world.log[ \t]*<<'] diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 54dcfb36c131..47739ded1551 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -362,7 +362,7 @@ build_path = /obj/machinery/computer/bounty /obj/item/circuitboard/computer/cargo - name = "Supply Console (Computer Board)" + name = "Outpost Comms Console (Computer Board)" icon_state = "supply" build_path = /obj/machinery/computer/cargo var/contraband = FALSE @@ -381,16 +381,6 @@ obj_flags |= EMAGGED to_chat(user, "You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.") -/obj/item/circuitboard/computer/cargo/express - name = "Outpost Comms Console (Computer Board)" - build_path = /obj/machinery/computer/cargo/express - -/obj/item/circuitboard/computer/cargo/express/multitool_act(mob/living/user) - return - -/obj/item/circuitboard/computer/cargo/express/emag_act(mob/living/user) - return - /obj/item/circuitboard/computer/mining name = "Outpost Status Display (Computer Board)" icon_state = "supply" diff --git a/code/game/objects/structures/salvaging.dm b/code/game/objects/structures/salvaging.dm index ebefc58e5c01..d373f8eb94a9 100644 --- a/code/game/objects/structures/salvaging.dm +++ b/code/game/objects/structures/salvaging.dm @@ -673,7 +673,7 @@ /obj/effect/spawner/lootdrop/random_computer_circuit_rare loot = list( - /obj/item/circuitboard/computer/cargo/express = 5, + /obj/item/circuitboard/computer/cargo = 5, /obj/item/circuitboard/computer/communications = 5, /obj/item/circuitboard/computer/shuttle/helm = 5, /obj/item/circuitboard/computer/med_data = 5, diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index 143480b2bc71..82fd2c11d01a 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -1,42 +1,57 @@ +#define BEACON_COST 500 +#define SP_LINKED 1 +#define SP_READY 2 +#define SP_LAUNCH 3 +#define SP_UNLINK 4 +#define SP_UNREADY 5 + /obj/machinery/computer/cargo - name = "supply console" - desc = "Used to order supplies, approve requests, and control the shuttle." - icon_screen = "supply" + name = "outpost communications console" + desc = "This console allows the user to communicate with a nearby outpost to \ + purchase supplies and manage missions. Purchases are delivered near-instantly." + icon_screen = "supply_express" circuit = /obj/item/circuitboard/computer/cargo light_color = COLOR_BRIGHT_ORANGE - var/requestonly = FALSE var/contraband = FALSE var/self_paid = FALSE var/safety_warning = "For safety reasons, the automated supply shuttle \ cannot transport live organisms, human remains, classified nuclear weaponry, \ homing beacons or machinery housing any form of artificial intelligence." - var/blockade_warning = "Bluespace instability detected. Shuttle movement impossible." - /// radio used by the console to send messages on supply channel - var/obj/item/radio/headset/radio /// var that tracks message cooldown var/message_cooldown - -/obj/machinery/computer/cargo/request - name = "supply request console" - desc = "Used to request supplies from cargo." - icon_screen = "request" - circuit = /obj/item/circuitboard/computer/cargo/request - requestonly = TRUE + var/blockade_warning = "Bluespace instability detected. Delivery impossible." + var/message + /// Number of beacons printed. Used to determine beacon names. + var/printed_beacons = 0 + var/list/supply_pack_data + /// The currently linked supplypod beacon + var/obj/item/supplypod_beacon/beacon + /// Area instance that cargo pods are sent to + var/area/landingzone + /// The pod type used to deliver orders + var/podType = /obj/structure/closet/supplypod/centcompod + /// Cooldown to prevent printing supplypod beacon spam + var/cooldown = 0 + /// Is the console in beacon mode? exists to let beacon know when a pod may come in + var/use_beacon = FALSE + /// The account to charge purchases to, defaults to the cargo budget + var/datum/bank_account/charge_account /obj/machinery/computer/cargo/Initialize() . = ..() - radio = new /obj/item/radio/headset/headset_cargo(src) var/obj/item/circuitboard/computer/cargo/board = circuit contraband = board.contraband if (board.obj_flags & EMAGGED) obj_flags |= EMAGGED else obj_flags &= ~EMAGGED + generate_pack_data() /obj/machinery/computer/cargo/Destroy() - QDEL_NULL(radio) + if(beacon) + beacon.unlink_console() return ..() /obj/machinery/computer/cargo/proc/get_export_categories() @@ -65,49 +80,68 @@ /obj/machinery/computer/cargo/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) - ui = new(user, src, "Cargo", name) + ui = new(user, src, "OutpostCommunications", name) ui.open() + if(!charge_account) + reconnect() -/obj/machinery/computer/cargo/ui_data() +/obj/machinery/computer/cargo/ui_data(mob/user) + var/canBeacon = beacon && (isturf(beacon.loc) || ismob(beacon.loc))//is the beacon in a valid location? var/list/data = list() - data["location"] = SSshuttle.supply.getStatusText() - var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR) + + // not a big fan of get_containing_shuttle + var/obj/docking_port/mobile/D = SSshuttle.get_containing_shuttle(src) + var/datum/overmap/ship/controlled/ship + var/outpost_docked = FALSE if(D) - data["points"] = D.account_balance - data["away"] = SSshuttle.supply.get_docked() == SSshuttle.supply_away_port - data["self_paid"] = self_paid - data["docked"] = SSshuttle.supply.mode == SHUTTLE_IDLE - var/message = "Remember to stamp and send back the supply manifests." - if(SSshuttle.centcom_message) - message = SSshuttle.centcom_message + ship = D.current_ship + outpost_docked = istype(ship.docked_to, /datum/overmap/outpost) + + data["onShip"] = !isnull(ship) + data["numMissions"] = ship ? LAZYLEN(ship.missions) : 0 + data["maxMissions"] = ship ? ship.max_missions : 0 + data["outpostDocked"] = outpost_docked + data["points"] = charge_account ? charge_account.account_balance : 0 + data["siliconUser"] = user.has_unlimited_silicon_privilege && check_ship_ai_access(user) + data["beaconZone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui + data["usingBeacon"] = use_beacon //is the mode set to deliver to the beacon or the cargobay? + data["canBeacon"] = !use_beacon || canBeacon //is the mode set to beacon delivery, and is the beacon in a valid location? + data["canBuyBeacon"] = charge_account ? (cooldown <= 0 && charge_account.account_balance >= BEACON_COST) : FALSE + data["beaconError"] = use_beacon && !canBeacon ? "(BEACON ERROR)" : ""//changes button text to include an error alert if necessary + data["hasBeacon"] = beacon != null//is there a linked beacon? + data["beaconName"] = beacon ? beacon.name : "No Beacon Found" + data["printMsg"] = cooldown > 0 ? "Print Beacon for [BEACON_COST] credits ([cooldown])" : "Print Beacon for [BEACON_COST] credits"//buttontext for printing beacons + data["supplies"] = list() + message = "Sales are near-instantaneous - please choose carefully." if(SSshuttle.supplyBlocked) message = blockade_warning + if(use_beacon && !beacon) + message = "BEACON ERROR: BEACON MISSING"//beacon was destroyed + else if (use_beacon && !canBeacon) + message = "BEACON ERROR: MUST BE EXPOSED"//beacon's loc/user's loc must be a turf data["message"] = message - data["cart"] = list() - for(var/datum/supply_order/SO in SSshuttle.shoppinglist) - data["cart"] += list(list( - "object" = SO.pack.name, - "cost" = SO.pack.cost, - "id" = SO.id, - "orderer" = SO.orderer, - "paid" = !isnull(SO.paying_account) //paid by requester - )) + if(!supply_pack_data) + generate_pack_data() + stack_trace("You didn't give the cargo tech good advice, and he ripped the manifest. As a result, there was no pack data for [src]") + data["supplies"] = supply_pack_data + if (cooldown > 0)//cooldown used for printing beacons + cooldown-- - data["requests"] = list() - for(var/datum/supply_order/SO in SSshuttle.requestlist) - data["requests"] += list(list( - "object" = SO.pack.name, - "cost" = SO.pack.cost, - "orderer" = SO.orderer, - "reason" = SO.reason, - "id" = SO.id - )) + data["shipMissions"] = list() + data["outpostMissions"] = list() + + if(ship) + for(var/datum/mission/M as anything in ship.missions) + data["shipMissions"] += list(M.get_tgui_info()) + if(outpost_docked) + var/datum/overmap/outpost/out = ship.docked_to + for(var/datum/mission/M as anything in out.missions) + data["outpostMissions"] += list(M.get_tgui_info()) return data /obj/machinery/computer/cargo/ui_static_data(mob/user) var/list/data = list() - data["requestonly"] = requestonly data["supplies"] = list() for(var/pack in SSshuttle.supply_packs) var/datum/supply_pack/P = SSshuttle.supply_packs[pack] @@ -116,7 +150,7 @@ "name" = P.group, "packs" = list() ) - if((P.hidden && !(obj_flags & EMAGGED)) || (P.contraband && !contraband) || (P.special && !P.special_enabled) || P.DropPodOnly) + if(P.hidden && !(obj_flags & EMAGGED)) continue data["supplies"][P.group]["packs"] += list(list( "name" = P.name, @@ -124,7 +158,6 @@ "id" = pack, "desc" = P.desc || P.name, // If there is a description, use it. Otherwise use the pack's name. "small_item" = P.small_item, - "access" = P.access )) return data @@ -133,115 +166,154 @@ if(.) return switch(action) - if("send") - if(!SSshuttle.supply.canMove()) - say(safety_warning) + if("withdrawCash") + var/val = text2num(params["value"]) + // no giving yourself money + if(!charge_account || !val || val <= 0) return - if(SSshuttle.supplyBlocked) - say(blockade_warning) - return - if(SSshuttle.supply.get_docked() == SSshuttle.supply_home_port) - SSshuttle.supply.export_categories = get_export_categories() - SSshuttle.moveShuttle(SSshuttle.supply, SSshuttle.supply_away_port, TRUE) - say("The supply shuttle is departing.") - investigate_log("[key_name(usr)] sent the supply shuttle away.", INVESTIGATE_CARGO) - else - investigate_log("[key_name(usr)] called the supply shuttle.", INVESTIGATE_CARGO) - say("The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.") - SSshuttle.moveShuttle(SSshuttle.supply, SSshuttle.supply_home_port, TRUE) - . = TRUE + if(charge_account.adjust_money(-val)) + var/obj/item/holochip/cash_chip = new /obj/item/holochip(drop_location(), val) + if(ishuman(usr)) + var/mob/living/carbon/human/user = usr + user.put_in_hands(cash_chip) + playsound(src, 'sound/machines/twobeep_high.ogg', 50, TRUE) + src.visible_message("[src] dispenses a holochip.") + return TRUE + + if("LZCargo") + use_beacon = FALSE + if (beacon) + beacon.update_status(SP_UNREADY) //ready light on beacon will turn off + if("LZBeacon") + use_beacon = TRUE + if (beacon) + beacon.update_status(SP_READY) //turns on the beacon's ready light + if("printBeacon") + if(charge_account?.adjust_money(-BEACON_COST)) + cooldown = 10//a ~ten second cooldown for printing beacons to prevent spam + var/obj/item/supplypod_beacon/C = new /obj/item/supplypod_beacon(drop_location()) + C.link_console(src, usr)//rather than in beacon's Initialize(), we can assign the computer to the beacon by reusing this proc) + printed_beacons++//printed_beacons starts at 0, so the first one out will be called beacon # 1 + beacon.name = "Supply Pod Beacon #[printed_beacons]" if("add") - if(istype(src, /obj/machinery/computer/cargo/express)) - return - var/id = text2path(params["id"]) - var/datum/supply_pack/pack = SSshuttle.supply_packs[id] - if(!istype(pack)) - return - if((pack.hidden && !(obj_flags & EMAGGED)) || (pack.contraband && !contraband) || pack.DropPodOnly) + var/area/ship/current_area = get_area(src) + var/datum/supply_pack/pack = SSshuttle.supply_packs[text2path(params["id"])] + if( \ + !pack || !charge_account?.has_money(pack.cost) || !istype(current_area) || \ + !istype(current_area.mobile_port.current_ship.docked_to, /datum/overmap/outpost) \ + ) return - var/name = "*None Provided*" - var/rank = "*None Provided*" - var/ckey = usr.ckey - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - name = H.get_authentification_name() - rank = H.get_assignment(hand_first = TRUE) - else if(issilicon(usr)) - name = usr.real_name - rank = "Silicon" - - var/datum/bank_account/account - if(self_paid && ishuman(usr)) - var/mob/living/carbon/human/H = usr - var/obj/item/card/id/id_card = H.get_idcard(TRUE) - if(!istype(id_card)) - say("No ID card detected.") - return - account = id_card.registered_account - if(!istype(account)) - say("Invalid bank account.") - return + var/turf/landing_turf + if(!isnull(beacon) && use_beacon) // prioritize beacons over landing in cargobay + landing_turf = get_turf(beacon) + beacon.update_status(SP_LAUNCH) + else if(!use_beacon)// find a suitable supplypod landing zone in cargobay + var/list/empty_turfs = list() + if(!landingzone) + reconnect() + if(!landingzone) + WARNING("[src] couldnt find a Ship/Cargo (aka cargobay) area on a ship, and as such it has set the supplypod landingzone to the area it resides in.") + landingzone = get_area(src) + for(var/turf/open/floor/T in landingzone.contents)//uses default landing zone + if(T.is_blocked_turf()) + continue + empty_turfs += T + CHECK_TICK + landing_turf = pick(empty_turfs) + + // note that, because of CHECK_TICK above, we aren't sure if we can + // afford the pack, even though we checked earlier. luckily adjust_money + // returns false if the account can't afford the price + if(landing_turf && charge_account.adjust_money(-pack.cost)) + var/name = "*None Provided*" + var/rank = "*None Provided*" + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + name = H.get_authentification_name() + rank = H.get_assignment(hand_first = TRUE) + else if(issilicon(usr)) + name = usr.real_name + rank = "Silicon" + var/datum/supply_order/SO = new(pack, name, rank, usr.ckey, "") + new /obj/effect/pod_landingzone(landing_turf, podType, SO) + update_appearance() // ?????????????????? + return TRUE - var/reason = "" - if(requestonly && !self_paid) - reason = stripped_input("Reason:", name, "") - if(isnull(reason) || ..()) + if("mission-act") + var/datum/mission/mission = locate(params["ref"]) + var/obj/docking_port/mobile/D = SSshuttle.get_containing_shuttle(src) + var/datum/overmap/ship/controlled/ship = D.current_ship + var/datum/overmap/outpost/outpost = ship.docked_to + if(!istype(outpost) || mission.source_outpost != outpost) // important to check these to prevent href fuckery + return + if(!mission.accepted) + if(LAZYLEN(ship.missions) >= ship.max_missions) return + mission.accept(ship, loc) + return TRUE + else if(mission.servant == ship) + if(mission.can_complete()) + mission.turn_in() + else + mission.give_up() + return TRUE - var/turf/T = get_turf(src) - var/datum/supply_order/SO = new(pack, name, rank, ckey, reason, account) - SO.generateRequisition(T) - if(requestonly && !self_paid) - SSshuttle.requestlist += SO - else - SSshuttle.shoppinglist += SO - if(self_paid) - say("Order processed. The price will be charged to [account.account_holder]'s bank account on delivery.") - if(requestonly && message_cooldown < world.time) - radio.talk_into(src, "A new order has been requested.", RADIO_CHANNEL_COMMAND) - message_cooldown = world.time + 30 SECONDS - . = TRUE - if("remove") - var/id = text2num(params["id"]) - for(var/datum/supply_order/SO in SSshuttle.shoppinglist) - if(SO.id == id) - SSshuttle.shoppinglist -= SO - . = TRUE - break - if("clear") - SSshuttle.shoppinglist.Cut() - . = TRUE - if("approve") - var/id = text2num(params["id"]) - for(var/datum/supply_order/SO in SSshuttle.requestlist) - if(SO.id == id) - SSshuttle.requestlist -= SO - SSshuttle.shoppinglist += SO - . = TRUE - break - if("deny") - var/id = text2num(params["id"]) - for(var/datum/supply_order/SO in SSshuttle.requestlist) - if(SO.id == id) - SSshuttle.requestlist -= SO - . = TRUE - break - if("denyall") - SSshuttle.requestlist.Cut() - . = TRUE - if("toggleprivate") - self_paid = !self_paid - . = TRUE - if(.) - post_signal("supply") +/obj/machinery/computer/cargo/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) + . = ..() + reconnect(port) -/obj/machinery/computer/cargo/proc/post_signal(command) +/obj/machinery/computer/cargo/proc/reconnect(obj/docking_port/mobile/port) + if(!port) + var/area/ship/current_area = get_area(src) + if(!istype(current_area)) + return + port = current_area.mobile_port + if(!port) + return + charge_account = port.current_ship.ship_account + landingzone = locate(/area/ship/cargo) in port.shuttle_areas - var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS) +/obj/machinery/computer/cargo/attackby(obj/item/W, mob/living/user, params) + var/value = W.get_item_credit_value() + if(value && charge_account) + charge_account.adjust_money(value) + to_chat(user, "You deposit [W]. The Vessel Budget is now [charge_account.account_balance] cr.") + qdel(W) + return TRUE + else if(istype(W, /obj/item/supplypod_beacon)) + var/obj/item/supplypod_beacon/sb = W + if (sb.cargo_console != src) + sb.link_console(src, user) + return TRUE + else + to_chat(user, "[src] is already linked to [sb].") + ..() - if(!frequency) - return +/obj/machinery/computer/cargo/proc/generate_pack_data() + supply_pack_data = list() + for(var/pack in SSshuttle.supply_packs) + var/datum/supply_pack/P = SSshuttle.supply_packs[pack] + if(!supply_pack_data[P.group]) + supply_pack_data[P.group] = list( + "name" = P.group, + "packs" = list() + ) + if((P.hidden)) + continue + supply_pack_data[P.group]["packs"] += list(list( + "name" = P.name, + "cost" = P.cost, + "id" = pack, + "desc" = P.desc || P.name // If there is a description, use it. Otherwise use the pack's name. + )) + +/obj/machinery/computer/cargo/retro + icon = 'icons/obj/machines/retro_computer.dmi' + icon_state = "computer-retro" + deconpath = /obj/structure/frame/computer/retro - var/datum/signal/status_signal = new(list("command" = command)) - frequency.post_signal(src, status_signal) +/obj/machinery/computer/cargo/solgov + icon = 'icons/obj/machines/retro_computer.dmi' + icon_state = "computer-solgov" + deconpath = /obj/structure/frame/computer/solgov diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm deleted file mode 100644 index 81409d63d031..000000000000 --- a/code/modules/cargo/expressconsole.dm +++ /dev/null @@ -1,262 +0,0 @@ -#define BEACON_COST 500 -#define SP_LINKED 1 -#define SP_READY 2 -#define SP_LAUNCH 3 -#define SP_UNLINK 4 -#define SP_UNREADY 5 - -/obj/machinery/computer/cargo/express - name = "outpost communications console" - desc = "This console allows the user to communicate with a nearby outpost to \ - purchase supplies and manage missions. Purchases are delivered near-instantly." - icon_screen = "supply_express" - circuit = /obj/item/circuitboard/computer/cargo/express - var/blockade_warning = "Bluespace instability detected. Delivery impossible." - - var/message - /// Number of beacons printed. Used to determine beacon names. - var/printed_beacons = 0 - var/list/meme_pack_data - /// The currently linked supplypod beacon - var/obj/item/supplypod_beacon/beacon - /// Area instance that cargo pods are sent to - var/area/landingzone - /// The pod type used to deliver orders - var/podType = /obj/structure/closet/supplypod/centcompod - /// Cooldown to prevent printing supplypod beacon spam - var/cooldown = 0 - /// Is the console in beacon mode? exists to let beacon know when a pod may come in - var/use_beacon = FALSE - /// The account to charge purchases to, defaults to the cargo budget - var/datum/bank_account/charge_account - -/obj/machinery/computer/cargo/express/retro - icon = 'icons/obj/machines/retro_computer.dmi' - icon_state = "computer-retro" - deconpath = /obj/structure/frame/computer/retro - -/obj/machinery/computer/cargo/express/solgov - icon = 'icons/obj/machines/retro_computer.dmi' - icon_state = "computer-solgov" - deconpath = /obj/structure/frame/computer/solgov - -/obj/machinery/computer/cargo/express/Initialize() - . = ..() - packin_up() - -/obj/machinery/computer/cargo/express/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) - . = ..() - reconnect(port) - -/obj/machinery/computer/cargo/express/proc/reconnect(obj/docking_port/mobile/port) - if(!port) - var/area/ship/current_area = get_area(src) - if(!istype(current_area)) - return - port = current_area.mobile_port - if(!port) - return - charge_account = port.current_ship.ship_account - landingzone = locate(/area/ship/cargo) in port.shuttle_areas - -/obj/machinery/computer/cargo/express/Destroy() - if(beacon) - beacon.unlink_console() - return ..() - -/obj/machinery/computer/cargo/express/attackby(obj/item/W, mob/living/user, params) - var/value = W.get_item_credit_value() - if(value && charge_account) - charge_account.adjust_money(value) - to_chat(user, "You deposit [W]. The Vessel Budget is now [charge_account.account_balance] cr.") - qdel(W) - return TRUE - else if(istype(W, /obj/item/supplypod_beacon)) - var/obj/item/supplypod_beacon/sb = W - if (sb.express_console != src) - sb.link_console(src, user) - return TRUE - else - to_chat(user, "[src] is already linked to [sb].") - ..() - -/obj/machinery/computer/cargo/express/proc/packin_up() // oh shit, I'm sorry - meme_pack_data = list() // sorry for what? - for(var/pack in SSshuttle.supply_packs) // our quartermaster taught us not to be ashamed of our supply packs - var/datum/supply_pack/P = SSshuttle.supply_packs[pack] // specially since they're such a good price and all - if(!meme_pack_data[P.group]) // yeah, I see that, your quartermaster gave you good advice - meme_pack_data[P.group] = list( // it gets cheaper when I return it - "name" = P.group, // mmhm - "packs" = list() // sometimes, I return it so much, I rip the manifest - ) // see, my quartermaster taught me a few things too - if((P.hidden)) // like, how not to rip the manifest - continue// by using someone else's crate - meme_pack_data[P.group]["packs"] += list(list( - "name" = P.name, - "cost" = P.cost, - "id" = pack, - "desc" = P.desc || P.name // If there is a description, use it. Otherwise use the pack's name. - )) - -/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, datum/tgui/ui) - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "OutpostCommunications", name) - ui.open() - if(!charge_account) - reconnect() - -/obj/machinery/computer/cargo/express/ui_data(mob/user) - var/canBeacon = beacon && (isturf(beacon.loc) || ismob(beacon.loc))//is the beacon in a valid location? - var/list/data = list() - - // not a big fan of get_containing_shuttle - var/obj/docking_port/mobile/D = SSshuttle.get_containing_shuttle(src) - var/datum/overmap/ship/controlled/ship - var/outpost_docked = FALSE - if(D) - ship = D.current_ship - outpost_docked = istype(ship.docked_to, /datum/overmap/outpost) - - data["onShip"] = !isnull(ship) - data["numMissions"] = ship ? LAZYLEN(ship.missions) : 0 - data["maxMissions"] = ship ? ship.max_missions : 0 - data["outpostDocked"] = outpost_docked - data["points"] = charge_account ? charge_account.account_balance : 0 - data["siliconUser"] = user.has_unlimited_silicon_privilege && check_ship_ai_access(user) - data["beaconZone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui - data["usingBeacon"] = use_beacon //is the mode set to deliver to the beacon or the cargobay? - data["canBeacon"] = !use_beacon || canBeacon //is the mode set to beacon delivery, and is the beacon in a valid location? - data["canBuyBeacon"] = charge_account ? (cooldown <= 0 && charge_account.account_balance >= BEACON_COST) : FALSE - data["beaconError"] = use_beacon && !canBeacon ? "(BEACON ERROR)" : ""//changes button text to include an error alert if necessary - data["hasBeacon"] = beacon != null//is there a linked beacon? - data["beaconName"] = beacon ? beacon.name : "No Beacon Found" - data["printMsg"] = cooldown > 0 ? "Print Beacon for [BEACON_COST] credits ([cooldown])" : "Print Beacon for [BEACON_COST] credits"//buttontext for printing beacons - data["supplies"] = list() - message = "Sales are near-instantaneous - please choose carefully." - if(SSshuttle.supplyBlocked) - message = blockade_warning - if(use_beacon && !beacon) - message = "BEACON ERROR: BEACON MISSING"//beacon was destroyed - else if (use_beacon && !canBeacon) - message = "BEACON ERROR: MUST BE EXPOSED"//beacon's loc/user's loc must be a turf - data["message"] = message - if(!meme_pack_data) - packin_up() - stack_trace("You didn't give the cargo tech good advice, and he ripped the manifest. As a result, there was no pack data for [src]") - data["supplies"] = meme_pack_data - if (cooldown > 0)//cooldown used for printing beacons - cooldown-- - - data["shipMissions"] = list() - data["outpostMissions"] = list() - - if(ship) - for(var/datum/mission/M as anything in ship.missions) - data["shipMissions"] += list(M.get_tgui_info()) - if(outpost_docked) - var/datum/overmap/outpost/out = ship.docked_to - for(var/datum/mission/M as anything in out.missions) - data["outpostMissions"] += list(M.get_tgui_info()) - - return data - -/obj/machinery/computer/cargo/express/ui_act(action, params, datum/tgui/ui) - . = ..() - if(.) - return - - switch(action) - if("withdrawCash") - var/val = text2num(params["value"]) - // no giving yourself money - if(!charge_account || !val || val <= 0) - return - if(charge_account.adjust_money(-val)) - var/obj/item/holochip/cash_chip = new /obj/item/holochip(drop_location(), val) - if(ishuman(usr)) - var/mob/living/carbon/human/user = usr - user.put_in_hands(cash_chip) - playsound(src, 'sound/machines/twobeep_high.ogg', 50, TRUE) - src.visible_message("[src] dispenses a holochip.") - return TRUE - - if("LZCargo") - use_beacon = FALSE - if (beacon) - beacon.update_status(SP_UNREADY) //ready light on beacon will turn off - if("LZBeacon") - use_beacon = TRUE - if (beacon) - beacon.update_status(SP_READY) //turns on the beacon's ready light - if("printBeacon") - if(charge_account?.adjust_money(-BEACON_COST)) - cooldown = 10//a ~ten second cooldown for printing beacons to prevent spam - var/obj/item/supplypod_beacon/C = new /obj/item/supplypod_beacon(drop_location()) - C.link_console(src, usr)//rather than in beacon's Initialize(), we can assign the computer to the beacon by reusing this proc) - printed_beacons++//printed_beacons starts at 0, so the first one out will be called beacon # 1 - beacon.name = "Supply Pod Beacon #[printed_beacons]" - - if("add") - var/area/ship/current_area = get_area(src) - var/datum/supply_pack/pack = SSshuttle.supply_packs[text2path(params["id"])] - if( \ - !pack || !charge_account?.has_money(pack.cost) || !istype(current_area) || \ - !istype(current_area.mobile_port.current_ship.docked_to, /datum/overmap/outpost) \ - ) - return - - var/turf/landing_turf - if(!isnull(beacon) && use_beacon) // prioritize beacons over landing in cargobay - landing_turf = get_turf(beacon) - beacon.update_status(SP_LAUNCH) - else if(!use_beacon)// find a suitable supplypod landing zone in cargobay - var/list/empty_turfs = list() - if(!landingzone) - reconnect() - if(!landingzone) - WARNING("[src] couldnt find a Ship/Cargo (aka cargobay) area on a ship, and as such it has set the supplypod landingzone to the area it resides in.") - landingzone = get_area(src) - for(var/turf/open/floor/T in landingzone.contents)//uses default landing zone - if(T.is_blocked_turf()) - continue - empty_turfs += T - CHECK_TICK - landing_turf = pick(empty_turfs) - - // note that, because of CHECK_TICK above, we aren't sure if we can - // afford the pack, even though we checked earlier. luckily adjust_money - // returns false if the account can't afford the price - if(landing_turf && charge_account.adjust_money(-pack.cost)) - var/name = "*None Provided*" - var/rank = "*None Provided*" - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - name = H.get_authentification_name() - rank = H.get_assignment(hand_first = TRUE) - else if(issilicon(usr)) - name = usr.real_name - rank = "Silicon" - var/datum/supply_order/SO = new(pack, name, rank, usr.ckey, "") - new /obj/effect/pod_landingzone(landing_turf, podType, SO) - update_appearance() // ?????????????????? - return TRUE - - if("mission-act") - var/datum/mission/mission = locate(params["ref"]) - var/obj/docking_port/mobile/D = SSshuttle.get_containing_shuttle(src) - var/datum/overmap/ship/controlled/ship = D.current_ship - var/datum/overmap/outpost/outpost = ship.docked_to - if(!istype(outpost) || mission.source_outpost != outpost) // important to check these to prevent href fuckery - return - if(!mission.accepted) - if(LAZYLEN(ship.missions) >= ship.max_missions) - return - mission.accept(ship, loc) - return TRUE - else if(mission.servant == ship) - if(mission.can_complete()) - mission.turn_in() - else - mission.give_up() - return TRUE diff --git a/code/modules/cargo/supplypod_beacon.dm b/code/modules/cargo/supplypod_beacon.dm index 11fd10229e5e..b9c41a29e11f 100644 --- a/code/modules/cargo/supplypod_beacon.dm +++ b/code/modules/cargo/supplypod_beacon.dm @@ -7,7 +7,7 @@ lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' w_class = WEIGHT_CLASS_SMALL - var/obj/machinery/computer/cargo/express/express_console + var/obj/machinery/computer/cargo/cargo_console var/linked = FALSE var/ready = FALSE var/launched = FALSE @@ -49,39 +49,39 @@ /obj/item/supplypod_beacon/examine(user) . = ..() - if(!express_console) + if(!cargo_console) . += "[src] is not currently linked to an Express Supply console." else . += "Alt-click to unlink it from the Express Supply console." /obj/item/supplypod_beacon/Destroy() - if(express_console) - express_console.beacon = null + if(cargo_console) + cargo_console.beacon = null return ..() /obj/item/supplypod_beacon/proc/unlink_console() - if(express_console) - express_console.beacon = null - express_console = null + if(cargo_console) + cargo_console.beacon = null + cargo_console = null update_status(SP_UNLINK) update_status(SP_UNREADY) -/obj/item/supplypod_beacon/proc/link_console(obj/machinery/computer/cargo/express/C, mob/living/user) +/obj/item/supplypod_beacon/proc/link_console(obj/machinery/computer/cargo/C, mob/living/user) if (C.beacon)//if new console has a beacon, then... C.beacon.unlink_console()//unlink the old beacon from new console - if (express_console)//if this beacon has an express console - express_console.beacon = null//remove the connection the expressconsole has from beacons - express_console = C//set the linked console var to the console - express_console.beacon = src//out with the old in with the news + if (cargo_console)//if this beacon has an express console + cargo_console.beacon = null//remove the connection the expressconsole has from beacons + cargo_console = C//set the linked console var to the console + cargo_console.beacon = src//out with the old in with the news update_status(SP_LINKED) - if (express_console.use_beacon) + if (cargo_console.use_beacon) update_status(SP_READY) to_chat(user, "[src] linked to [C].") /obj/item/supplypod_beacon/AltClick(mob/user) if (!user.canUseTopic(src, !issilicon(user))) return - if (express_console) + if (cargo_console) unlink_console() else to_chat(user, "There is no linked console.") diff --git a/code/modules/research/designs/mining_designs.dm b/code/modules/research/designs/mining_designs.dm index 2cddc5043c3f..aa221c2b21a7 100644 --- a/code/modules/research/designs/mining_designs.dm +++ b/code/modules/research/designs/mining_designs.dm @@ -8,7 +8,7 @@ id = "cargoexpress"//the coder reading this build_type = IMPRINTER materials = list(/datum/material/glass = 1000) - build_path = /obj/item/circuitboard/computer/cargo/express + build_path = /obj/item/circuitboard/computer/cargo category = list("Mining Designs") departmental_flags = DEPARTMENTAL_FLAG_CARGO diff --git a/shiptest.dme b/shiptest.dme index 4b8478ffbf1b..c0d9a7d4df66 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1882,9 +1882,9 @@ #include "code\modules\cargo\bounty.dm" #include "code\modules\cargo\bounty_console.dm" #include "code\modules\cargo\centcom_podlauncher.dm" +#include "code\modules\cargo\console.dm" #include "code\modules\cargo\export_scanner.dm" #include "code\modules\cargo\exports.dm" -#include "code\modules\cargo\expressconsole.dm" #include "code\modules\cargo\gondolapod.dm" #include "code\modules\cargo\order.dm" #include "code\modules\cargo\packs.dm" diff --git a/tgui/packages/tgui/interfaces/Cargo.js b/tgui/packages/tgui/interfaces/Cargo.js deleted file mode 100644 index 9dfcd417f593..000000000000 --- a/tgui/packages/tgui/interfaces/Cargo.js +++ /dev/null @@ -1,533 +0,0 @@ -import { flow } from 'common/fp'; -import { filter, sortBy } from 'common/collections'; -import { useBackend, useSharedState } from '../backend'; -import { - AnimatedNumber, - Box, - Button, - Flex, - Icon, - Input, - LabeledList, - NoticeBox, - Section, - Stack, - Table, - Tabs, -} from '../components'; -import { formatMoney } from '../format'; -import { Window } from '../layouts'; - -export const Cargo = (props, context) => { - return ( - - - - - - ); -}; - -export const CargoContent = (props, context) => { - const { act, data } = useBackend(context); - const [tab, setTab] = useSharedState(context, 'tab', 'catalog'); - const { requestonly } = data; - const cart = data.cart || []; - const requests = data.requests || []; - return ( - - -
- - setTab('catalog')} - > - Catalog - - 0 && 'yellow'} - selected={tab === 'requests'} - onClick={() => setTab('requests')} - > - Requests ({requests.length}) - - {!requestonly && ( - <> - 0 && 'yellow'} - selected={tab === 'cart'} - onClick={() => setTab('cart')} - > - Checkout ({cart.length}) - - setTab('help')} - > - Help - - - )} - -
- {tab === 'catalog' && } - {tab === 'requests' && } - {tab === 'cart' && } - {tab === 'help' && } -
- ); -}; - -const CargoStatus = (props, context) => { - const { act, data } = useBackend(context); - const { - department, - grocery, - away, - docked, - loan, - loan_dispatched, - location, - message, - points, - requestonly, - can_send, - } = data; - return ( -
- formatMoney(value)} - /> - {' credits'} - - } - > - - - {(docked && !requestonly && can_send && ( -
- ); -}; - -/** - * Take entire supplies tree - * and return a flat supply pack list that matches search, - * sorted by name and only the first page. - * @param {any[]} supplies Supplies list. - * @param {string} search The search term - * @returns {any[]} The flat list of supply packs. - */ -const searchForSupplies = (supplies, search) => { - search = search.toLowerCase(); - - return flow([ - (categories) => categories.flatMap((category) => category.packs), - filter( - (pack) => - pack.name?.toLowerCase().includes(search.toLowerCase()) || - pack.desc?.toLowerCase().includes(search.toLowerCase()) - ), - sortBy((pack) => pack.name), - (packs) => packs.slice(0, 25), - ])(supplies); -}; - -export const CargoCatalog = (props, context) => { - const { express } = props; - const { act, data } = useBackend(context); - - const { self_paid, app_cost } = data; - - const supplies = Object.values(data.supplies); - - const [activeSupplyName, setActiveSupplyName] = useSharedState( - context, - 'supply', - supplies[0]?.name - ); - - const [searchText, setSearchText] = useSharedState( - context, - 'search_text', - '' - ); - - const activeSupply = - activeSupplyName === 'search_results' - ? { packs: searchForSupplies(supplies, searchText) } - : supplies.find((supply) => supply.name === activeSupplyName); - - return ( -
- - act('toggleprivate')} - /> - - ) - } - > - - - - - - - - - - { - if (value === searchText) { - return; - } - - if (value.length) { - // Start showing results - setActiveSupplyName('search_results'); - } else if (activeSupplyName === 'search_results') { - // return to normal category - setActiveSupplyName(supplies[0]?.name); - } - setSearchText(value); - }} - onChange={(e, value) => { - // Allow edge cases like the X button to work - const onInput = e.target?.props?.onInput; - if (onInput) { - onInput(e, value); - } - }} - /> - - - - {supplies.map((supply) => ( - { - setActiveSupplyName(supply.name); - setSearchText(''); - }} - > - {supply.name} ({supply.packs.length}) - - ))} - - - - - {activeSupply?.packs.map((pack) => { - const tags = []; - if (pack.small_item) { - tags.push('Small'); - } - if (pack.access) { - tags.push('Restricted'); - } - return ( - - {pack.name} - - {tags.join(', ')} - - - - - - ); - })} -
-
-
-
- ); -}; - -const CargoRequests = (props, context) => { - const { act, data } = useBackend(context); - const { requestonly, can_send, can_approve_requests } = data; - const requests = data.requests || []; - // Labeled list reimplementation to squeeze extra columns out of it - return ( -
act('denyall')} - /> - ) - } - > - {requests.length === 0 && No Requests} - {requests.length > 0 && ( - - {requests.map((request) => ( - - - #{request.id} - - {request.object} - - {request.orderer} - - - {request.reason} - - - {formatMoney(request.cost)} cr - - {(!requestonly || can_send) && can_approve_requests && ( - -
- )} -
- ); -}; - -const CargoCartButtons = (props, context) => { - const { act, data } = useBackend(context); - const { requestonly, can_send, can_approve_requests } = data; - const cart = data.cart || []; - const total = cart.reduce((total, entry) => total + entry.cost, 0); - if (requestonly || !can_send || !can_approve_requests) { - return null; - } - return ( - <> - - {cart.length === 0 && 'Cart is empty'} - {cart.length === 1 && '1 item'} - {cart.length >= 2 && cart.length + ' items'}{' '} - {total > 0 && `(${formatMoney(total)} cr)`} - -