From 80466e7df12899cc70d3f796ca9fbccd804cb9fa Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:34:59 +0200 Subject: [PATCH] [MIRROR] Chem master containers use DMIcon (#29156) * Chem master containers use DMIcon (#85422) ## About The Pull Request ![image](https://github.com/user-attachments/assets/5964f6f6-5485-48a9-a346-54490c5ce1b4) Makes Chem and Condi master machines use DMIcon instead of stylesheets to render icons. ## Why It's Good For The Game Crisp icons, cleaner code. ## Changelog :cl: image: Made chem master container icons not blurry /:cl: * Chem master containers use DMIcon --------- Co-authored-by: Andrew --- .../chemistry/machinery/chem_master.dm | 8 ++------ tgui/packages/tgui/interfaces/ChemMaster.tsx | 20 ++++++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 93748a33043..51adc8d68a5 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -255,11 +255,6 @@ /obj/machinery/chem_master/attack_ai_secondary(mob/user, list/modifiers) return attack_hand_secondary(user, modifiers) -/obj/machinery/chem_master/ui_assets(mob/user) - return list( - get_asset_datum(/datum/asset/spritesheet/chemmaster) - ) - /obj/machinery/chem_master/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) @@ -281,9 +276,10 @@ //add containers to this category for(var/obj/item/reagent_containers/container as anything in printable_containers[category]) category_list["containers"] += list(list( - "icon" = sanitize_css_class_name("[container]"), "ref" = REF(container), "name" = initial(container.name), + "icon" = initial(container.icon), + "icon_state" = initial(container.icon_state), "volume" = initial(container.volume), )) diff --git a/tgui/packages/tgui/interfaces/ChemMaster.tsx b/tgui/packages/tgui/interfaces/ChemMaster.tsx index 62692588c65..6a2becf3eb0 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster.tsx @@ -5,6 +5,8 @@ import { Button, ColorBox, Divider, + DmIcon, + Icon, LabeledList, NumberInput, ProgressBar, @@ -13,7 +15,7 @@ import { Table, Tooltip, } from 'tgui-core/components'; -import { BooleanLike, classes } from 'tgui-core/react'; +import { BooleanLike } from 'tgui-core/react'; import { capitalize } from 'tgui-core/string'; import { useBackend } from '../backend'; @@ -22,6 +24,7 @@ import { Beaker, BeakerReagent } from './common/BeakerDisplay'; type Container = { icon: string; + icon_state: string; ref: string; name: string; volume: number; @@ -375,6 +378,8 @@ const ContainerButton = (props: CategoryButtonProps) => { const { isPrinting, selectedContainerRef, suggestedContainerRef } = data; const { category, container, showPreferredContainer } = props; const isPillPatch = ['pills', 'patches'].includes(category.name); + const fallback = ; + const fallbackPillPatch = ; return ( { }); }} > -