steam sales.

This commit is contained in:
Ghommie
2020-05-03 02:54:13 +02:00
parent a194d7dafe
commit 53c0ea391e
3 changed files with 10 additions and 11 deletions
+4 -7
View File
@@ -575,13 +575,10 @@ GLOBAL_LIST_EMPTY(vending_products)
var/cost_mult = get_best_discount(C)
if(cost_mult != 1)
.["cost_mult"] = cost_mult
switch(cost_mult)
if(0)
.["cost_text"] = "FREE"
if(0 to 1)
.["cost_text"] = " [(1 - cost_mult) * 100]% OFF"
if(1 to INFINITY)
.["cost_text"] = " [(cost_mult - 1) * 100]% EXTRA"
if(cost < 1)
.["cost_text"] = " [(1 - cost_mult) * 100]% OFF"
else
.["cost_text"] = " [(cost_mult - 1) * 100]% EXTRA"
.["stock"] = list()
for (var/datum/data/vending_product/R in product_records + coin_records + hidden_records)
.["stock"][R.name] = R.amount
@@ -47,6 +47,7 @@ export const Vending = props => {
<Section title="Products" >
<Table>
{inventory.map((product => {
const suffix = ' cr' + data.cost_text;
return (
<Table.Row key={product.name}>
<Table.Cell>
@@ -97,9 +98,10 @@ export const Vending = props => {
)
)
)}
content={(data.cost_mult !== 0
? Math.round(product.price * data.cost_mult) + ' cr'
: '') + data.cost_text}
content={(data.onstation
&& product.price !== 0)
? Math.round(product.price * data.cost_mult) + suffix
: 'FREE'}
onClick={() => act(ref, 'vend', {
'ref': product.ref,
})} />
File diff suppressed because one or more lines are too long