Make paperwork popups use UID as a window id.

This commit is contained in:
moxian
2019-11-06 04:40:16 +00:00
parent 8b9f663203
commit a9c19ebb6b
5 changed files with 9 additions and 14 deletions
+4 -4
View File
@@ -63,13 +63,13 @@
qdel(W)
else
if(istype(W, /obj/item/pen) || istype(W, /obj/item/toy/crayon))
usr << browse("", "window=[name]") //Closes the dialog
usr << browse("", "window=PaperBundle[UID()]") //Closes the dialog
P = src[page]
P.attackby(W, user, params)
update_icon()
if(winget(usr, "[name]", "is-visible") == "true") // NOT MY FAULT IT IS A BUILT IN PROC PLEASE DO NOT HIT ME
if(winget(usr, "PaperBundle[UID()]", "is-visible") == "true") // NOT MY FAULT IT IS A BUILT IN PROC PLEASE DO NOT HIT ME
attack_self(usr) //Update the browsed page.
add_fingerprint(usr)
return
@@ -125,7 +125,7 @@
if(istype(src[page], /obj/item/paper))
var/obj/item/paper/P = W
dat += P.show_content(usr, view = 0)
usr << browse(dat, "window=[name]")
usr << browse(dat, "window=PaperBundle[UID()]")
else if(istype(src[page], /obj/item/photo))
var/obj/item/photo/P = W
usr << browse_rsc(P.img, "tmp_photo.png")
@@ -133,7 +133,7 @@
+ "<body style='overflow:hidden'>" \
+ "<div> <img src='tmp_photo.png' width = '180'" \
+ "[P.scribble ? "<div><br> Written on the back:<br><i>[P.scribble]</i>" : ""]"\
+ "</body></html>", "window=[name]")
+ "</body></html>", "window=PaperBundle[UID()]")
/obj/item/paper_bundle/attack_self(mob/user as mob)
src.show_content(user)