diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index bd873b198f08..a2463bc47316 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -32,6 +32,7 @@
dog_fashion = /datum/dog_fashion/head
var/info = "" // What's prewritten on the paper. Appears first and is a special snowflake callback to how paper used to work.
+ var/coloroverride // A hexadecimal as a string that, if set, overrides the font color of the whole document. Used by photocopiers
var/datum/language/infolang // The language info is written in. If left NULL, info will default to being omnilingual and readable by all.
var/list/written//What's written on the paper by people. Stores /datum/langtext values, plus plaintext values that mark where fields are.
var/stamps //The (text for the) stamps on the paper.
@@ -66,7 +67,7 @@
if(resistance_flags & ON_FIRE)
icon_state = "paper_onfire"
return
- if(info)
+ if(info || length(written))
icon_state = "paper_words"
return
icon_state = "paper"
@@ -138,7 +139,10 @@
onclose(usr, "[name]")
/obj/item/paper/proc/render_body(mob/user,links = FALSE)
- var/text = info // The actual text displayed. Starts with & defaults to $info.
+ var/text = ""// The actual text displayed. Starts with & defaults to $info.
+ if(coloroverride)
+ text = ""
+ text += info
if(istype(infolang) && !user.has_language(infolang))
var/datum/language/paperlang = GLOB.language_datum_instances[infolang]
text = paperlang.scramble_HTML(text)
@@ -156,6 +160,8 @@
text += "" + "write" + ""
if(links)
text += "" + "write" + ""
+ if(coloroverride)
+ text += ""
return text
/obj/item/paper/proc/clearpaper()
@@ -253,7 +259,7 @@
if(id == "end")
written += templist
else
- written.Insert(id,templist)
+ written.Insert(text2num(id),templist) // text2num, otherwise it writes to the hashtable index instead of into the array
usr << browse("
[name][render_body(usr,TRUE)]
[stamps]", "window=[name]") // Update the window
update_icon()
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 176d55cc2569..27d862e8597a 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -7,6 +7,7 @@
/*
* Photocopier
*/
+
/obj/machinery/photocopier
name = "photocopier"
desc = "Used to copy important documents and anatomy studies."
@@ -51,6 +52,10 @@
user << browse(dat, "window=copier")
onclose(user, "copier")
+/obj/machinery/photocopier/proc/clearcolor(text) // Breaks all font color spans in the HTML text.
+ return replacetext(replacetext(text, ""
+ c.coloroverride = "101010"
else //no toner? shitty copies for you!
- c.info = ""
- var/copied = copy.info
- copied = replacetext(copied, ""
+ c.coloroverride = "808080"
+ var/copyinfo = copy.info
+ copyinfo = clearcolor(copyinfo)
+ c.info += copyinfo + ""
+ //Now for copying the new $written var
+ for(var/L in copy.written)
+ if(istype(L,/datum/langtext))
+ var/datum/langtext/oldL = L
+ var/datum/langtext/newL = new(clearcolor(oldL.text),oldL.lang)
+ c.written += newL
+ else
+ c.written += L
c.name = copy.name
c.fields = copy.fields
c.update_icon()
@@ -114,7 +125,7 @@
for(var/i = 0, i < copies, i++)
var/icon/temp_img
if(ishuman(ass) && (ass.get_item_by_slot(SLOT_W_UNIFORM) || ass.get_item_by_slot(SLOT_WEAR_SUIT)))
- to_chat(usr, "You feel kind of silly, copying [ass == usr ? "your" : ass][ass == usr ? "" : "\'s"] ass with [ass == usr ? "your" : "[ass.p_their()]"] clothes on." )
+ to_chat(usr, "You feel kind of silly, copying [ass == usr ? "your" : ass][ass == usr ? "" : "\'s"] ass with [ass == usr ? "your" : "[ass.p_their()]"] clothes on." ) // '
break
else if(toner >= 5 && !busy && check_ass()) //You have to be sitting on the copier and either be a xeno or a human without clothes on.
if(isalienadult(ass) || istype(ass, /mob/living/simple_animal/hostile/alien)) //Xenos have their own asses, thanks to Pybro.
@@ -239,7 +250,7 @@
if(!user.temporarilyRemoveItemFromInventory(O))
return
qdel(O)
- toner = 40
+ toner = initial(toner)
to_chat(user, "You insert [O] into [src].")
updateUsrDialog()
else
@@ -332,3 +343,4 @@
grind_results = list(/datum/reagent/iodine = 40, /datum/reagent/iron = 10)
var/charges = 5
var/max_charges = 5
+