/atom/var/name_unlabel = "" // Yes, this is totally worth a new variable and a proc! /atom/proc/remove_label() set name = "Remove Label" set category = "Object" set src in view(1) if (!usr.IsAdvancedToolUser() || usr.incapacitated()) to_chat(usr, "You lack the dexerity to do this!") return FALSE if (!name_unlabel) to_chat(usr, "You look again, unable to find the label! Perhaps your eyes need checking?") src.verbs -= .proc/remove_label return FALSE var/mob/living/carbon/human/H = usr name = name_unlabel name_unlabel = "" src.verbs -= .proc/remove_label H.visible_message("\The [H] removes the label from \the [src].", "You remove the label from \the [src].") return TRUE /obj/item/weapon/hand_labeler name = "hand labeler" icon = 'icons/obj/bureaucracy.dmi' icon_state = "labeler0" var/label = null var/labels_left = 30 var/mode = 0 //off or on. /obj/item/weapon/hand_labeler/attack() return /obj/item/weapon/hand_labeler/afterattack(atom/A, mob/user as mob, proximity) if(!proximity) return if(!mode) //if it's off, give up. return if(A == loc) // if placing the labeller into something (e.g. backpack) return // don't set a label if(!labels_left) user << "No labels left." return if(!label || !length(label)) user << "No text set." return if(length(A.name) + length(label) > 64) user << "Label too big." return if(ishuman(A)) user << "The label refuses to stick to [A.name]." return if(issilicon(A)) user << "The label refuses to stick to [A.name]." return if(isobserver(A)) user << "[src] passes through [A.name]." return if(istype(A, /obj/item/weapon/reagent_containers/glass)) user << "The label can't stick to the [A.name]. (Try using a pen)" return if(istype(A, /obj/machinery/portable_atmospherics/hydroponics)) var/obj/machinery/portable_atmospherics/hydroponics/tray = A if(!tray.mechanical) user << "How are you going to label that?" return tray.labelled = label spawn(1) tray.update_icon() user.visible_message("[user] labels [A] as [label].", \ "You label [A] as [label].") // Prevent label stacking from making name unrecoverable. if (!A.name_unlabel) A.name_unlabel = A.name A.verbs += /atom/proc/remove_label A.name = "[A.name] ([label])" /obj/item/weapon/hand_labeler/attack_self(mob/user as mob) mode = !mode icon_state = "labeler[mode]" if(mode) user << "You turn on \the [src]." //Now let them chose the text. var/str = sanitizeSafe(input(user,"Label text?","Set label",""), MAX_NAME_LEN) if(!str || !length(str)) user << "Invalid text." return label = str user << "You set the text to '[str]'." else user << "You turn off \the [src]."