From dc2739c8986fe40fb22297f4957e3d068bc51faa Mon Sep 17 00:00:00 2001 From: Hatterhat <31829017+Hatterhat@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:35:39 -0500 Subject: [PATCH] ChemMaster QoL: Reusable Custom Transfer Amounts (#96563) ## About The Pull Request https://github.com/user-attachments/assets/a6c6d3d9-3284-4a45-80c4-14dbc4956cf8 Adds custom transfer amount functionality to the ChemMaster UI through a number input (by the eject button) and paired button. ## Why It's Good For The Game If I have to hit the one-off custom transfer button, several times in a row, for my artisanal chemical atrocities one more time, I'm going to lose it. Less-jokingly, maybe someone has some oddly specific mixing things they need it for (I know I do!). --- .../chemistry/machinery/chem_master.dm | 15 +++++++++ tgui/packages/tgui/interfaces/ChemMaster.tsx | 32 ++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index a3a33ba7f8e..a5c83ed2519 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -32,6 +32,8 @@ var/printing_speed = 0.75 SECONDS /// Amount of layers which printed pills will be coated in var/pill_layers = 3 + /// Current custom transfer amount + var/custom_transfer_amount = 15 /obj/machinery/chem_master/Initialize(mapload) create_reagents(100) @@ -281,6 +283,7 @@ .["selectedPillDuration"] = pill_layers var/obj/item/held_item = user.get_active_held_item() .["hasBeakerInHand"] = held_item?.is_chem_container() || FALSE + .["customTransferAmount"] = custom_transfer_amount //contents of source beaker var/list/beaker_data = null @@ -414,6 +417,18 @@ return TRUE + if("setCustomTransfer") + var/target = params["target"] + if(isnull(target)) + return FALSE + + target = text2num(target) + if(isnull(target)) + return FALSE + + custom_transfer_amount = clamp(target, 0, beaker.volume) + return TRUE + if("transfer") if(is_printing) say("The buffer is locked while printing.") diff --git a/tgui/packages/tgui/interfaces/ChemMaster.tsx b/tgui/packages/tgui/interfaces/ChemMaster.tsx index 35496244aab..0ca26f17425 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster.tsx @@ -53,6 +53,7 @@ type AnalyzableBeaker = { type Data = { categories: Category[]; isPrinting: BooleanLike; + customTransferAmount: number; printingProgress: number; printingTotal: number; selectedPillDuration: number; @@ -97,6 +98,7 @@ const ChemMasterContent = (props: { const { act, data } = useBackend(); const { isPrinting, + customTransferAmount, printingProgress, printingTotal, selectedPillDuration, @@ -127,6 +129,22 @@ const ChemMasterContent = (props: { {` / ${beaker.maxVolume} units`} + + + act('setCustomTransfer', { + target: value, + }) + } + /> + @@ -324,7 +342,7 @@ type ReagentProps = { const ReagentEntry = (props: ReagentProps) => { const { data, act } = useBackend(); const { chemical, transferTo, analyze } = props; - const { isPrinting } = data; + const { isPrinting, customTransferAmount } = data; return ( @@ -369,6 +387,18 @@ const ReagentEntry = (props: ReagentProps) => { > 10 +