hotfix broken spring water

This commit is contained in:
omuretsu
2023-05-27 01:53:06 -04:00
parent db26d054fc
commit e03a366f12
7 changed files with 21 additions and 28 deletions
@@ -1,7 +1,7 @@
import React from "react";
import { Division } from "../Division";
import { MathJax } from "better-react-mathjax";
import { CorpMaterialName } from "@nsdefs";
import { getRecordEntries } from "../../Types/Record";
interface IProps {
division: Division;
@@ -9,9 +9,8 @@ interface IProps {
export function IndustryProductEquation(props: IProps): React.ReactElement {
const reqs = [];
for (const reqMat of Object.keys(props.division.requiredMaterials) as CorpMaterialName[]) {
const reqAmt = props.division.requiredMaterials[reqMat];
if (reqAmt === undefined) continue;
for (const [reqMat, reqAmt] of getRecordEntries(props.division.requiredMaterials)) {
if (!reqAmt) continue;
reqs.push(String.raw`${reqAmt}\text{ }${reqMat}`);
}
const prod = props.division.producedMaterials.map((p) => `1\\text{ }${p}`);
+2 -4
View File
@@ -23,6 +23,7 @@ import Box from "@mui/material/Box";
import { LimitMaterialProductionModal } from "./modals/LimitMaterialProductionModal";
import { CityName } from "../../Enums";
import { CorpUnlockName } from "../data/Enums";
import { getRecordKeys } from "../../Types/Record";
interface IMaterialProps {
warehouse: Warehouse;
@@ -57,10 +58,7 @@ export function MaterialElem(props: IMaterialProps): React.ReactElement {
// Flag that determines whether this industry is "new" and the current material should be
// marked with flashing-red lights
const tutorial =
division.newInd &&
Object.keys(division.requiredMaterials).includes(mat.name) &&
mat.buyAmount === 0 &&
mat.importAmount === 0;
division.newInd && mat.name in division.requiredMaterials && mat.buyAmount === 0 && mat.importAmount === 0;
// Purchase material button
const purchaseButtonText = `Buy (${formatBigNumber(mat.buyAmount)})`;
@@ -9,8 +9,8 @@ import Typography from "@mui/material/Typography";
import FormControlLabel from "@mui/material/FormControlLabel";
import Switch from "@mui/material/Switch";
import { CorpMaterialName } from "@nsdefs";
import { materialNames } from "../../data/Constants";
import { useRerender } from "../../../ui/React/hooks";
import { getRecordKeys } from "../../../Types/Record";
interface ISSoptionProps {
matName: CorpMaterialName;
@@ -80,9 +80,8 @@ export function SmartSupplyModal(props: IProps): React.ReactElement {
// Create React components for materials
const mats = [];
for (const matName of Object.values(materialNames)) {
for (const matName of getRecordKeys(division.requiredMaterials)) {
if (!props.warehouse.materials[matName]) continue;
if (!Object.keys(division.requiredMaterials).includes(matName)) continue;
mats.push(<SSoption key={matName} warehouse={props.warehouse} matName={matName} />);
}