From 656a78c3ff9a4365abf5d6d822657459985e3806 Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Mon, 19 Apr 2021 10:04:25 -0700 Subject: [PATCH 1/8] Fix R&D Console confusing Imprinter <-> Protolathe Mentioned in VOREStation/VOREStation#10156 Fixes VOREStation/VOREStation#9177 Fixes VOREStation/VOREStation#9387 Fixes VOREStation/VOREStation#9929 These were caused by forgetting to update the shared UI component between the protolathe and circuit imprinter to call different actions based on the machine it's servicing. It always called the protolathe versions and never the circuit imprinter. --- .../tgui/interfaces/ResearchConsole.js | 177 ++++++++++-------- 1 file changed, 101 insertions(+), 76 deletions(-) diff --git a/tgui/packages/tgui/interfaces/ResearchConsole.js b/tgui/packages/tgui/interfaces/ResearchConsole.js index 7a7e2c021b9..8c26858db29 100644 --- a/tgui/packages/tgui/interfaces/ResearchConsole.js +++ b/tgui/packages/tgui/interfaces/ResearchConsole.js @@ -98,13 +98,17 @@ const ResearchConsoleViewDesigns = (props, context) => { value={data.search} onInput={(e, v) => act("search", { search: v })} mb={1} /> - - {designs.map(design => ( - - {design.desc} - - ))} - + {(designs && designs.length && ( + + {designs.map(design => ( + + {design.desc} + + ))} + + )) || ( + No designs found. + )} ); }; @@ -189,22 +193,22 @@ const TechDisk = (props, context) => { ) || ( - - This disk has no data stored on it. + + This disk has no data stored on it. - - - - )} + + )} ); }; @@ -228,7 +232,7 @@ const DataDisk = (props, context) => { if (saveDialog) { return ( -
} buttons={ @@ -301,22 +305,22 @@ const DataDisk = (props, context) => { ) || ( - - - This disk has no data stored on it. + + + This disk has no data stored on it. - - - - )} + + )} ); }; @@ -380,10 +384,10 @@ const ResearchConsoleDestructiveAnalyzer = (props, context) => { {tech.level}  {tech.current && "(Current: " + tech.current + ")"} )) || ( - - No origin tech found. - - )} + + No origin tech found. + + )} @@ -401,10 +405,10 @@ const ResearchConsoleDestructiveAnalyzer = (props, context) => { ) || ( - - No Item Loaded. Standing-by... - - )} + + No Item Loaded. Standing-by... + + )}
); }; @@ -439,7 +443,7 @@ const ResearchConsoleBuildMenu = (props, context) => { value={data.search} onInput={(e, v) => act("search", { search: v })} mb={1} /> - {designs.length ? designs.map(design => ( + {designs && designs.length ? designs.map(design => ( @@ -520,6 +524,25 @@ const ResearchConsoleConstructor = (props, context) => { const [protoTab, setProtoTab] = useSharedState(context, "protoTab", 0); + let queueColor = "transparent"; + let queueSpin = false; + let queueIcon = "layer-group"; + if (busy) { + queueIcon = "hammer"; + queueColor = "average"; + queueSpin = true; + } else if (queue && queue.length) { + queueIcon = "sync"; + queueColor = "green"; + queueSpin = true; + } + + // Proto vs Circuit differences + let removeQueueAction = (name === "Protolathe") ? "removeP" : "removeI"; + let ejectSheetAction = (name === "Protolathe") ? "lathe_ejectsheet" : "imprinter_ejectsheet"; + let ejectChemAction = (name === "Protolathe") ? "disposeP" : "disposeI"; + let ejectAllChemAction = (name === "Protolathe") ? "disposeallP" : "disposeallI"; + return (
{ Build setProtoTab(1)}> Queue @@ -588,7 +611,7 @@ const ResearchConsoleConstructor = (props, context) => { @@ -602,16 +625,16 @@ const ResearchConsoleConstructor = (props, context) => { ); }) || ( - - Queue Empty. - - )} + + Queue Empty. + + )} ) || protoTab === 2 && ( @@ -631,14 +654,14 @@ const ResearchConsoleConstructor = (props, context) => { disabled={!mat.removable} onClick={() => { setEjectAmt(0); - act("lathe_ejectsheet", { lathe_ejectsheet: mat.name, amount: ejectAmt }); + act(ejectSheetAction, { [ejectSheetAction]: mat.name, amount: ejectAmt }); }}> Num @@ -657,28 +680,28 @@ const ResearchConsoleConstructor = (props, context) => { )) || ( - - No chems detected - - )} + + No chems detected + + )} ) || ( - - Error - - )} + + Error + + )}
); }; @@ -729,13 +752,13 @@ const ResearchConsoleSettings = (props, context) => {
) || ( - - )} + + )} - - - )} + + )} ); }; @@ -305,22 +305,22 @@ const DataDisk = (props, context) => { ) || ( - - - This disk has no data stored on it. + + + This disk has no data stored on it. - - - - )} + + )} ); }; @@ -384,10 +384,10 @@ const ResearchConsoleDestructiveAnalyzer = (props, context) => { {tech.level}  {tech.current && "(Current: " + tech.current + ")"} )) || ( - - No origin tech found. - - )} + + No origin tech found. + + )} @@ -405,10 +405,10 @@ const ResearchConsoleDestructiveAnalyzer = (props, context) => { ) || ( - - No Item Loaded. Standing-by... - - )} + + No Item Loaded. Standing-by... + + )} ); }; @@ -631,10 +631,10 @@ const ResearchConsoleConstructor = (props, context) => { ); }) || ( - - Queue Empty. - - )} + + Queue Empty. + + )} ) || protoTab === 2 && ( @@ -685,10 +685,10 @@ const ResearchConsoleConstructor = (props, context) => { )) || ( - - No chems detected - - )} + + No chems detected + + )} ) || ( - - Error - - )} + + Error + + )} ); }; @@ -752,13 +752,13 @@ const ResearchConsoleSettings = (props, context) => { ) || ( - - )} + + )}