Adds ability to color patch packs in ChemMaster (#15244)

This commit is contained in:
dearmochi
2021-01-10 20:56:37 +00:00
committed by GitHub
parent 6c9bd82761
commit cc6c6d0389
5 changed files with 14 additions and 10 deletions
@@ -256,8 +256,12 @@
var/applying_meds = FALSE //To Prevent spam clicking and generating runtimes from apply a deleting pill multiple times.
var/rapid_intake_message = "unscrews the cap on the pill bottle and begins dumping the entire contents down their throat!"
var/rapid_post_instake_message = "downs the entire bottle of pills in one go!"
/// Whether to render a coloured wrapper overlay on the icon.
var/allow_wrap = TRUE
/// The color of the wrapper overlay.
var/wrapper_color = null
/// The icon state of the wrapper overlay.
var/wrapper_state = "pillbottle_wrap"
/obj/item/storage/pill_bottle/New()
..()
@@ -268,7 +272,7 @@
/obj/item/storage/pill_bottle/proc/apply_wrap()
if(wrapper_color)
overlays.Cut()
var/image/I = image(icon, "pillbottle_wrap")
var/image/I = image(icon, wrapper_state)
I.color = wrapper_color
overlays += I
@@ -322,14 +326,14 @@
return ..()
/obj/item/storage/pill_bottle/patch_pack
name = "Patch Pack"
name = "patch pack"
desc = "It's a container for storing medical patches."
icon_state = "patch_pack"
can_hold = list(/obj/item/reagent_containers/food/pill/patch)
cant_hold = list()
rapid_intake_message = "flips the lid of the Patch Pack open and begins rapidly stamping patches on themselves!"
rapid_post_instake_message = "stamps the entire contents of the Patch Pack all over their entire body!"
allow_wrap = FALSE
rapid_intake_message = "flips the lid of the patch pack open and begins rapidly stamping patches on themselves!"
rapid_post_instake_message = "stamps the entire contents of the patch pack all over their entire body!"
wrapper_state = "patch_pack_wrap"
/obj/item/storage/pill_bottle/charcoal
name = "Pill bottle (Charcoal)"
@@ -338,7 +338,7 @@
COLOR_MAROON = "Brown"
)
var/current = pill_bottle_wrappers[loaded_pill_bottle.wrapper_color] || "Default"
ui_modal_choice(src, id, "Please select a pill bottle wrapper:", null, arguments, current, pill_bottle_wrappers)
ui_modal_choice(src, id, "Please select a wrapper color:", null, arguments, current, pill_bottle_wrappers)
if("addcustom")
if(!beaker || !beaker.reagents.total_volume)
return
Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

+3 -3
View File
@@ -376,16 +376,16 @@ const ChemMasterCustomization = (props, context) => {
const { act, data } = useBackend(context);
if (!data.loaded_pill_bottle) {
return (
<Section title="Pill Bottle Customization">
<Section title="Container Customization">
<Box color="label">
None loaded.
No pill bottle or patch pack loaded.
</Box>
</Section>
);
}
return (
<Section title="Pill Bottle Customization">
<Section title="Container Customization">
<Button
disabled={!data.loaded_pill_bottle}
icon="eject"
File diff suppressed because one or more lines are too long