diff --git a/code/modules/reqs/supply.dm b/code/modules/reqs/supply.dm index 1749b77dd95a3..b718fe6370657 100644 --- a/code/modules/reqs/supply.dm +++ b/code/modules/reqs/supply.dm @@ -333,7 +333,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/cost = 0 for(var/P in SO.pack) var/datum/supply_packs/SP = P - packs += SP.type + if(packs[SP.type]) + packs[SP.type] += 1 + else + packs[SP.type] = 1 cost += SP.cost .["requests"] += list(list("id" = SO.id, "orderer" = SO.orderer, "orderer_rank" = SO.orderer_rank, "reason" = SO.reason, "cost" = cost, "packs" = packs, "authed_by" = SO.authorised_by)) .["deniedrequests"] = list() @@ -345,7 +348,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/cost = 0 for(var/P in SO.pack) var/datum/supply_packs/SP = P - packs += SP.type + if(packs[SP.type]) + packs[SP.type] += 1 + else + packs[SP.type] = 1 cost += SP.cost .["deniedrequests"] += list(list("id" = SO.id, "orderer" = SO.orderer, "orderer_rank" = SO.orderer_rank, "reason" = SO.reason, "cost" = cost, "packs" = packs, "authed_by" = SO.authorised_by)) .["approvedrequests"] = list() @@ -355,8 +361,12 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( continue var/list/packs = list() var/cost = 0 - for(var/datum/supply_packs/SP AS in SO.pack) - packs += SP.type + for(var/P in SO.pack) + var/datum/supply_packs/SP = P + if(packs[SP.type]) + packs[SP.type] += 1 + else + packs[SP.type] = 1 cost += SP.cost .["approvedrequests"] += list(list("id" = SO.id, "orderer" = SO.orderer, "orderer_rank" = SO.orderer_rank, "reason" = SO.reason, "cost" = cost, "packs" = packs, "authed_by" = SO.authorised_by)) .["awaiting_delivery"] = list() @@ -537,7 +547,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/cost = 0 for(var/P in SO.pack) var/datum/supply_packs/SP = P - packs += SP.type + if(packs[SP.type]) + packs[SP.type] += 1 + else + packs[SP.type] = 1 cost += SP.cost .["requests"] += list(list("id" = SO.id, "orderer" = SO.orderer, "orderer_rank" = SO.orderer_rank, "reason" = SO.reason, "cost" = cost, "packs" = packs, "authed_by" = SO.authorised_by)) .["deniedrequests"] = list() @@ -549,7 +562,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/cost = 0 for(var/P in SO.pack) var/datum/supply_packs/SP = P - packs += SP.type + if(packs[SP.type]) + packs[SP.type] += 1 + else + packs[SP.type] = 1 cost += SP.cost .["deniedrequests"] += list(list("id" = SO.id, "orderer" = SO.orderer, "orderer_rank" = SO.orderer_rank, "reason" = SO.reason, "cost" = cost, "packs" = packs, "authed_by" = SO.authorised_by)) .["approvedrequests"] = list() @@ -561,7 +577,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/cost = 0 for(var/P in SO.pack) var/datum/supply_packs/SP = P - packs += SP.type + if(packs[SP.type]) + packs[SP.type] += 1 + else + packs[SP.type] = 1 cost += SP.cost .["approvedrequests"] += list(list("id" = SO.id, "orderer" = SO.orderer, "orderer_rank" = SO.orderer_rank, "reason" = SO.reason, "cost" = cost, "packs" = packs, "authed_by" = SO.authorised_by)) if(!SSpoints.request_shopping_cart[user.ckey]) diff --git a/tgui/packages/tgui/interfaces/Cargo.jsx b/tgui/packages/tgui/interfaces/Cargo.jsx index f4debf0996fad..8478fa14cef2b 100644 --- a/tgui/packages/tgui/interfaces/Cargo.jsx +++ b/tgui/packages/tgui/interfaces/Cargo.jsx @@ -51,7 +51,7 @@ export const Cargo = (props) => { : null; return ( - + @@ -309,18 +309,21 @@ const Packs = (props) => { const { act, data } = useBackend(); const { packs } = props; - return packs.map((pack) => ); + return Object.keys(packs).map((pack) => ( + + )); }; const Pack = (props) => { const { act, data } = useBackend(); - const { pack } = props; + const { pack, amount } = props; const { supplypackscontents } = data; const { name, cost, contains } = supplypackscontents[pack]; + return !!contains && contains.constructor === Object ? ( } + title={} > @@ -332,12 +335,12 @@ const Pack = (props) => { }; const PackName = (props) => { - const { cost, name, pl } = props; - + const { cost, name, pl, amount } = props; return ( - - {cost} points + + {amount ? amount + 'x' : ''} + {cost} points {amount ? '(' + amount * cost + ')' : ''} {name}