diff --git a/code/__DEFINES/reagents.dm b/code/__DEFINES/reagents.dm index 79fe50e2da9..347fdf27b49 100644 --- a/code/__DEFINES/reagents.dm +++ b/code/__DEFINES/reagents.dm @@ -41,6 +41,11 @@ #define PILL_STYLE_COUNT 22 //Update this if you add more pill icons or you die #define RANDOM_PILL_STYLE 22 //Dont change this one though +//used by chem masters and pill presses +//update this if you add more patch icons +#define PATCH_STYLE_LIST list("bandaid", "bandaid_brute", "bandaid_burn", "bandaid_both") //icon_state list +#define DEFAULT_PATCH_STYLE "bandaid" + //used by chem master #define CONDIMASTER_STYLE_AUTO "auto" #define CONDIMASTER_STYLE_FALLBACK "_" diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm index ed89f08798e..7b24cebfdff 100644 --- a/code/modules/asset_cache/asset_list_items.dm +++ b/code/modules/asset_cache/asset_list_items.dm @@ -237,6 +237,15 @@ "pill22" = 'icons/ui_icons/pills/pill22.png', ) +/datum/asset/spritesheet/simple/patches + name = "patches" + assets = list( + "bandaid" = 'icons/ui_icons/patches/bandaid.png', + "bandaid_brute" = 'icons/ui_icons/patches/bandaid_brute.png', + "bandaid_burn" = 'icons/ui_icons/patches/bandaid_burn.png', + "bandaid_both" = 'icons/ui_icons/patches/bandaid_both.png' + ) + /datum/asset/spritesheet/simple/condiments name = "condiments" assets = list( diff --git a/code/modules/plumbing/plumbers/pill_press.dm b/code/modules/plumbing/plumbers/pill_press.dm index 6f27d61e0c6..04ffa775373 100644 --- a/code/modules/plumbing/plumbers/pill_press.dm +++ b/code/modules/plumbing/plumbers/pill_press.dm @@ -24,6 +24,10 @@ var/pill_number = RANDOM_PILL_STYLE ///list of id's and icons for the pill selection of the ui var/list/pill_styles + /// Currently selected patch style + var/patch_style = DEFAULT_PATCH_STYLE + /// List of available patch styles for UI + var/list/patch_styles ///list of products stored in the machine, so we dont have 610 pills on one tile var/list/stored_products = list() ///max amount of pills allowed on our tile before we start storing them instead @@ -46,6 +50,14 @@ SL["id"] = x SL["class_name"] = assets.icon_class_name("pill[x]") pill_styles += list(SL) + var/datum/asset/spritesheet/simple/patches_assets = get_asset_datum(/datum/asset/spritesheet/simple/patches) + patch_styles = list() + for (var/raw_patch_style in PATCH_STYLE_LIST) + //adding class_name for use in UI + var/list/patch_style = list() + patch_style["style"] = raw_patch_style + patch_style["class_name"] = patches_assets.icon_class_name(raw_patch_style) + patch_styles += list(patch_style) /obj/machinery/plumbing/pill_press/process() if(machine_stat & NOPOWER) @@ -66,6 +78,7 @@ var/obj/item/reagent_containers/pill/patch/P = new(src) reagents.trans_to(P, current_volume) P.name = trim("[product_name] patch") + P.icon_state = patch_style stored_products += P else if (product == "bottle") var/obj/item/reagent_containers/glass/bottle/P = new(src) @@ -89,6 +102,7 @@ /obj/machinery/plumbing/pill_press/ui_assets(mob/user) return list( get_asset_datum(/datum/asset/spritesheet/simple/pills), + get_asset_datum(/datum/asset/spritesheet/simple/patches), ) /obj/machinery/plumbing/pill_press/ui_interact(mob/user, datum/tgui/ui) @@ -106,6 +120,8 @@ data["product"] = product data["min_volume"] = min_volume data["max_volume"] = max_volume + data["patch_style"] = patch_style + data["patch_styles"] = patch_styles return data /obj/machinery/plumbing/pill_press/ui_act(action, params) @@ -129,3 +145,5 @@ else if (product == "bottle") max_volume = max_bottle_volume current_volume = clamp(current_volume, min_volume, max_volume) + if("change_patch_style") + patch_style = params["patch_style"] diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 1305bdfba10..fe6f92dc2d0 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -37,6 +37,10 @@ var/list/pill_styles /// List of available condibottle styles for UI var/list/condi_styles + /// Currently selected patch style + var/patch_style = DEFAULT_PATCH_STYLE + /// List of available patch styles for UI + var/list/patch_styles /obj/machinery/chem_master/Initialize(mapload) create_reagents(100) @@ -50,6 +54,15 @@ SL["className"] = assets.icon_class_name("pill[x]") pill_styles += list(SL) + var/datum/asset/spritesheet/simple/patches_assets = get_asset_datum(/datum/asset/spritesheet/simple/patches) + patch_styles = list() + for (var/raw_patch_style in PATCH_STYLE_LIST) + //adding class_name for use in UI + var/list/patch_style = list() + patch_style["style"] = raw_patch_style + patch_style["class_name"] = patches_assets.icon_class_name(raw_patch_style) + patch_styles += list(patch_style) + condi_styles = strip_condi_styles_to_icons(get_condi_styles()) . = ..() @@ -184,6 +197,7 @@ return list( get_asset_datum(/datum/asset/spritesheet/simple/pills), get_asset_datum(/datum/asset/spritesheet/simple/condiments), + get_asset_datum(/datum/asset/spritesheet/simple/patches), ) /obj/machinery/chem_master/ui_interact(mob/user, datum/tgui/ui) @@ -225,6 +239,8 @@ //Calculated at init time as it never changes data["pillStyles"] = pill_styles data["condiStyles"] = condi_styles + data["patch_style"] = patch_style + data["patch_styles"] = patch_styles return data /obj/machinery/chem_master/ui_act(action, params) @@ -382,6 +398,7 @@ for(var/i in 1 to amount) P = new/obj/item/reagent_containers/pill/patch(drop_location()) P.name = trim("[name] patch") + P.icon_state = patch_style adjust_item_drop_location(P) reagents.trans_to(P, vol_each, transfered_by = usr) return TRUE @@ -434,6 +451,10 @@ screen = params["screen"] return TRUE + if(action == "change_patch_style") + patch_style = params["patch_style"] + return TRUE + return FALSE /obj/machinery/chem_master/adjust_item_drop_location(atom/movable/AM) // Special version for chemmasters and condimasters diff --git a/icons/ui_icons/patches/bandaid.png b/icons/ui_icons/patches/bandaid.png new file mode 100644 index 00000000000..66d2a0217da Binary files /dev/null and b/icons/ui_icons/patches/bandaid.png differ diff --git a/icons/ui_icons/patches/bandaid_both.png b/icons/ui_icons/patches/bandaid_both.png new file mode 100644 index 00000000000..b7639b505b8 Binary files /dev/null and b/icons/ui_icons/patches/bandaid_both.png differ diff --git a/icons/ui_icons/patches/bandaid_brute.png b/icons/ui_icons/patches/bandaid_brute.png new file mode 100644 index 00000000000..7156ea7ca80 Binary files /dev/null and b/icons/ui_icons/patches/bandaid_brute.png differ diff --git a/icons/ui_icons/patches/bandaid_burn.png b/icons/ui_icons/patches/bandaid_burn.png new file mode 100644 index 00000000000..689b5e89cc6 Binary files /dev/null and b/icons/ui_icons/patches/bandaid_burn.png differ diff --git a/tgui/packages/tgui/interfaces/ChemMaster.js b/tgui/packages/tgui/interfaces/ChemMaster.js index db1652020cc..2e1b1508a46 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster.js +++ b/tgui/packages/tgui/interfaces/ChemMaster.js @@ -241,6 +241,8 @@ const PackagingControls = (props, context) => { autoCondiStyle, pillStyles = [], condiStyles = [], + patch_style, + patch_styles = [], } = data; const autoCondiStyleChosen = autoCondiStyle === chosenCondiStyle; return ( @@ -273,6 +275,20 @@ const PackagingControls = (props, context) => { volume: 'auto', })} /> )} + {!condi && ( + + {patch_styles.map(patch => ( + + ))} + + )} {!condi && ( { product, min_volume, max_volume, + patch_style, + patch_styles = [], } = data; return ( { ))} )} + {product === "patch" && ( + + {patch_styles.map(patch => ( + + ))} + + )}