Skip to content

Commit

Permalink
Lets Players choose whether to receive mail on the supply shuttle or …
Browse files Browse the repository at this point in the history
…not. (#2546)
  • Loading branch information
Bobbanz1 authored Oct 14, 2023
1 parent de9542c commit ec8c0d6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions code/modules/cargo/orderconsole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")

Expand Down
9 changes: 8 additions & 1 deletion code/modules/shuttle/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
. = ..()
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions tgui/packages/tgui/interfaces/Cargo.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const CargoStatus = (props, context) => {
points,
requestonly,
can_send,
mail, // NSV13 - Added Mail Control
} = data;
return (
<Section
Expand Down Expand Up @@ -129,6 +130,14 @@ const CargoStatus = (props, context) => {
)}
</LabeledList.Item>
)}
{!requestonly && (
<LabeledList.Item label="Mail Status">
<Button.Checkbox
content="Accepting Mail"
checked={mail}
onClick={() => act('togglemail')} />
</LabeledList.Item>
)}
</LabeledList>
</Section>
);
Expand Down

0 comments on commit ec8c0d6

Please sign in to comment.