mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
Expose product and material details in API match UI
This commit is contained in:
@@ -332,10 +332,13 @@ export function NetscriptCorporation(
|
||||
const cityName = helper.string("getMaterial", "cityName", acityName);
|
||||
const materialName = helper.string("getMaterial", "materialName", amaterialName);
|
||||
const material = getMaterial(divisionName, cityName, materialName);
|
||||
const corporation = getCorporation();
|
||||
return {
|
||||
name: material.name,
|
||||
qty: material.qty,
|
||||
qlt: material.qlt,
|
||||
dmd: corporation.unlockUpgrades[2] ? material.dmd : undefined,
|
||||
cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,
|
||||
prod: material.prd,
|
||||
sell: material.sll,
|
||||
};
|
||||
@@ -345,10 +348,13 @@ export function NetscriptCorporation(
|
||||
const divisionName = helper.string("getProduct", "divisionName", adivisionName);
|
||||
const productName = helper.string("getProduct", "productName", aproductName);
|
||||
const product = getProduct(divisionName, productName);
|
||||
const corporation = getCorporation();
|
||||
return {
|
||||
name: product.name,
|
||||
dmd: product.dmd,
|
||||
cmp: product.cmp,
|
||||
dmd: corporation.unlockUpgrades[2] ? product.dmd : undefined,
|
||||
cmp: corporation.unlockUpgrades[3] ? product.cmp : undefined,
|
||||
rat: product.rat,
|
||||
properties: {qlt:product.qlt, per:product.per, dur:product.dur, rel:product.rel, aes:product.aes, fea:product.fea},
|
||||
pCost: product.pCost,
|
||||
sCost: product.sCost,
|
||||
cityData: product.data,
|
||||
|
||||
Reference in New Issue
Block a user