From f9aa6037f28db8806a51e82575c8bba82e3cdd20 Mon Sep 17 00:00:00 2001 From: fallcon Date: Wed, 15 May 2024 09:55:45 -0500 Subject: [PATCH 01/12] one cargo console --- code/modules/cargo/console.dm | 271 +++++++++++++++++++++++---- code/modules/cargo/expressconsole.dm | 262 -------------------------- shiptest.dme | 1 - 3 files changed, 231 insertions(+), 303 deletions(-) delete mode 100644 code/modules/cargo/expressconsole.dm diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index 143480b2bc71..168aff7c53b8 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -1,8 +1,16 @@ -/obj/machinery/computer/cargo - name = "supply console" - desc = "Used to order supplies, approve requests, and control the shuttle." - icon_screen = "supply" - circuit = /obj/item/circuitboard/computer/cargo +#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 light_color = COLOR_BRIGHT_ORANGE var/requestonly = FALSE @@ -11,14 +19,30 @@ 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 + 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/request +/obj/machinery/computer/cargo name = "supply request console" desc = "Used to request supplies from cargo." icon_screen = "request" @@ -34,8 +58,11 @@ obj_flags |= EMAGGED else obj_flags &= ~EMAGGED + generate_pack_data() /obj/machinery/computer/cargo/Destroy() + if(beacon) + beacon.unlink_console() QDEL_NULL(radio) return ..() @@ -65,43 +92,63 @@ /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() + 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 @@ -132,6 +179,7 @@ . = ..() if(.) return + /* switch(action) if("send") if(!SSshuttle.supply.canMove()) @@ -235,13 +283,156 @@ . = TRUE if(.) post_signal("supply") + */ + 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 -/obj/machinery/computer/cargo/proc/post_signal(command) + 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) - var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS) + // 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(!frequency) + 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 + +/obj/machinery/computer/cargo/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) + . = ..() + reconnect(port) + +/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 + +/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.express_console != src) + sb.link_console(src, user) + return TRUE + else + to_chat(user, "[src] is already linked to [sb].") + ..() + +/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/shiptest.dme b/shiptest.dme index 113d1da2b1ff..95208912ef4c 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1864,7 +1864,6 @@ #include "code\modules\cargo\centcom_podlauncher.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" From 62784f35b3be916b0ddd78d284ad68ffa5cb2f65 Mon Sep 17 00:00:00 2001 From: fallcon Date: Wed, 15 May 2024 09:57:26 -0500 Subject: [PATCH 02/12] one cargo console --- .../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_boyardee.dmm | 2 +- .../independent/independent_dwayne.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 +- _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 +- _maps/shuttles/minutemen/minutemen_vela.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/pirate/pirate_ember.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 +- _maps/shuttles/syndicate/syndicate_aegis.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 +- .../syndicate/syndicate_twinkleshine.dmm | 2 +- .../circuitboards/computer_circuitboards.dm | 2 +- code/modules/cargo/console.dm | 4 +-- code/modules/cargo/supplypod_beacon.dm | 26 +++++++++---------- 47 files changed, 61 insertions(+), 61 deletions(-) diff --git a/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm b/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm index 928318c23ffe..c38ef5e4ecb9 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 202a6c0c0b74..e135ee830da6 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 a55df014f4f9..99fbf890c8d2 100644 --- a/_maps/outpost/nanotrasen_asteroid.dmm +++ b/_maps/outpost/nanotrasen_asteroid.dmm @@ -5588,7 +5588,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 f1595e0ffaa1..ed024c482799 100644 --- a/_maps/shuttles/independent/independent_beluga.dmm +++ b/_maps/shuttles/independent/independent_beluga.dmm @@ -4752,7 +4752,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_boyardee.dmm b/_maps/shuttles/independent/independent_boyardee.dmm index 4ae94900b258..65a3b19fa333 100644 --- a/_maps/shuttles/independent/independent_boyardee.dmm +++ b/_maps/shuttles/independent/independent_boyardee.dmm @@ -2634,7 +2634,7 @@ /turf/open/floor/plating, /area/ship/maintenance) "VR" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 4 }, /turf/open/floor/plasteel/mono/white, diff --git a/_maps/shuttles/independent/independent_dwayne.dmm b/_maps/shuttles/independent/independent_dwayne.dmm index 262ac034dc5a..73f7fb2b03c5 100644 --- a/_maps/shuttles/independent/independent_dwayne.dmm +++ b/_maps/shuttles/independent/independent_dwayne.dmm @@ -1981,7 +1981,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_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 7e96d8f93b53..7a3b3866dbb1 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 13599cc298cf..3f2982869c83 100644 --- a/_maps/shuttles/independent/independent_shetland.dmm +++ b/_maps/shuttles/independent/independent_shetland.dmm @@ -5480,7 +5480,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/inteq/inteq_colossus.dmm b/_maps/shuttles/inteq/inteq_colossus.dmm index d5ed70873819..f92f355ced7c 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 45ecbf33d0a7..2c6d214e23d7 100644 --- a/_maps/shuttles/inteq/inteq_talos.dmm +++ b/_maps/shuttles/inteq/inteq_talos.dmm @@ -2330,7 +2330,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 b98d0f2f13cd..f6aacdb8dede 100644 --- a/_maps/shuttles/inteq/inteq_valor.dmm +++ b/_maps/shuttles/inteq/inteq_valor.dmm @@ -3940,7 +3940,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 927f372ab3c5..2dbf88049114 100644 --- a/_maps/shuttles/inteq/inteq_vaquero.dmm +++ b/_maps/shuttles/inteq/inteq_vaquero.dmm @@ -2898,7 +2898,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/minutemen/minutemen_vela.dmm b/_maps/shuttles/minutemen/minutemen_vela.dmm index d4ae92298e58..10b4d6b91fe5 100644 --- a/_maps/shuttles/minutemen/minutemen_vela.dmm +++ b/_maps/shuttles/minutemen/minutemen_vela.dmm @@ -6706,7 +6706,7 @@ /turf/open/floor/plasteel/tech/techmaint, /area/ship/crew/toilet) "LB" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /turf/open/floor/plasteel/telecomms_floor, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm b/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm index 04484c12141b..92133f805b5b 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_delta.dmm @@ -2351,7 +2351,7 @@ dir = 4 }, /obj/effect/turf_decal/corner/opaque/blue, -/obj/machinery/computer/cargo/express/retro{ +/obj/machinery/computer/cargo/retro{ dir = 8 }, /turf/open/floor/plasteel/dark, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm b/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm index 8a34bb9ff0ff..41344dc6c26e 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_gecko.dmm @@ -4291,7 +4291,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 107044c9e80f..50b046ac4583 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 e4f74b4577e2..329ea697dedf 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 288fd6235cf8..92a029bdcddf 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_ranger.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_ranger.dmm @@ -465,7 +465,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 bc4db627e44b..92d33ff413d0 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm @@ -4240,7 +4240,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 f06f4e5dbc66..c83a664aa420 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/pirate/pirate_ember.dmm b/_maps/shuttles/pirate/pirate_ember.dmm index 6173f14db95b..e295f6894d05 100644 --- a/_maps/shuttles/pirate/pirate_ember.dmm +++ b/_maps/shuttles/pirate/pirate_ember.dmm @@ -4794,7 +4794,7 @@ /obj/effect/turf_decal/techfloor{ dir = 4 }, -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /obj/machinery/vending/wallmed{ diff --git a/_maps/shuttles/roumain/srm_elder.dmm b/_maps/shuttles/roumain/srm_elder.dmm index ff5841d98df5..5e306ccf8fdc 100644 --- a/_maps/shuttles/roumain/srm_elder.dmm +++ b/_maps/shuttles/roumain/srm_elder.dmm @@ -3573,7 +3573,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 d0359b5ca240..e0c320cea60a 100644 --- a/_maps/shuttles/solgov/solgov_chronicle.dmm +++ b/_maps/shuttles/solgov/solgov_chronicle.dmm @@ -351,7 +351,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 25c1da558e56..1dac26de9886 100644 --- a/_maps/shuttles/solgov/solgov_inkwell.dmm +++ b/_maps/shuttles/solgov/solgov_inkwell.dmm @@ -2120,7 +2120,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 1eb02eac6a21..a9d8dc16418e 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_aegis.dmm b/_maps/shuttles/syndicate/syndicate_aegis.dmm index e001e89d1383..02d2f27ea512 100644 --- a/_maps/shuttles/syndicate/syndicate_aegis.dmm +++ b/_maps/shuttles/syndicate/syndicate_aegis.dmm @@ -2747,7 +2747,7 @@ /turf/open/floor/mineral/plastitanium/red, /area/ship/hallway/central) "Ae" = ( -/obj/machinery/computer/cargo/express{ +/obj/machinery/computer/cargo{ dir = 8 }, /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 93600539c4b4..acff2c861669 100644 --- a/_maps/shuttles/syndicate/syndicate_gorlex_hyena.dmm +++ b/_maps/shuttles/syndicate/syndicate_gorlex_hyena.dmm @@ -961,7 +961,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 fc7e7a029b82..a87d7bdaf0b8 100644 --- a/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm +++ b/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm @@ -3510,7 +3510,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 1330108a6874..8df7f9dc4353 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_twinkleshine.dmm b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm index 5878f667db1e..df6d26bcd76c 100644 --- a/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm +++ b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm @@ -1579,7 +1579,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/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 54dcfb36c131..2e0340e872c9 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -383,7 +383,7 @@ /obj/item/circuitboard/computer/cargo/express name = "Outpost Comms Console (Computer Board)" - build_path = /obj/machinery/computer/cargo/express + build_path = /obj/machinery/computer/cargo /obj/item/circuitboard/computer/cargo/express/multitool_act(mob/living/user) return diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index 168aff7c53b8..ae6d8512365a 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -5,7 +5,7 @@ #define SP_UNLINK 4 #define SP_UNREADY 5 -/obj/machinery/computer/cargo/express +/obj/machinery/computer/cargo 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." @@ -402,7 +402,7 @@ return TRUE else if(istype(W, /obj/item/supplypod_beacon)) var/obj/item/supplypod_beacon/sb = W - if (sb.express_console != src) + if (sb.cargo_console != src) sb.link_console(src, user) return TRUE else diff --git a/code/modules/cargo/supplypod_beacon.dm b/code/modules/cargo/supplypod_beacon.dm index 11fd10229e5e..07a300d29ca9 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) 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.") From 6ff0ac361711e4bec159da58c19760c2f9805561 Mon Sep 17 00:00:00 2001 From: fallcon Date: Wed, 15 May 2024 10:17:15 -0500 Subject: [PATCH 03/12] javascript stuff --- code/modules/cargo/console.dm | 9 - tgui/packages/tgui/interfaces/Cargo.js | 533 ------------------ .../OutpostCommunications/Catalog.js | 192 +++++++ .../index.tsx} | 39 +- .../interfaces/OutpostCommunications/types.ts | 28 + 5 files changed, 226 insertions(+), 575 deletions(-) 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/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index ae6d8512365a..aa4d9764072c 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -13,7 +13,6 @@ circuit = /obj/item/circuitboard/computer/cargo/express 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 \ @@ -42,13 +41,6 @@ /// The account to charge purchases to, defaults to the cargo budget var/datum/bank_account/charge_account -/obj/machinery/computer/cargo - name = "supply request console" - desc = "Used to request supplies from cargo." - icon_screen = "request" - circuit = /obj/item/circuitboard/computer/cargo/request - requestonly = TRUE - /obj/machinery/computer/cargo/Initialize() . = ..() radio = new /obj/item/radio/headset/headset_cargo(src) @@ -154,7 +146,6 @@ /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] 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)`} - -