Skip to content

Commit

Permalink
hand labler
Browse files Browse the repository at this point in the history
  • Loading branch information
Git-Nivrak committed Apr 24, 2024
1 parent 4906263 commit 2bce062
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
16 changes: 0 additions & 16 deletions code/game/objects/items/storage/firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,22 +526,6 @@
to_chat(usr, SPAN_NOTICE("You label \the [src] with '[str]' in big, blocky letters."))
update_icon()

/obj/item/storage/pill_bottle/verb/set_color()
set category = "Object"
set name = "Set bottle color"
set src in usr

if(src && ishuman(usr))
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]."))
icon_state = "pill_canister"
update_icon()
return
icon_state = "pill_canister" + num
to_chat(usr, SPAN_NOTICE("You color \the [src]."))
update_icon()

/obj/item/storage/pill_bottle/kelotane
name = "\improper Kelotane pill bottle"
icon_state = "pill_canister2"
Expand Down
10 changes: 10 additions & 0 deletions code/game/objects/items/tools/misc_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@
if(isturf(A))
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()

if(!label || !length(label))
remove_label(A, user)
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry_machinery/chem_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
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]."))
icon_state = "pill_canister"
loaded_pill_bottle.icon_state = "pill_canister"
update_icon()
return
loaded_pill_bottle.icon_state = "pill_canister" + num
Expand Down

0 comments on commit 2bce062

Please sign in to comment.