512 forward compatibility merge
This commit is contained in:
committed by
CitadelStationBot
parent
fd2705b6e6
commit
4b297f509e
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/item/clipboard
|
||||
name = "clipboard"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
@@ -120,3 +121,127 @@
|
||||
//Update everything
|
||||
attack_self(usr)
|
||||
update_icon()
|
||||
=======
|
||||
/obj/item/clipboard
|
||||
name = "clipboard"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "clipboard"
|
||||
item_state = "clipboard"
|
||||
throwforce = 0
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
var/obj/item/pen/haspen //The stored pen.
|
||||
var/obj/item/paper/toppaper //The topmost piece of paper.
|
||||
slot_flags = SLOT_BELT
|
||||
resistance_flags = FLAMMABLE
|
||||
|
||||
/obj/item/clipboard/Initialize()
|
||||
update_icon()
|
||||
. = ..()
|
||||
|
||||
/obj/item/clipboard/Destroy()
|
||||
QDEL_NULL(haspen)
|
||||
QDEL_NULL(toppaper) //let movable/Destroy handle the rest
|
||||
return ..()
|
||||
|
||||
/obj/item/clipboard/update_icon()
|
||||
cut_overlays()
|
||||
if(toppaper)
|
||||
add_overlay(toppaper.icon_state)
|
||||
copy_overlays(toppaper)
|
||||
if(haspen)
|
||||
add_overlay("clipboard_pen")
|
||||
add_overlay("clipboard_over")
|
||||
|
||||
|
||||
/obj/item/clipboard/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/paper))
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
toppaper = W
|
||||
to_chat(user, "<span class='notice'>You clip the paper onto \the [src].</span>")
|
||||
update_icon()
|
||||
else if(toppaper)
|
||||
toppaper.attackby(user.get_active_held_item(), user)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/clipboard/attack_self(mob/user)
|
||||
var/dat = "<title>Clipboard</title>"
|
||||
if(haspen)
|
||||
dat += "<A href='?src=[REF(src)];pen=1'>Remove Pen</A><BR><HR>"
|
||||
else
|
||||
dat += "<A href='?src=[REF(src)];addpen=1'>Add Pen</A><BR><HR>"
|
||||
|
||||
//The topmost paper. You can't organise contents directly in byond, so this is what we're stuck with. -Pete
|
||||
if(toppaper)
|
||||
var/obj/item/paper/P = toppaper
|
||||
dat += "<A href='?src=[REF(src)];write=[REF(P)]'>Write</A> <A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A> - <A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A><BR><HR>"
|
||||
|
||||
for(P in src)
|
||||
if(P == toppaper)
|
||||
continue
|
||||
dat += "<A href='?src=[REF(src)];write=[REF(P)]'>Write</A> <A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A> <A href='?src=[REF(src)];top=[REF(P)]'>Move to top</A> - <A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A><BR>"
|
||||
user << browse(dat, "window=clipboard")
|
||||
onclose(user, "clipboard")
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
/obj/item/clipboard/Topic(href, href_list)
|
||||
..()
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if(usr.contents.Find(src))
|
||||
|
||||
if(href_list["pen"])
|
||||
if(haspen)
|
||||
haspen.loc = usr.loc
|
||||
usr.put_in_hands(haspen)
|
||||
haspen = null
|
||||
|
||||
if(href_list["addpen"])
|
||||
if(!haspen)
|
||||
var/obj/item/held = usr.get_active_held_item()
|
||||
if(istype(held, /obj/item/pen))
|
||||
var/obj/item/pen/W = held
|
||||
if(!usr.transferItemToLoc(W, src))
|
||||
return
|
||||
haspen = W
|
||||
to_chat(usr, "<span class='notice'>You slot [W] into [src].</span>")
|
||||
|
||||
if(href_list["write"])
|
||||
var/obj/item/P = locate(href_list["write"])
|
||||
if(istype(P) && P.loc == src)
|
||||
if(usr.get_active_held_item())
|
||||
P.attackby(usr.get_active_held_item(), usr)
|
||||
|
||||
if(href_list["remove"])
|
||||
var/obj/item/P = locate(href_list["remove"])
|
||||
if(istype(P) && P.loc == src)
|
||||
P.loc = usr.loc
|
||||
usr.put_in_hands(P)
|
||||
if(P == toppaper)
|
||||
toppaper = null
|
||||
var/obj/item/paper/newtop = locate(/obj/item/paper) in src
|
||||
if(newtop && (newtop != P))
|
||||
toppaper = newtop
|
||||
else
|
||||
toppaper = null
|
||||
|
||||
if(href_list["read"])
|
||||
var/obj/item/paper/P = locate(href_list["read"])
|
||||
if(istype(P) && P.loc == src)
|
||||
usr.examinate(P)
|
||||
|
||||
if(href_list["top"])
|
||||
var/obj/item/P = locate(href_list["top"])
|
||||
if(istype(P) && P.loc == src)
|
||||
toppaper = P
|
||||
to_chat(usr, "<span class='notice'>You move [P.name] to the top.</span>")
|
||||
|
||||
//Update everything
|
||||
attack_self(usr)
|
||||
update_icon()
|
||||
>>>>>>> 626302c... Merge pull request #32161 from ninjanomnom/512-experimental
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
var/i
|
||||
for(i=contents.len, i>=1, i--)
|
||||
var/obj/item/P = contents[i]
|
||||
dat += "<tr><td><a href='?src=\ref[src];retrieve=\ref[P]'>[P.name]</a></td></tr>"
|
||||
dat += "<tr><td><a href='?src=[REF(src)];retrieve=[REF(P)]'>[P.name]</a></td></tr>"
|
||||
dat += "</table></center>"
|
||||
user << browse("<html><head><title>[name]</title></head><body>[dat]</body></html>", "window=filingcabinet;size=350x300")
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
var/dat = "<title>[name]</title>"
|
||||
|
||||
for(var/obj/item/I in src)
|
||||
dat += "<A href='?src=\ref[src];remove=\ref[I]'>Remove</A> - <A href='?src=\ref[src];read=\ref[I]'>[I.name]</A><BR>"
|
||||
dat += "<A href='?src=[REF(src)];remove=[REF(I)]'>Remove</A> - <A href='?src=[REF(src)];read=[REF(I)]'>[I.name]</A><BR>"
|
||||
user << browse(dat, "window=folder")
|
||||
onclose(user, "folder")
|
||||
add_fingerprint(usr)
|
||||
|
||||
@@ -175,8 +175,8 @@
|
||||
/obj/item/paper/proc/updateinfolinks()
|
||||
info_links = info
|
||||
for(var/i in 1 to min(fields, 15))
|
||||
addtofield(i, "<font face=\"[PEN_FONT]\"><A href='?src=\ref[src];write=[i]'>write</A></font>", 1)
|
||||
info_links = info_links + "<font face=\"[PEN_FONT]\"><A href='?src=\ref[src];write=end'>write</A></font>"
|
||||
addtofield(i, "<font face=\"[PEN_FONT]\"><A href='?src=[REF(src)];write=[i]'>write</A></font>", 1)
|
||||
info_links = info_links + "<font face=\"[PEN_FONT]\"><A href='?src=[REF(src)];write=end'>write</A></font>"
|
||||
|
||||
|
||||
/obj/item/paper/proc/clearpaper()
|
||||
@@ -277,7 +277,7 @@
|
||||
else
|
||||
info += t // Oh, he wants to edit to the end of the file, let him.
|
||||
updateinfolinks()
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY><div align='right'style='position:fixed;bottom:0;font-style:bold;'><A href='?src=\ref[src];help=1'>\[?\]</A></div></HTML>", "window=[name]") // Update the window
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY><div align='right'style='position:fixed;bottom:0;font-style:bold;'><A href='?src=[REF(src)];help=1'>\[?\]</A></div></HTML>", "window=[name]") // Update the window
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
|
||||
if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon))
|
||||
if(user.is_literate())
|
||||
user << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY><div align='right'style='position:fixed;bottom:0;font-style:bold;'><A href='?src=\ref[src];help=1'>\[?\]</A></div></HTML>", "window=[name]")
|
||||
user << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY><div align='right'style='position:fixed;bottom:0;font-style:bold;'><A href='?src=[REF(src)];help=1'>\[?\]</A></div></HTML>", "window=[name]")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You don't know how to read or write.</span>")
|
||||
|
||||
@@ -41,18 +41,18 @@
|
||||
|
||||
var/dat = "Photocopier<BR><BR>"
|
||||
if(copy || photocopy || doccopy || (ass && (ass.loc == src.loc)))
|
||||
dat += "<a href='byond://?src=\ref[src];remove=1'>Remove Paper</a><BR>"
|
||||
dat += "<a href='byond://?src=[REF(src)];remove=1'>Remove Paper</a><BR>"
|
||||
if(toner)
|
||||
dat += "<a href='byond://?src=\ref[src];copy=1'>Copy</a><BR>"
|
||||
dat += "<a href='byond://?src=[REF(src)];copy=1'>Copy</a><BR>"
|
||||
dat += "Printing: [copies] copies."
|
||||
dat += "<a href='byond://?src=\ref[src];min=1'>-</a> "
|
||||
dat += "<a href='byond://?src=\ref[src];add=1'>+</a><BR><BR>"
|
||||
dat += "<a href='byond://?src=[REF(src)];min=1'>-</a> "
|
||||
dat += "<a href='byond://?src=[REF(src)];add=1'>+</a><BR><BR>"
|
||||
if(photocopy)
|
||||
dat += "Printing in <a href='byond://?src=\ref[src];colortoggle=1'>[greytoggle]</a><BR><BR>"
|
||||
dat += "Printing in <a href='byond://?src=[REF(src)];colortoggle=1'>[greytoggle]</a><BR><BR>"
|
||||
else if(toner)
|
||||
dat += "Please insert paper to copy.<BR><BR>"
|
||||
if(isAI(user))
|
||||
dat += "<a href='byond://?src=\ref[src];aipic=1'>Print photo from database</a><BR><BR>"
|
||||
dat += "<a href='byond://?src=[REF(src)];aipic=1'>Print photo from database</a><BR><BR>"
|
||||
dat += "Current toner level: [toner]"
|
||||
if(!toner)
|
||||
dat +="<BR>Please insert a new toner cartridge!"
|
||||
|
||||
Reference in New Issue
Block a user