mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
Corp API: Add setSmartSupplyUseLeftovers
The API can already toggle smart supply on/off, but can't manage the related controls for whether smart supply will draw from the existing materials in the warehouse. Without it, we can't keep some resources in storage to boost the production multiplier without disabling smart supply entirely.
This commit is contained in:
@@ -49,6 +49,7 @@ import {
|
||||
SetMaterialMarketTA2,
|
||||
SetProductMarketTA1,
|
||||
SetProductMarketTA2,
|
||||
SetSmartSupplyUseLeftovers,
|
||||
} from "../Corporation/Actions";
|
||||
import { CorporationUnlockUpgrades } from "../Corporation/data/CorporationUnlockUpgrades";
|
||||
import { CorporationUpgrades } from "../Corporation/data/CorporationUpgrades";
|
||||
@@ -410,6 +411,16 @@ export function NetscriptCorporation(
|
||||
const warehouse = getWarehouse(divisionName, cityName);
|
||||
SetSmartSupply(warehouse, enabled);
|
||||
},
|
||||
setSmartSupplyUseLeftovers: function (adivisionName: any, acityName: any, amaterialName: any, aenabled: any): void {
|
||||
checkAccess("setSmartSupplyUseLeftovers", 7);
|
||||
const divisionName = helper.string("setSmartSupply", "divisionName", adivisionName);
|
||||
const cityName = helper.string("sellProduct", "cityName", acityName);
|
||||
const materialName = helper.string("sellProduct", "materialName", amaterialName);
|
||||
const enabled = helper.boolean(aenabled);
|
||||
const warehouse = getWarehouse(divisionName, cityName);
|
||||
const material = getMaterial(divisionName, cityName, materialName);
|
||||
SetSmartSupplyUseLeftovers(warehouse, material, enabled);
|
||||
},
|
||||
buyMaterial: function (adivisionName: any, acityName: any, amaterialName: any, aamt: any): void {
|
||||
checkAccess("buyMaterial", 7);
|
||||
const divisionName = helper.string("buyMaterial", "divisionName", adivisionName);
|
||||
|
||||
Reference in New Issue
Block a user