mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 06:17:04 +02:00
CORPORATION: fixed Sell Buttons (#564)
This commit is contained in:
@@ -44,7 +44,6 @@ export function MaterialElem(props: IMaterialProps): React.ReactElement {
|
||||
const warehouse = props.warehouse;
|
||||
const city = props.city;
|
||||
const mat = props.mat;
|
||||
const markupLimit = mat.getMarkupLimit();
|
||||
const office = division.offices[city];
|
||||
if (!office) {
|
||||
throw new Error(`Could not get OfficeSpace object for this city (${city})`);
|
||||
@@ -68,7 +67,7 @@ export function MaterialElem(props: IMaterialProps): React.ReactElement {
|
||||
if (isString(mat.desiredSellAmount)) {
|
||||
sellButtonText = (
|
||||
<>
|
||||
Sell ({formatBigNumber(mat.actualSellAmount)}/{mat.desiredSellAmount[1]})
|
||||
Sell ({formatBigNumber(mat.actualSellAmount)}/{mat.desiredSellAmount})
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
@@ -78,35 +77,9 @@ export function MaterialElem(props: IMaterialProps): React.ReactElement {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (mat.marketTa2) {
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={mat.marketTa2Price} />
|
||||
</>
|
||||
);
|
||||
} else if (mat.marketTa1) {
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={mat.marketPrice + markupLimit} />
|
||||
</>
|
||||
);
|
||||
} else if (mat.desiredSellPrice) {
|
||||
if (isString(mat.desiredSellPrice)) {
|
||||
const sCost = mat.desiredSellPrice.replace(/MP/g, mat.marketPrice + "");
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={eval(sCost)} />
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={mat.desiredSellPrice} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
<>
|
||||
{sellButtonText} @ <Money money={mat.uiMarketPrice} />
|
||||
</>;
|
||||
} else {
|
||||
sellButtonText = <>Sell (0.000/0.000)</>;
|
||||
}
|
||||
|
||||
@@ -66,37 +66,11 @@ export function ProductElem(props: IProductProps): React.ReactElement {
|
||||
sellButtonText = <>Sell (0.000/0.000)</>;
|
||||
}
|
||||
|
||||
if (product.marketTa2) {
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={product.marketTa2Price[city]} />
|
||||
</>
|
||||
);
|
||||
} else if (product.marketTa1) {
|
||||
const markupLimit = product.rating / product.markup;
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={product.productionCost + markupLimit} />
|
||||
</>
|
||||
);
|
||||
} else if (product.cityData[city].desiredSellPrice) {
|
||||
const desiredSellPrice = product.cityData[city].desiredSellPrice;
|
||||
if (isString(desiredSellPrice)) {
|
||||
const sCost = desiredSellPrice.replace(/MP/g, product.productionCost + product.rating / product.markup + "");
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={eval(sCost)} />
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={product.cityData[city].desiredSellPrice} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
sellButtonText = (
|
||||
<>
|
||||
{sellButtonText} @ <Money money={product.uiMarketPrice[city]} />
|
||||
</>
|
||||
);
|
||||
// Limit Production button
|
||||
const productionLimit = product.cityData[city].productionLimit;
|
||||
const limitProductionButtonText =
|
||||
|
||||
Reference in New Issue
Block a user