Expands Notice Boards For Persistency (#21211)

## About PR
This PR re-sprites and expands notice boards. 
With the persistence update I expect an increase in utilizing notice
boards. The current ones are quite old and severely limited by only
allowing five pieces of paper tacked onto them.
So let us change that:
(updated final iteration)
> <img width="1083" height="412" alt="image"
src="https://github.com/user-attachments/assets/112f19fe-2fec-4bb1-b276-138301e7b9c5"
/>

Close up of the glass overlay:
> <img width="370" height="164" alt="image"
src="https://github.com/user-attachments/assets/c8dbde23-7a52-497c-b43a-927598829725"
/>

Regular notice boards now support up to twenty (20) pieces of highly
informative pieces of paper pinned up by the crew.
Command (lockable) notice boards support up to six (6) pieces of very
important information by your beloved departmental heads.

### FAQ
Q: Why is there a discrepancy between the command and regular notice
boards?
A: Command is expected to pin up actually important information. The
incentive is that command is a bit more conscious what they pin in
these, now that they persist through rounds.

Q: Why twenty for the regular board?
A: Super full notice boards are funny. I may add even more, depending on
how long I need to finish the code.

Q: Why is there stuff in the screenshots redacted?
A: It is for a feature for the command notice boards but I am not sure
yet if it is desirable or practical to have.

Q: Why does your code look so bad?
A: Sorry :( I put up the PR so I get help or co-authored by people who
actually know what they are doing.

> [!IMPORTANT]
> The new notice boards have not been mapped in yet! 😃

---------

Signed-off-by: KingOfThePing <43940569+KingOfThePing@users.noreply.github.com>
Co-authored-by: FlamingLily <80451102+FlamingLily@users.noreply.github.com>
This commit is contained in:
KingOfThePing
2025-09-07 23:53:00 +00:00
committed by GitHub
co-authored by FlamingLily
parent 46a137d9b5
commit 90f3051396
5 changed files with 788 additions and 706 deletions
+80 -7
View File
@@ -1,11 +1,13 @@
/obj/structure/noticeboard
name = "notice board"
desc = "A board for pinning important notices upon."
desc = "A board for pinning probably not-so-important notices upon."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "nboard00"
icon_state = "nboard0"
density = 0
anchored = 1
var/notices = 0
var/notice_limit = 20
var/base_icon = "nboard"
/obj/structure/noticeboard/Initialize(mapload)
if (mapload)
@@ -14,21 +16,25 @@
/obj/structure/noticeboard/proc/add_papers_from_turf()
for(var/obj/item/I in loc)
if(notices > 4) break
if(notice_limit <= notices) break
if(istype(I, /obj/item/paper))
I.forceMove(src)
notices++
icon_state = "nboard0[notices]"
update_icon()
/obj/structure/noticeboard/update_icon()
..()
icon_state = "[base_icon][notices]"
//attaching papers!!
/obj/structure/noticeboard/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/paper))
if(notices < 5)
if(notice_limit > notices)
attacking_item.add_fingerprint(user)
add_fingerprint(user)
user.drop_from_inventory(attacking_item,src)
notices++
icon_state = "nboard0[notices]" //update sprite
update_icon()
SSpersistence.register_track(attacking_item, ckey(usr.key)) // Add paper to persistent tracker
to_chat(user, SPAN_NOTICE("You pin the paper to the noticeboard."))
else
@@ -62,7 +68,7 @@
P.add_fingerprint(usr)
add_fingerprint(usr)
notices--
icon_state = "nboard0[notices]"
update_icon()
SSpersistence.deregister_track(P) // Remove paper from persistent tracker
if(href_list["write"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
@@ -85,3 +91,70 @@
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY><TT>[P.info]</TT></BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
return
/obj/structure/noticeboard/command
name = "command notice board"
desc = "A board for command to pin actually important information on. As if. Can be locked and unlocked with an appropiate ID."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "comboard0"
req_access = list(ACCESS_CAPTAIN, ACCESS_CMO, ACCESS_HOS, ACCESS_QM, ACCESS_HOS, ACCESS_CE)
base_icon = "comboard"
notice_limit = 6
var/open
var/unlocked
/obj/structure/noticeboard/command/Initialize()
. = ..()
update_icon()
/obj/structure/noticeboard/command/update_icon()
..()
ClearOverlays()
if(unlocked)
AddOverlays("unlocked")
else
AddOverlays("locked")
if(open)
AddOverlays("glass_open")
else
AddOverlays("glass")
/obj/structure/noticeboard/command/attack_hand(var/mob/user)
if(!unlocked)
to_chat(user, SPAN_NOTICE("\The [src] is locked."))
return
toggle_open(user)
/obj/structure/noticeboard/command/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.GetID() && allowed(usr))
if(open)
to_chat(user, SPAN_WARNING("You need to close it first."))
return
toggle_lock(user)
return
else if(open)
return ..()
/obj/structure/noticeboard/command/proc/toggle_open(var/mob/user)
open = !open
to_chat(user, SPAN_NOTICE("You [open ? "open" : "close"] \the [src]."))
update_icon()
/obj/structure/noticeboard/command/proc/toggle_lock(var/mob/user)
if(open)
return
else
to_chat(user, SPAN_NOTICE("You [unlocked ? "enable" : "disable"] \the [src]'s maglock."))
if(!do_after(user, 5)) // So you can't spam it.
return
unlocked = !unlocked
to_chat(user, SPAN_NOTICE("You [unlocked ? "disable" : "enable"] the maglock."))
update_icon()
/obj/structure/noticeboard/command/Topic(href, href_list) // Allows to read through the closed glass of the board, but disallows removing and writing.
if("read" in href_list)
..()
else if(open)
..()