From 5f1eca73d87adebfdcc24376b72278036ec5b49d Mon Sep 17 00:00:00 2001 From: Sierra Helper <125094432+SierraHelper@users.noreply.github.com> Date: Sun, 24 Nov 2024 06:41:51 +0300 Subject: [PATCH] [MIRROR] Supply QoL changes (#2787) Co-authored-by: HeyBanditoz <7574664+HeyBanditoz@users.noreply.github.com> Co-authored-by: Lexanx <61974560+Lexanx@users.noreply.github.com> --- .../file_system/programs/generic/supply.dm | 19 +++++++++++++++++++ nano/templates/supply.tmpl | 1 + 2 files changed, 20 insertions(+) diff --git a/code/modules/modular_computers/file_system/programs/generic/supply.dm b/code/modules/modular_computers/file_system/programs/generic/supply.dm index 3d1cd79436ef7..34491246d9062 100644 --- a/code/modules/modular_computers/file_system/programs/generic/supply.dm +++ b/code/modules/modular_computers/file_system/programs/generic/supply.dm @@ -231,9 +231,24 @@ return 1 + if(href_list["order_back_to_pending"]) + var/id = text2num(href_list["order_back_to_pending"]) + var/datum/supply_order/SO = find_order_by_id(id, SSsupply.shoppinglist) + if(SO) + SSsupply.requestlist += SO + SSsupply.shoppinglist -= SO + SSsupply.points += SO.object.cost + + else + to_chat(user, SPAN_WARNING("Could not find order number [id] to move back to pending.")) + + return 1 + if(href_list["deny_order"]) var/id = text2num(href_list["deny_order"]) var/datum/supply_order/SO = find_order_by_id(id, SSsupply.requestlist) + if(alert(user, "Are you sure?", "Deny Order", "Yes", "No") != "Yes") + return 1 if(SO) SSsupply.requestlist -= SO else @@ -244,6 +259,8 @@ if(href_list["cancel_order"]) var/id = text2num(href_list["cancel_order"]) var/datum/supply_order/SO = find_order_by_id(id, SSsupply.shoppinglist) + if(alert(user, "Are you sure?", "Cancel Order", "Yes", "No") != "Yes") + return 1 if(SO) SSsupply.shoppinglist -= SO SSsupply.points += SO.object.cost @@ -255,6 +272,8 @@ if(href_list["delete_order"]) var/id = text2num(href_list["delete_order"]) var/datum/supply_order/SO = find_order_by_id(id, SSsupply.donelist) + if(alert(user, "Are you sure?", "Delete Order", "Yes", "No") != "Yes") + return 1 if(SO) SSsupply.donelist -= SO else diff --git a/nano/templates/supply.tmpl b/nano/templates/supply.tmpl index 7c847b3a6a96c..30982c0b1c576 100644 --- a/nano/templates/supply.tmpl +++ b/nano/templates/supply.tmpl @@ -161,6 +161,7 @@ {{#def.supply_request_item}}