From e598df99c54922cfd16efdcda5102fc16aa19fb4 Mon Sep 17 00:00:00 2001 From: Bobbanz1 <59128051+Bobbanz1@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:16:26 +0200 Subject: [PATCH] Lets one choose whether to receive mail on the shuttle or not. --- code/modules/cargo/orderconsole.dm | 9 +++++++++ code/modules/shuttle/supply.dm | 9 ++++++++- tgui/packages/tgui/interfaces/Cargo.js | 9 +++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/code/modules/cargo/orderconsole.dm b/code/modules/cargo/orderconsole.dm index 0d18a4d4707..56fb49c83e5 100644 --- a/code/modules/cargo/orderconsole.dm +++ b/code/modules/cargo/orderconsole.dm @@ -99,6 +99,9 @@ if(SSshuttle.supplyBlocked) message = blockade_warning data["message"] = message + // NSV13 - Mail Control - Start + data["mail"] = SSshuttle.supply.send_mail + // NSV13 - Mail Control - Stop //NSV13 - Cargo Sleaker UI - Start var/cart_list = list() for(var/datum/supply_order/order in SSshuttle.shoppinglist) @@ -285,6 +288,12 @@ if("toggleprivate") self_paid = !self_paid . = TRUE + // NSV13 - Mail Control - Start + if("togglemail") + var/accepting_mail = SSshuttle.supply.send_mail + SSshuttle.supply.send_mail = !accepting_mail + . = TRUE + // NSV13 - Mail Control - Stop if(.) post_signal("supply") diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 68f29b21953..5be5b8e8e7c 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -44,6 +44,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( //Export categories for this run, this is set by console sending the shuttle. var/export_categories = EXPORT_CARGO + // NSV13 - Mail Control - Start + // Switch used to toggle between the ship being open to receiving mail, or not. + var/send_mail = TRUE + // NSV13 - Mail Control - Stop /obj/docking_port/mobile/supply/register() . = ..() @@ -71,7 +75,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( /obj/docking_port/mobile/supply/initiate_docking() if(getDockedId() == "supply_away") // Buy when we leave home. - create_mail() + // NSV13 - Mail Control - Start + if(send_mail) + create_mail() + // NSV13 - Mail Control - Stop buy() . = ..() // Fly/enter transit. if(. != DOCKING_SUCCESS) diff --git a/tgui/packages/tgui/interfaces/Cargo.js b/tgui/packages/tgui/interfaces/Cargo.js index 259c815fd1a..362c8093d53 100644 --- a/tgui/packages/tgui/interfaces/Cargo.js +++ b/tgui/packages/tgui/interfaces/Cargo.js @@ -92,6 +92,7 @@ const CargoStatus = (props, context) => { points, requestonly, can_send, + mail, // NSV13 - Added Mail Control } = data; return (
{ )} )} + {!requestonly && ( + + act('togglemail')} /> + + )}
);