Files
VOREStation/code/modules/paperwork/handlabeler.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

87 lines
2.9 KiB
Plaintext

/obj/item/hand_labeler
name = "hand labeler"
desc = "Label everything like you've always wanted to! Stuck to the side is a label reading \'Labeler\'. Seems you're too late for that one."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "labeler0"
var/label = null
var/labels_left = 30
var/mode = 0 //off or on.
drop_sound = 'sound/items/drop/device.ogg'
pickup_sound = 'sound/items/pickup/device.ogg'
/obj/item/hand_labeler/attack()
return
/obj/item/hand_labeler/afterattack(atom/A, mob/user, 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)
to_chat(user, span_warning("\The [src] has no labels left."))
return
if(!label || !length(label))
to_chat(user, span_warning("\The [src] has no label text set."))
return
if(length(A.name) + length(label) > 64)
to_chat(user, span_warning("\The [src]'s label too big."))
return
if(istype(A, /mob/living/silicon/robot/platform))
var/mob/living/silicon/robot/platform/P = A
if(!P.allowed(user))
to_chat(user, span_warning("Access denied."))
else if(P.client || P.key)
to_chat(user, span_notice("You rename \the [P] to [label]."))
to_chat(P, span_notice("\The [user] renames you to [label]."))
P.custom_name = label
P.SetName(P.custom_name)
else
to_chat(user, span_warning("\The [src] is inactive and cannot be renamed."))
return
if(ishuman(A))
to_chat(user, span_warning("The label refuses to stick to [A.name]."))
return
if(issilicon(A))
to_chat(user, span_warning("The label refuses to stick to [A.name]."))
return
if(isobserver(A))
to_chat(user, span_warning("[src] passes through [A.name]."))
return
if(istype(A, /obj/item/reagent_containers/glass))
to_chat(user, span_warning("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)
to_chat(user, span_warning("How are you going to label that?"))
return
tray.labelled = label
spawn(1)
tray.update_icon()
user.visible_message( \
span_notice("\The [user] labels [A] as [label]."), \
span_notice("You label [A] as [label]."))
A.name = "[A.name] ([label])"
/obj/item/hand_labeler/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
mode = !mode
icon_state = "labeler[mode]"
if(mode)
to_chat(user, span_notice("You turn on \the [src]."))
//Now let them chose the text.
var/str = sanitizeSafe(tgui_input_text(user,"Label text?","Set label","",MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(!str || !length(str))
to_chat(user, span_warning("Invalid text."))
return
label = str
to_chat(user, span_notice("You set the text to '[str]'."))
else
to_chat(user, span_notice("You turn off \the [src]."))