[MIRROR] Minor improvements to mining order console [MDB IGNORE] (#18467)

* Minor improvements to mining order console

* merge

* Mining orders can no longer error and don't say they charge you (#71676)

- Mining orders now show the amount of mining points spent as the 'Cost'
instead of a flat 240 credits

- Mining orders now no longer have errors (including nothing being in
the crate at all) because they can't be sent back for a full refund.

- Mining orders no longer say they charged you if they haven't.

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2023-01-12 13:40:14 -05:00
committed by GitHub
co-authored by John Willard Tastyfish
parent 4a847b7f0c
commit d184bcec4a
9 changed files with 85 additions and 32 deletions
@@ -125,11 +125,14 @@
data["cart"] = list()
for(var/datum/supply_order/SO in SSshuttle.shopping_list)
data["cart"] += list(list(
"cost_type" = SO.cost_type,
"object" = SO.pack.name,
"cost" = SO.pack.get_cost(),
"id" = SO.id,
"orderer" = SO.orderer,
"paid" = !isnull(SO.paying_account) //paid by requester
"paid" = !isnull(SO.paying_account), //paid by requester
"dep_order" = !!SO.department_destination,
"can_be_cancelled" = SO.can_be_cancelled,
))
data["requests"] = list()
@@ -251,7 +254,10 @@
. = TRUE
break
if("clear")
SSshuttle.shopping_list.Cut()
for(var/datum/supply_order/cancelled_order in SSshuttle.shopping_list)
if(cancelled_order.department_destination || cancelled_order.can_be_cancelled)
continue //don't cancel other department's orders or orders that can't be cancelled
SSshuttle.shopping_list -= cancelled_order
. = TRUE
if("approve")
var/id = text2num(params["id"])