From c3946af66695f2b018d20464ce7d6065afe9918b Mon Sep 17 00:00:00 2001 From: phyzical Date: Sun, 17 Apr 2022 10:59:38 +0800 Subject: [PATCH] moved the disabled button over to the buy material modal to allow bulk purchasing while smart supply is on --- src/Corporation/ui/MaterialElem.tsx | 9 ++++----- src/Corporation/ui/modals/PurchaseMaterialModal.tsx | 11 +++++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Corporation/ui/MaterialElem.tsx b/src/Corporation/ui/MaterialElem.tsx index fcc0ca6c0..4f37eba1f 100644 --- a/src/Corporation/ui/MaterialElem.tsx +++ b/src/Corporation/ui/MaterialElem.tsx @@ -162,11 +162,7 @@ export function MaterialElem(props: IMaterialProps): React.ReactElement { Purchase your required materials to get production started! : ""} > - @@ -174,6 +170,9 @@ export function MaterialElem(props: IMaterialProps): React.ReactElement { mat={mat} warehouse={warehouse} open={purchaseMaterialOpen} + disablePurchaseLimit={ + props.warehouse.smartSupplyEnabled && Object.keys(division.reqMats).includes(props.mat.name) + } onClose={() => setPurchaseMaterialOpen(false)} /> diff --git a/src/Corporation/ui/modals/PurchaseMaterialModal.tsx b/src/Corporation/ui/modals/PurchaseMaterialModal.tsx index 2cd9dd1ea..c03486f0b 100644 --- a/src/Corporation/ui/modals/PurchaseMaterialModal.tsx +++ b/src/Corporation/ui/modals/PurchaseMaterialModal.tsx @@ -106,6 +106,7 @@ interface IProps { onClose: () => void; mat: Material; warehouse: Warehouse; + disablePurchaseLimit: boolean; } // Create a popup that lets the player purchase a Material @@ -143,6 +144,7 @@ export function PurchaseMaterialModal(props: IProps): React.ReactElement { Enter the amount of {props.mat.name} you would like to purchase per second. This material's cost changes constantly. + {props.disablePurchaseLimit ? "Note: Purchase amount is disabled as smart supply is enabled" : ""} - - + + {division.hasResearch("Bulk Purchasing") && ( )}