diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index 889dc58a8e5ca..2f8afda95cb56 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -68,10 +68,6 @@ /obj/item/proc/onMouseUp(object, location, params, mob) return - -/obj/item - var/canMouseDown = FALSE - /obj/item/gun item_flags = ISWEAPON var/automatic = 0 //can gun use it, 0 is no, anything above 0 is the delay between clicks in ds diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index ec69568b57540..27cd56191bd3f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -221,6 +221,11 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) ///Icon for monkey var/icon/monkey_icon + var/canMouseDown = FALSE + + ///Icons used to show the item in vendors instead of the item's actual icon, drawn from the item's icon file (just chemical.dm for now) + var/vendor_icon_preview = null + /obj/item/Initialize(mapload) diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm index 2e2ad9b80a0e5..fc32843198cb8 100644 --- a/code/modules/asset_cache/asset_list_items.dm +++ b/code/modules/asset_cache/asset_list_items.dm @@ -424,7 +424,11 @@ else icon_file = initial(item.icon) var/icon_state = initial(item.icon_state) - + if(ispath(item, /obj/item)) + var/obj/item/fake_item = item + if(initial(fake_item.vendor_icon_preview)) + icon_state = initial(fake_item.vendor_icon_preview) + icon_file = initial(fake_item.icon) #ifdef UNIT_TESTS var/icon_states_list = icon_states(icon_file) if (!(icon_state in icon_states_list)) diff --git a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm index 1ef594278ff59..c1b38868c1b18 100644 --- a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm +++ b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm @@ -82,14 +82,17 @@ /obj/item/reagent_containers/food/drinks/drinkingglass/filled/soda name = "Soda Water" list_reagents = list(/datum/reagent/consumable/sodawater = 50) + vendor_icon_preview = "glass_clear" /obj/item/reagent_containers/food/drinks/drinkingglass/filled/cola name = "Space Cola" list_reagents = list(/datum/reagent/consumable/space_cola = 50) + vendor_icon_preview = "glass_brown" /obj/item/reagent_containers/food/drinks/drinkingglass/filled/nuka_cola name = "Nuka Cola" list_reagents = list(/datum/reagent/consumable/nuka_cola = 50) + vendor_icon_preview = "nuka_colaglass" /obj/item/reagent_containers/food/drinks/drinkingglass/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/reagent_containers/food/snacks/egg)) //breaking eggs diff --git a/code/modules/hydroponics/hydroitemdefines.dm b/code/modules/hydroponics/hydroitemdefines.dm index 1b364a9d23c96..55bed3716f0bf 100644 --- a/code/modules/hydroponics/hydroitemdefines.dm +++ b/code/modules/hydroponics/hydroitemdefines.dm @@ -164,16 +164,19 @@ name = "bottle of E-Z-Nutrient" desc = "Contains a fertilizer that causes mild mutations with each harvest." list_reagents = list(/datum/reagent/plantnutriment/eznutriment = 50) + vendor_icon_preview = "bottle_eznutrient" /obj/item/reagent_containers/glass/bottle/nutrient/l4z name = "bottle of Left 4 Zed" desc = "Contains a fertilizer that limits plant yields to no more than one and causes significant mutations in plants." list_reagents = list(/datum/reagent/plantnutriment/left4zednutriment = 50) + vendor_icon_preview = "bottle_left4zed" /obj/item/reagent_containers/glass/bottle/nutrient/rh name = "bottle of Robust Harvest" desc = "Contains a fertilizer that increases the yield of a plant by 30% while causing no mutations." list_reagents = list(/datum/reagent/plantnutriment/robustharvestnutriment = 50) + vendor_icon_preview = "bottle_robustharvest" /obj/item/reagent_containers/glass/bottle/nutrient/empty name = "bottle" diff --git a/code/modules/reagents/reagent_containers/bottle.dm b/code/modules/reagents/reagent_containers/bottle.dm index abe81edc6c854..8d73e897b133a 100644 --- a/code/modules/reagents/reagent_containers/bottle.dm +++ b/code/modules/reagents/reagent_containers/bottle.dm @@ -21,18 +21,21 @@ label_name = "epinephrine" desc = "A small bottle. Contains epinephrine - used to stabilize patients." list_reagents = list(/datum/reagent/medicine/epinephrine = 30) + vendor_icon_preview = "bottle_epinephrine" /obj/item/reagent_containers/glass/bottle/tricordrazine name = "tricordrazine bottle" label_name = "tricordrazine" desc = "A small bottle of tricordrazine. Used to aid in patient recovery." list_reagents = list(/datum/reagent/medicine/tricordrazine = 30) + vendor_icon_preview = "bottle_tricordrazine" /obj/item/reagent_containers/glass/bottle/spaceacillin name = "spaceacillin bottle" label_name = "spaceacillin" desc = "A small bottle of spaceacillin. Used to cure some diseases." list_reagents = list(/datum/reagent/medicine/spaceacillin = 30) + vendor_icon_preview = "bottle_spaceacillin" /obj/item/reagent_containers/glass/bottle/antitoxin name = "antitoxin bottle" @@ -45,12 +48,14 @@ label_name = "mutagen toxin" desc = "A small bottle of mutagen toxins. Do not drink, Might cause unpredictable mutations." list_reagents = list(/datum/reagent/toxin/mutagen = 30) + vendor_icon_preview = "bottle_mutagen" /obj/item/reagent_containers/glass/bottle/toxin name = "toxin bottle" label_name = "toxin" desc = "A small bottle of toxins. Do not drink, it is poisonous." list_reagents = list(/datum/reagent/toxin = 30) + vendor_icon_preview = "bottle_toxin" /obj/item/reagent_containers/glass/bottle/cyanide name = "cyanide bottle" @@ -70,14 +75,14 @@ desc = "A small bottle of morphine." icon = 'icons/obj/chemical.dmi' list_reagents = list(/datum/reagent/medicine/morphine = 30) + vendor_icon_preview = "bottle_morphine" /obj/item/reagent_containers/glass/bottle/chloralhydrate name = "chloral hydrate bottle" label_name = "chloral hydrate" desc = "A small bottle of Choral Hydrate. Mickey's Favorite!" - icon_state = "bottle20" list_reagents = list(/datum/reagent/toxin/chloralhydrate = 30) - label_icon = null + vendor_icon_preview = "bottle_chloralhydrate" /obj/item/reagent_containers/glass/bottle/mannitol name = "mannitol bottle" @@ -90,6 +95,7 @@ label_name = "charcoal" desc = "A small bottle of charcoal, which removes toxins and other chemicals from the bloodstream." list_reagents = list(/datum/reagent/medicine/charcoal = 30) + vendor_icon_preview = "bottle_charcoal" /obj/item/reagent_containers/glass/bottle/mutagen name = "unstable mutagen bottle" @@ -126,6 +132,7 @@ label_name = "ammonia" desc = "A small bottle of ammonia." list_reagents = list(/datum/reagent/ammonia = 30) + vendor_icon_preview = "bottle_ammonia" /obj/item/reagent_containers/glass/bottle/diethylamine name = "diethylamine bottle" @@ -207,6 +214,7 @@ label_name = "formaldehyde" desc = "A small bottle. Contains Formaldehyde." list_reagents = list(/datum/reagent/toxin/formaldehyde = 30) + vendor_icon_preview = "bottle_formaldehyde" /obj/item/reagent_containers/glass/bottle/initropidril name = "initropidril bottle" @@ -267,6 +275,7 @@ label_name = "saline-glucose" desc = "A small bottle of saline-glucose solution. Useful for patients lacking in blood volume." list_reagents = list(/datum/reagent/medicine/salglu_solution = 30) + vendor_icon_preview = "bottle_salineglucose" /obj/item/reagent_containers/glass/bottle/atropine name = "atropine bottle" @@ -291,6 +300,7 @@ label_name = "Experimental disease culture" desc = "A small bottle. Contains an untested viral culture in synthblood medium." spawned_disease = /datum/disease/advance/random + vendor_icon_preview = "bottle_virusblood" /obj/item/reagent_containers/glass/bottle/pierrot_throat name = "Pierrot's Throat culture bottle" @@ -495,6 +505,7 @@ name = "ethanol bottle" label_name = "ethanol" list_reagents = list(/datum/reagent/consumable/ethanol = 30) + vendor_icon_preview = "bottle_ethanol" /obj/item/reagent_containers/glass/bottle/sugar name = "sugar bottle" diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 2fed385be961f..eab3a3aa5291f 100755 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -407,6 +407,7 @@ volume = 100 amount_per_transfer_from_this = 20 cap_icon_state = "bottle_cap" + vendor_icon_preview = "waterbottle_large" /obj/item/reagent_containers/glass/waterbottle/large/empty list_reagents = list() diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 9030a1529144e..7dbba675b3cbc 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -978,11 +978,11 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C item_price = T.custom_price item_path = T.type if(!base64) - if(base64_cache[T.type]) - base64 = base64_cache[T.type] + if(base64_cache["[T.icon]_[T.icon_state]"]) + base64 = base64_cache["[T.icon]_[T.icon_state]"] else base64 = icon2base64(icon(T.icon, T.icon_state, frame=1)) - base64_cache[T.type] = base64 + base64_cache["[T.icon]_[T.icon_state]"] = base64 break var/list/data = list( name = O, diff --git a/icons/obj/chemical.dmi b/icons/obj/chemical.dmi index 417c523d825a9..9aaff5dcf651c 100644 Binary files a/icons/obj/chemical.dmi and b/icons/obj/chemical.dmi differ diff --git a/icons/obj/drinks.dmi b/icons/obj/drinks.dmi index 7f873c4db25c0..a661d7cf28b26 100644 Binary files a/icons/obj/drinks.dmi and b/icons/obj/drinks.dmi differ