mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-04 14:42:56 +00:00
* Preliminary changes for 516 * Also removes the goon folder * Fixes a BUNCH of UIs * update our things * debug proc * le maintainer verb * fix strip panel * browseroutput => chat_panel * prettier, remove obsolete bat * tidu tgui say css * href purge * 515 compat * 515 compat 2 * more required chores * comments * fully working 515 * bungle * correct this * fixes 515 support * prettier * new CI * fixes old href styles sneaking in * update docs to reflect href changes * more href fixes (thanks cdui) * MORE href nonsense * even more hrefs (seriously wtf) * Update code/modules/admin/permissionverbs/permissionedit.dm * error on fail --------- Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
83 lines
2.8 KiB
Plaintext
83 lines
2.8 KiB
Plaintext
/obj/structure/noticeboard
|
|
name = "notice board"
|
|
desc = "A board for pinning important notices upon."
|
|
icon = 'icons/obj/stationobjs.dmi'
|
|
icon_state = "nboard00"
|
|
density = FALSE
|
|
anchored = TRUE
|
|
max_integrity = 150
|
|
var/notices = 0
|
|
|
|
/obj/structure/noticeboard/Initialize()
|
|
..()
|
|
for(var/obj/item/I in loc)
|
|
if(notices > 4) break
|
|
if(istype(I, /obj/item/paper))
|
|
I.loc = src
|
|
notices++
|
|
icon_state = "nboard0[notices]"
|
|
|
|
//attaching papers!!
|
|
/obj/structure/noticeboard/attackby(obj/item/O as obj, mob/user as mob, params)
|
|
if(istype(O, /obj/item/paper))
|
|
if(notices < 5)
|
|
O.add_fingerprint(user)
|
|
add_fingerprint(user)
|
|
user.drop_item()
|
|
O.loc = src
|
|
notices++
|
|
icon_state = "nboard0[notices]" //update sprite
|
|
to_chat(user, "<span class='notice'>You pin the paper to the noticeboard.</span>")
|
|
else
|
|
to_chat(user, "<span class='notice'>You reach to pin your paper to the board but hesitate. You are certain your paper will not be seen among the many others already attached.</span>")
|
|
return
|
|
return ..()
|
|
|
|
/obj/structure/noticeboard/attack_hand(user as mob)
|
|
var/dat = "<b>Noticeboard</b><br>"
|
|
for(var/obj/item/paper/P in src)
|
|
dat += "<a href='byond://?src=[UID()];read=\ref[P]'>[P.name]</a> <a href='byond://?src=[UID()];write=\ref[P]'>Write</a> <a href='byond://?src=[UID()];remove=\ref[P]'>Remove</a><br>"
|
|
user << browse("<!DOCTYPE html><meta charset='utf-8'><head><title>Notices</title></head>[dat]","window=noticeboard")
|
|
onclose(user, "noticeboard")
|
|
|
|
/obj/structure/noticeboard/deconstruct(disassembled = TRUE)
|
|
if(!(flags & NODECONSTRUCT))
|
|
new /obj/item/stack/sheet/metal (loc, 1)
|
|
qdel(src)
|
|
|
|
/obj/structure/noticeboard/Topic(href, href_list)
|
|
..()
|
|
usr.set_machine(src)
|
|
if(href_list["remove"])
|
|
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
|
|
return
|
|
var/obj/item/P = locate(href_list["remove"])
|
|
if(P && P.loc == src)
|
|
P.loc = get_turf(src) //dump paper on the floor because you're a clumsy fuck
|
|
P.add_fingerprint(usr)
|
|
add_fingerprint(usr)
|
|
notices--
|
|
icon_state = "nboard0[notices]"
|
|
|
|
if(href_list["write"])
|
|
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
|
|
return
|
|
var/obj/item/P = locate(href_list["write"])
|
|
|
|
if((P && P.loc == src)) //ifthe paper's on the board
|
|
if(is_pen(usr.r_hand)) //and you're holding a pen
|
|
add_fingerprint(usr)
|
|
P.attackby(usr.r_hand, usr) //then do ittttt
|
|
else
|
|
if(is_pen(usr.l_hand)) //check other hand for pen
|
|
add_fingerprint(usr)
|
|
P.attackby(usr.l_hand, usr)
|
|
else
|
|
to_chat(usr, "<span class='notice'>You'll need something to write with!</span>")
|
|
|
|
if(href_list["read"])
|
|
var/obj/item/paper/P = locate(href_list["read"])
|
|
if(P && P.loc == src)
|
|
P.show_content(usr)
|
|
return
|