From 696c26c65e369f4f81d21eb3f574f3f5607fbdbf Mon Sep 17 00:00:00 2001 From: FalseIncarnate Date: Tue, 5 Jul 2016 21:16:04 -0400 Subject: [PATCH] Appeases coding standards, adds ingredient icons to UI The bottler interface now will show both the icon and name of the ingredient in each slot. Also cleaned up stuff as commented on by DZD --- code/modules/food/beverages/bottler.dm | 72 +++++++++++++------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/code/modules/food/beverages/bottler.dm b/code/modules/food/beverages/bottler.dm index 27043533dee..b8ad152c7cd 100644 --- a/code/modules/food/beverages/bottler.dm +++ b/code/modules/food/beverages/bottler.dm @@ -35,24 +35,24 @@ qdel(recipe) /obj/machinery/bottler/attackby(obj/item/O, mob/user, params) - if(iswrench(O)) //This being before the NODROP check allows borgs to (un)wrench bottlers in case they need move them to fix stuff + if(iswrench(O)) //This being before the canUnequip check allows borgs to (un)wrench bottlers in case they need move them to fix stuff playsound(src, 'sound/items/Ratchet.ogg', 50, 1) if(anchored) anchored = 0 - to_chat(user, "\The [src] can now be moved.") + to_chat(user, "[src] can now be moved.") else anchored = 1 - to_chat(user, "\The [src] is now secured.") + to_chat(user, "[src] is now secured.") return 1 - if(O.flags & NODROP) - to_chat(user, "\The [O] is stuck to your hand, you can't seem to put it down!") + if(!user.canUnEquip(O, 0)) + to_chat(user, "[O] is stuck to your hand, you can't seem to put it down!") return 0 if(is_type_in_list(O,acceptable_items)) if(istype(O, /obj/item/weapon/reagent_containers/food/snacks)) var/obj/item/weapon/reagent_containers/food/snacks/S = O user.unEquip(S) if(S.reagents && !S.reagents.total_volume) //This prevents us from using empty foods, should one occur due to some sort of error - to_chat(user, "\The [S.name] is gone, oh no!") + to_chat(user, "[S] is gone, oh no!") qdel(S) //Delete the food object because it is useless even as food due to the lack of reagents else insert_item(S, user) @@ -92,7 +92,7 @@ if(!O || !user) return if(obj_1 && obj_2 && obj_3) - to_chat(user, "\The [src] is full, please remove or process the contents first.") + to_chat(user, "[src] is full, please remove or process the contents first.") return var/slot_inserted = 0 if(!obj_1) @@ -106,10 +106,10 @@ obj_3 = O if(!slot_inserted) - to_chat(user, "Something went wrong and the machine spits out \the [O].") - O.forceMove(src.loc) + to_chat(user, "Something went wrong and the machine spits out [O].") + O.forceMove(loc) else - to_chat(user, "You load \the [O] into the [slot_inserted]\th ingredient tray.") + to_chat(user, "You load [O] into the [slot_inserted]\th ingredient tray.") O.forceMove(src) updateUsrDialog() @@ -117,20 +117,20 @@ var/obj/item/O = null if(obj_1 && (slot == 1 || slot == 4)) O = obj_1 - O.forceMove(src.loc) + O.forceMove(loc) obj_1 = null if(obj_2 && (slot == 2 || slot == 4)) O = obj_2 - O.forceMove(src.loc) + O.forceMove(loc) obj_2 = null if(obj_3 && (slot == 3 || slot == 4)) O = obj_3 - O.forceMove(src.loc) + O.forceMove(loc) obj_3 = null if(slot == 4) - visible_message("\The [src] beeps as it ejects the contents of all the ingredient trays.") + visible_message("[src] beeps as it ejects the contents of all the ingredient trays.") else - visible_message("\The [src] beeps as it ejects [O.name] from the [slot]\th ingredient tray.") + visible_message("[src] beeps as it ejects [O.name] from the [slot]\th ingredient tray.") updateUsrDialog() /obj/machinery/bottler/proc/recycle_container(obj/item/O) @@ -160,28 +160,28 @@ cans++ recycled = 1 if(recycled) - visible_message("\The [src] whirs briefly as it prepares the container for reuse.") + visible_message("[src] whirs briefly as it prepares the container for reuse.") qdel(O) updateUsrDialog() else - visible_message("\The [src] cannot store any more cans at this time. Please fill some before recycling more.") - O.forceMove(src.loc) + visible_message("[src] cannot store any more cans at this time. Please fill some before recycling more.") + O.forceMove(loc) /obj/machinery/bottler/proc/process_sheets(obj/item/stack/sheet/S) if(!S) return - S.forceMove(src.loc) + S.forceMove(loc) //Glass sheets for glass bottles (1 bottle per sheet) if(istype(S, /obj/item/stack/sheet/glass)) var/obj/item/stack/sheet/glass/G = S if(glass_bottles < 10) var/sheets_to_use = min((10 - glass_bottles), G.amount) - visible_message("\The [src] shudders as it converts [sheets_to_use] [G.singular_name]\s into new bottles.") + visible_message("[src] shudders as it converts [sheets_to_use] [G.singular_name]\s into new bottles.") glass_bottles += sheets_to_use glass_bottles = min(glass_bottles, 10) G.use(sheets_to_use) else - visible_message("\The [src] rejects the [G] because it already is fully stocked with glass bottles.") + visible_message("[src] rejects the [G] because it already is fully stocked with glass bottles.") return //Plastic sheets for plastic bottles (2 bottles per sheet) else if(istype(S, /obj/item/stack/sheet/mineral/plastic)) @@ -192,12 +192,12 @@ if(bottles_missing % 2) //A bit wasteful, but we'll always try to completely refill the supply even if it means throwing away excess material sheets_needed += 1 var/sheets_to_use = min(sheets_needed, P.amount) - visible_message("\The [src] shudders as it converts [sheets_to_use] [P.singular_name]\s into new bottles.") + visible_message("[src] shudders as it converts [sheets_to_use] [P.singular_name]\s into new bottles.") plastic_bottles += sheets_to_use * 2 plastic_bottles = min(plastic_bottles, 20) P.use(sheets_to_use) else - visible_message("\The [src] rejects the [P] because it already is fully stocked with plastic bottles.") + visible_message("[src] rejects the [P] because it already is fully stocked with plastic bottles.") return //Metal sheets for cans (5 cans per sheet) else if(istype(S, /obj/item/stack/sheet/metal)) @@ -208,15 +208,15 @@ if(cans_missing % 5) //A bit wasteful, but we'll always try to completely refill the supply even if it means throwing away excess material sheets_needed += 1 var/sheets_to_use = min(sheets_needed, M.amount) - visible_message("\The [src] shudders as it converts [sheets_to_use] [M.singular_name]\s into new cans.") + visible_message("[src] shudders as it converts [sheets_to_use] [M.singular_name]\s into new cans.") cans += sheets_to_use * 5 cans = min(cans, 25) M.use(sheets_to_use) else - visible_message("\The [src] rejects the [M] because it already is fully stocked with metal cans.") + visible_message("[src] rejects the [M] because it already is fully stocked with metal cans.") return else - visible_message("\The [src] rejects the unusable materials.") + visible_message("[src] rejects the unusable materials.") return updateUsrDialog() @@ -248,22 +248,22 @@ return recipe return null -/obj/machinery/bottler/proc/dispense_empty_container(var/container = 0) +/obj/machinery/bottler/proc/dispense_empty_container(container = 0) switch(container) if(1) //glass bottle if(glass_bottles > 0) - new /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle(src.loc) + new /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle(loc) glass_bottles-- if(2) //plastic bottle if(plastic_bottles > 0) - new /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle(src.loc) + new /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle(loc) plastic_bottles-- if(3) //can if(cans > 0) - new /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can(src.loc) + new /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can(loc) cans-- -/obj/machinery/bottler/proc/process_ingredients(var/container = 0) +/obj/machinery/bottler/proc/process_ingredients(container = 0) //stop if we have ZERO ingredients (what would you process?) if(!obj_1 && !obj_2 && !obj_3) visible_message("There are no ingredients to process! Please insert some first.") @@ -294,7 +294,7 @@ visible_message("Error 404: Drink Container Not Found.") return //select and process a recipe based on inserted ingredients - visible_message("\The [src] hums as it processes the ingredients...") + visible_message("[src] hums as it processes the ingredients...") bottling = 1 var/datum/bottler_recipe/recipe_to_use = select_recipe() if(!recipe_to_use) @@ -320,7 +320,7 @@ obj_2 = null obj_3 = null bottling = 0 - drink_container.forceMove(src.loc) + drink_container.forceMove(loc) updateUsrDialog() /obj/machinery/bottler/attack_ai(mob/user) @@ -372,15 +372,15 @@ dat += "" dat += "" if(obj_1) - dat += "[obj_1.name]" + dat += "[bicon(obj_1)]
[obj_1.name]" else dat += "Tray Empty" if(obj_2) - dat += "[obj_2.name]" + dat += "[bicon(obj_2)]
[obj_2.name]" else dat += "Tray Empty" if(obj_3) - dat += "[obj_3.name]" + dat += "[bicon(obj_3)]
[obj_3.name]" else dat += "Tray Empty" if(obj_1 && obj_2 && obj_3)