Skip to content

Commit

Permalink
[MIRROR] Supply QoL changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HeyBanditoz authored and SierraHelper committed Nov 1, 2024
1 parent 15848fe commit 222ed50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,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
Expand All @@ -243,6 +258,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
Expand All @@ -254,6 +271,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
Expand Down
1 change: 1 addition & 0 deletions nano/templates/supply.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
{{#def.supply_request_item}}
<td>
{{:helper.link('Cancel', 'cancel', {'cancel_order' : value.id})}}
{{:helper.link('Pending', 'arrow_up', {'order_back_to_pending' : value.id})}}
{{:helper.link('Print', 'print', {'print_receipt' : value.id, 'list_id' : value.list_id}, data.can_print ? null : 'disabled')}}
{{/for}}
</table>
Expand Down

0 comments on commit 222ed50

Please sign in to comment.