mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #14067 from VOREStation/upstream-merge-8817
[MIRROR] Naming Food & Blood Cakes
This commit is contained in:
committed by
CHOMPStation2
parent
a076afbee3
commit
151e5fdb91
@@ -7,10 +7,28 @@
|
||||
/obj/item/weapon/reagent_containers/food
|
||||
possible_transfer_amounts = null
|
||||
volume = 50 //Sets the default container amount for all food items.
|
||||
var/filling_color = "#FFFFFF" //Used by sandwiches.
|
||||
description_info = "Food can use the Rename Food verb in the Object Tab to rename it."
|
||||
var/filling_color = "#FFFFFF" //Used by sandwiches and custom food.
|
||||
drop_sound = 'sound/items/drop/food.ogg'
|
||||
pickup_sound = 'sound/items/pickup/food.ogg'
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/verb/change_name()
|
||||
set name = "Rename Food"
|
||||
set category = "Object"
|
||||
set src in view(0)
|
||||
|
||||
handle_name_change(usr)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/proc/handle_name_change(var/mob/living/user)
|
||||
if(user.stat == DEAD || !(ishuman(user) || isrobot(user)))
|
||||
to_chat(user, SPAN_WARNING("You can't cook!"))
|
||||
return
|
||||
var/n_name = sanitizeSafe(input(user, "What would you like to name \the [src]? Leave blank to reset.", "Food Naming", null) as text, MAX_NAME_LEN)
|
||||
if(!n_name)
|
||||
n_name = initial(name)
|
||||
|
||||
name = n_name
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/Initialize()
|
||||
. = ..()
|
||||
if (center_of_mass.len && !pixel_x && !pixel_y)
|
||||
|
||||
@@ -489,6 +489,10 @@
|
||||
var/list/cooktypes = list()
|
||||
var/datum/reagents/buffer = new /datum/reagents(1000)
|
||||
var/totalcolour
|
||||
var/reagents_determine_color
|
||||
|
||||
if(!LAZYLEN(CI.container.contents)) // It's possible to make something, such as a cake in the oven, with only reagents. This stops them from being grey and sad.
|
||||
reagents_determine_color = TRUE
|
||||
|
||||
for (var/obj/item/I in CI.container)
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/S
|
||||
@@ -527,6 +531,13 @@
|
||||
buffer.trans_to_holder(result.reagents, buffer.total_volume) //trans_to doesn't handle food items well, so
|
||||
//just call trans_to_holder instead
|
||||
|
||||
// Reagent-only foods.
|
||||
if(reagents_determine_color)
|
||||
totalcolour = result.reagents.get_color()
|
||||
|
||||
for(var/datum/reagent/reag in result.reagents.reagent_list)
|
||||
words |= text2list(reag.name, " ")
|
||||
|
||||
//Filling overlay
|
||||
var/image/I = image(result.icon, "[result.icon_state]_filling")
|
||||
I.color = totalcolour
|
||||
|
||||
Reference in New Issue
Block a user