mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Refactors renaming things with a pen. (#14960)
* Refactors renaming things with a pen. * Farie review (thanks!!) * Derp. * Farie take 2
This commit is contained in:
@@ -33,13 +33,13 @@
|
||||
|
||||
/obj/structure/bookcase/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
if(busy) //So that you can't mess with it while deconstructing
|
||||
return 1
|
||||
return TRUE
|
||||
if(is_type_in_list(O, allowed_books))
|
||||
if(!user.drop_item())
|
||||
return
|
||||
O.forceMove(src)
|
||||
update_icon()
|
||||
return 1
|
||||
return TRUE
|
||||
else if(istype(O, /obj/item/storage/bag/books))
|
||||
var/obj/item/storage/bag/books/B = O
|
||||
for(var/obj/item/T in B.contents)
|
||||
@@ -47,28 +47,26 @@
|
||||
B.remove_from_storage(T, src)
|
||||
to_chat(user, "<span class='notice'>You empty [O] into [src].</span>")
|
||||
update_icon()
|
||||
return 1
|
||||
return TRUE
|
||||
else if(istype(O, /obj/item/wrench))
|
||||
user.visible_message("<span class='warning'>[user] starts disassembling \the [src].</span>", \
|
||||
"<span class='notice'>You start disassembling \the [src].</span>")
|
||||
playsound(get_turf(src), O.usesound, 50, 1)
|
||||
busy = 1
|
||||
busy = TRUE
|
||||
|
||||
if(do_after(user, 50 * O.toolspeed, target = src))
|
||||
playsound(get_turf(src), O.usesound, 75, 1)
|
||||
user.visible_message("<span class='warning'>[user] disassembles \the [src].</span>", \
|
||||
"<span class='notice'>You disassemble \the [src].</span>")
|
||||
busy = 0
|
||||
busy = FALSE
|
||||
density = 0
|
||||
deconstruct(TRUE)
|
||||
else
|
||||
busy = 0
|
||||
return 1
|
||||
busy = FALSE
|
||||
return TRUE
|
||||
else if(istype(O, /obj/item/pen))
|
||||
var/newname = stripped_input(user, "What would you like to title this [name]?")
|
||||
if(newname)
|
||||
name = ("bookcase ([sanitize(newname)])")
|
||||
return 1
|
||||
rename_interactive(user, O)
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user