Made fermichem displays work correctly. (#13577)

This commit is contained in:
Putnam3145
2020-10-16 13:27:37 -07:00
committed by GitHub
parent 4534dec889
commit 099a82b936
5 changed files with 12 additions and 6 deletions

View File

@@ -107,7 +107,7 @@
data["beakerMaxVolume"] = beaker ? beaker.volume : null
//purity and pH accuracy
for(var/obj/item/stock_parts/micro_laser/M in component_parts)
data["partRating"]= 10**(M.rating-1)
data["partRating"]= M.rating
if(M.rating == 4)
data["showPurity"] = 1
else

View File

@@ -182,6 +182,13 @@ export const ChemDispenser = (props, context) => {
units of {chemical.name}
</Box>
))}
<Box
key={"pH"}>
pH:
<AnimatedNumber
initial={7.0}
value={data.beakerCurrentpH} />
</Box>
</LabeledList.Item>
</LabeledList>
</Section>

View File

@@ -15,7 +15,6 @@ export const ChemHeater = (props, context) => {
beakerCurrentVolume,
beakerMaxVolume,
beakerContents = [],
currentpH,
} = data;
return (
<Window
@@ -64,8 +63,7 @@ export const ChemHeater = (props, context) => {
buttons={!!isBeakerLoaded && (
<Fragment>
<Box inline color="label" mr={2}>
{beakerCurrentVolume} / {beakerMaxVolume} units,
{data.currentpH} pH
{beakerCurrentVolume} / {beakerMaxVolume} units
</Box>
<Button
icon="eject"
@@ -76,6 +74,7 @@ export const ChemHeater = (props, context) => {
<BeakerContents
beakerLoaded={isBeakerLoaded}
beakerContents={beakerContents} />
<Box key="pH" color="label">{Number(data.currentpH).toFixed(data.partRating)} pH</Box>
</Section>
</Window.Content>
</Window>

View File

@@ -15,7 +15,7 @@ export const BeakerContents = props => {
)}
{beakerContents.map(chemical => (
<Box key={chemical.name} color="label">
{chemical.volume} units of {chemical.name}
{chemical.volume} units of {chemical.name} {chemical.purity < 1 && "(Purity: "+chemical.purity+")"}
</Box>
))}
</Box>

File diff suppressed because one or more lines are too long