From 65203bbfa0c58ff09f875993fa19b03bb5d290e9 Mon Sep 17 00:00:00 2001 From: Darlantan Date: Sat, 4 Jun 2022 19:38:56 -0400 Subject: [PATCH] switching branches again --- .../dispenser/chem_synthesizer_ch.dm | 16 +- .../tgui/interfaces/ChemSynthesizer.js | 235 ++++++------------ 2 files changed, 90 insertions(+), 161 deletions(-) diff --git a/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm b/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm index 3315b113e8..bfbf4647c6 100644 --- a/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm +++ b/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm @@ -266,7 +266,9 @@ queue -= queue[index] if("clear_queue") // Remove all entries from the queue except the currently processing recipe. - queue = list() + var/confirm = alert(usr, "Are you sure you want to clear the running queue?", "Confirm", "No", "Yes") + if(confirm == "Yes") + queue = list() if("eject_catalyst") // Removes the catalyst bottle from the machine. if(!busy && catalyst) @@ -300,9 +302,15 @@ if("rem_recipe") // Allows the user to remove recipes while the machine is idle. if(!busy) - var/index = params["rm_index"] - if(index in recipes) - recipes -= recipes[index] + var/confirm = alert(usr, "Are you sure you want to remove this recipe?", "Confirm", "No", "Yes") + if(confirm == "Yes") + var/index = params["rm_index"] + if(index in recipes) + recipes -= recipes[index] + if("exp_recipe") + // Allows the user to export recipes to chat formatted for easy importing. + var/index = params["exp_index"] + export_recipe(usr, index) if("add_queue") // Adds recipes to the queue. if(queue.len >= SYNTHESIZER_MAX_QUEUE) diff --git a/tgui/packages/tgui/interfaces/ChemSynthesizer.js b/tgui/packages/tgui/interfaces/ChemSynthesizer.js index 26fc8e270e..2d025df425 100644 --- a/tgui/packages/tgui/interfaces/ChemSynthesizer.js +++ b/tgui/packages/tgui/interfaces/ChemSynthesizer.js @@ -3,182 +3,103 @@ import { useBackend } from "../backend"; import { Box, Button, Flex, Icon, LabeledList, Section } from "../components"; import { Window } from "../layouts"; import { BeakerContents } from './common/BeakerContents'; -import { ComplexModal, modalOpen, modalRegisterBodyOverride } from './common/ComplexModal'; -const transferAmounts = [1, 5, 10, 30, 60]; -const bottleStyles = [ - "bottle.png", - "small_bottle.png", - "wide_bottle.png", - "round_bottle.png", - "reagent_bottle.png", -]; - -const analyzeModalBodyOverride = (modal, context) => { - const { act, data } = useBackend(context); - const result = modal.args.analysis; - return ( -
- - - - {result.name} - - - {(result.desc || "").length > 0 ? result.desc : "N/A"} - - {result.blood_type && ( - - - {result.blood_type} - - - {result.blood_dna} - - - )} - {!data.condi && ( -
- ); -}; - -export const ChemMaster = (props, context) => { - const { data } = useBackend(context); - const { - condi, - beaker, - beaker_reagents = [], - buffer_reagents = [], - mode, - } = data; +export const ChemSynthesizer = (props, context) => { return ( - - - 0} - /> - - 0} - /> - {/* */} + + + + + + ); }; -const ChemMasterBeaker = (props, context) => { +const ChemSynthesizerQueueRecipes = (props, context) => { const { act, data } = useBackend(context); const { - beaker, - beakerReagents, - bufferNonEmpty, - } = props; - - let headerButton = bufferNonEmpty ? ( - act('eject')} - /> - ) : ( -