")
- var/datum/browser/popup = new(user, "noticeboard-\ref[src]", "Noticeboard")
- popup.set_content(jointext(dat, null))
- popup.open()
+/obj/structure/noticeboard/examine(mob/user)
+ tgui_interact(user)
+ return list()
-/obj/structure/noticeboard/Topic(var/mob/user, var/list/href_list)
- if(href_list["read"])
- var/obj/item/weapon/paper/P = locate(href_list["read"])
- if(P && P.loc == src)
- P.show_content(user)
- . = TOPIC_HANDLED
+/obj/structure/noticeboard/tgui_interact(mob/user, datum/tgui/ui)
+ ui = SStgui.try_update_ui(user, src, ui)
+ if(!ui)
+ ui = new(user, src, "NoticeBoard", name)
+ ui.open()
- if(href_list["look"])
- var/obj/item/weapon/photo/P = locate(href_list["look"])
- if(P && P.loc == src)
- P.show(user)
- . = TOPIC_HANDLED
+/obj/structure/noticeboard/tgui_data(mob/user)
+ var/list/data = ..()
+
+ data["notices"] = list()
+ for(var/obj/item/I in notices)
+ data["notices"].Add(list(list(
+ "ispaper" = istype(I, /obj/item/weapon/paper),
+ "isphoto" = istype(I, /obj/item/weapon/photo),
+ "name" = I.name,
+ "ref" = "\ref[I]",
+ )))
- if(href_list["remove"])
- remove_paper(locate(href_list["remove"]))
- add_fingerprint(user)
- . = TOPIC_REFRESH
+ return data
- 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
- var/mob/living/M = usr
- if(istype(M))
- var/obj/item/weapon/pen/E = M.get_type_in_hands(/obj/item/weapon/pen)
- if(E)
- add_fingerprint(M)
- P.attackby(E, usr)
- else
- to_chat(M, "You'll need something to write with!")
- . = TOPIC_REFRESH
+/obj/structure/noticeboard/tgui_act(action, params)
+ if(..())
+ return TRUE
- if(. == TOPIC_REFRESH)
- interact(user)
+ switch(action)
+ if("read")
+ var/obj/item/weapon/paper/P = locate(params["ref"])
+ if(P && P.loc == src)
+ P.show_content(usr)
+ . = TRUE
+
+ if("look")
+ var/obj/item/weapon/photo/P = locate(params["ref"])
+ if(P && P.loc == src)
+ P.show(usr)
+ . = TRUE
+
+ if("remove")
+ if(!in_range(src, usr))
+ return FALSE
+ var/obj/item/I = locate(params["ref"])
+ remove_paper(I)
+ if(istype(I))
+ usr.put_in_hands(I)
+ add_fingerprint(usr)
+ . = TRUE
+
+ if("write")
+ if(!in_range(src, usr))
+ return FALSE
+ var/obj/item/P = locate(params["ref"])
+ if((P && P.loc == src)) //if the paper's on the board
+ var/mob/living/M = usr
+ if(istype(M))
+ var/obj/item/weapon/pen/E = M.get_type_in_hands(/obj/item/weapon/pen)
+ if(E)
+ add_fingerprint(M)
+ P.attackby(E, usr)
+ else
+ to_chat(M, "You'll need something to write with!")
+ . = TRUE
/obj/structure/noticeboard/anomaly
notices = 5
@@ -190,32 +177,32 @@
P.info = " We keep test dummies in pens here for a reason, so standard procedure should be to activate newfound alien artifacts and place the two in close proximity. Promising items I might even approve monkey testing on."
P.stamped = list(/obj/item/weapon/stamp/rd)
P.overlays = list("paper_stamped_rd")
- src.contents += P
+ contents += P
P = new()
P.name = "Memo RE: materials gathering"
P.info = "Corasang, the hands-on approach to gathering our samples may very well be slow at times, but it's safer than allowing the blundering miners to roll willy-nilly over our dig sites in their mechs, destroying everything in the process. And don't forget the escavation tools on your way out there! - R.W"
P.stamped = list(/obj/item/weapon/stamp/rd)
P.overlays = list("paper_stamped_rd")
- src.contents += P
+ contents += P
P = new()
P.name = "Memo RE: ethical quandaries"
P.info = "Darion-
I don't care what his rank is, our business is that of science and knowledge - questions of moral application do not come into this. Sure, so there are those who would employ the energy-wave particles my modified device has managed to abscond for their own personal gain, but I can hardly see the practical benefits of some of these artifacts our benefactors left behind. Ward--"
P.stamped = list(/obj/item/weapon/stamp/rd)
P.overlays = list("paper_stamped_rd")
- src.contents += P
+ contents += P
P = new()
P.name = "READ ME! Before you people destroy any more samples"
P.info = "how many times do i have to tell you people, these xeno-arch samples are del-i-cate, and should be handled so! careful application of a focussed, concentrated heat or some corrosive liquids should clear away the extraneous carbon matter, while application of an energy beam will most decidedly destroy it entirely - like someone did to the chemical dispenser! W, the one who signs your paychecks"
P.stamped = list(/obj/item/weapon/stamp/rd)
P.overlays = list("paper_stamped_rd")
- src.contents += P
+ contents += P
P = new()
P.name = "Reminder regarding the anomalous material suits"
P.info = "Do you people think the anomaly suits are cheap to come by? I'm about a hair trigger away from instituting a log book for the damn things. Only wear them if you're going out for a dig, and for god's sake don't go tramping around in them unless you're field testing something, R"
P.stamped = list(/obj/item/weapon/stamp/rd)
P.overlays = list("paper_stamped_rd")
- src.contents += P
\ No newline at end of file
+ contents += P
\ No newline at end of file
diff --git a/tgui/packages/tgui/interfaces/NoticeBoard.js b/tgui/packages/tgui/interfaces/NoticeBoard.js
new file mode 100644
index 0000000000..fc097727a7
--- /dev/null
+++ b/tgui/packages/tgui/interfaces/NoticeBoard.js
@@ -0,0 +1,53 @@
+import { round } from 'common/math';
+import { Fragment } from 'inferno';
+import { useBackend } from "../backend";
+import { Box, Button, Flex, Icon, LabeledList, ProgressBar, Section } from "../components";
+import { Window } from "../layouts";
+
+export const NoticeBoard = (props, context) => {
+ const { act, data } = useBackend(context);
+
+ const {
+ notices,
+ } = data;
+
+ return (
+
+
+
+ {notices.length ? (
+
+ {notices.map((notice, i) => (
+
+ {notice.isphoto && (
+
+ ))}
+
+ ) : (
+ No notices posted here.
+ )}
+
+
+
+ );
+};
\ No newline at end of file