diff --git a/code/game/objects/items/storage/firstaid.dm b/code/game/objects/items/storage/firstaid.dm index 3e7c00f3d0ff..cd5982c9c578 100644 --- a/code/game/objects/items/storage/firstaid.dm +++ b/code/game/objects/items/storage/firstaid.dm @@ -510,6 +510,20 @@ /obj/item/storage/pill_bottle/proc/error_idlock(mob/user) to_chat(user, SPAN_WARNING("It must have some kind of ID lock...")) +/obj/item/storage/pill_bottle/proc/choose_color() + var/list/possible_colors = list("Orange" = "", "Blue" = "1", "Yellow" = "2", "Light Purple" = "3", "Light Grey" = "4", + "White" = "5", "Light Green" = "6", "Cyan" = "7", "Red" = "8", "Aquamarine" = "9", "Grey" = "10", "Bordeaux" = "11", "Black" = "12") + var/selected_color = tgui_input_list(usr, "Select a color.", "Color choice", possible_colors) + + if (!selected_color) + selected_color = "" + + selected_color = possible_colors[selected_color] + + icon_state = "pill_canister" + selected_color + to_chat(usr, SPAN_NOTICE("You color \the [src].")) + update_icon() + /obj/item/storage/pill_bottle/verb/set_maptext() set category = "Object" set name = "Set short label (on-sprite)" diff --git a/code/game/objects/items/tools/misc_tools.dm b/code/game/objects/items/tools/misc_tools.dm index 82d3577e897c..8e2bc5855671 100644 --- a/code/game/objects/items/tools/misc_tools.dm +++ b/code/game/objects/items/tools/misc_tools.dm @@ -59,14 +59,8 @@ to_chat(user, SPAN_WARNING("The label won't stick to that.")) return if(istype(A, /obj/item/storage/pill_bottle)) - var/num = copytext(reject_bad_text(input(usr,"Color? (1-12 or blank)", "Set \the [A]'s color", "")), 1, 3) - if(!num || !length(num) || text2num(num) <= 0 || text2num(num) > 12 || copytext(num, 2, 3) == " ") - to_chat(usr, SPAN_NOTICE("You clear the color off \the [A].")) - A.icon_state = "pill_canister" - update_icon() - A.icon_state = "pill_canister" + num - to_chat(usr, SPAN_NOTICE("You color \the [A].")) - update_icon() + var/obj/item/storage/pill_bottle/target_pill_bottle = A + target_pill_bottle.choose_color() if(!label || !length(label)) remove_label(A, user) diff --git a/code/modules/reagents/chemistry_machinery/chem_master.dm b/code/modules/reagents/chemistry_machinery/chem_master.dm index e6582a221235..e111a8738ac1 100644 --- a/code/modules/reagents/chemistry_machinery/chem_master.dm +++ b/code/modules/reagents/chemistry_machinery/chem_master.dm @@ -96,7 +96,7 @@ if(!istype(dest)) source.reagents.remove_reagent(reagent_id, amount) else if(dest.reagents) - source.reagents.trans_id_to(dest, reagent_id, amount) + source.reagents.trans_id_to(dest, reagent_id, amount) /obj/structure/machinery/chem_master/Topic(href, href_list) . = ..() @@ -149,15 +149,7 @@ if(!Adjacent(usr)) return - var/num = copytext(reject_bad_text(input(usr,"Color? (1-12)", "Set \the [src]'s color", "")), 1, 3) - if(!num || !length(num) || text2num(num) <= 0 || text2num(num) > 12 || copytext(num, 2, 3) == " ") - to_chat(usr, SPAN_NOTICE("You clear the color off \the [src].")) - loaded_pill_bottle.icon_state = "pill_canister" - update_icon() - return - loaded_pill_bottle.icon_state = "pill_canister" + num - to_chat(usr, SPAN_NOTICE("You color \the [loaded_pill_bottle].")) - loaded_pill_bottle.update_icon() + loaded_pill_bottle.choose_color() else if(href_list["close"]) close_browser(user, "chemmaster")