From b7b417ae91832b762e6217ccdc7ba2bee5b743fb Mon Sep 17 00:00:00 2001 From: Gary Lafortune Date: Sun, 29 Dec 2019 01:17:57 -0600 Subject: [PATCH 1/8] Fixes bug with paper icon not updating --- code/modules/paperwork/paper.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index bd873b198f08..7373e1938271 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -66,7 +66,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" From ce062bc99562b3b12c57037cc0e2dbf15586f517 Mon Sep 17 00:00:00 2001 From: Gary Lafortune Date: Sun, 29 Dec 2019 01:38:48 -0600 Subject: [PATCH 2/8] Fixes photocopiers failing to copy paper with only player-written text --- code/modules/paperwork/photocopier.dm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 176d55cc2569..b132545fed5d 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -66,16 +66,23 @@ copy_as_paper = 0 if(copy_as_paper) var/obj/item/paper/c = new /obj/item/paper (loc) - if(length(copy.info) > 0) //Only print and add content if the copied doc has words on it + if(length(copy.info) || length(copy.written)) //Only print and add content if the copied doc has words on it if(toner > 10) //lots of toner, make it dark c.info = "" else //no toner? shitty copies for you! c.info = "" - var/copied = copy.info - copied = replacetext(copied, "" + var/copyinfo = copy.info + copyinfo = replacetext(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(oldL.text,oldL.lang) + c.written += newL + else + c.written += L c.name = copy.name c.fields = copy.fields c.update_icon() From ab86b389a2a6943609ad7bd77da8451073ec80c5 Mon Sep 17 00:00:00 2001 From: Gary Lafortune Date: Sun, 29 Dec 2019 02:03:11 -0600 Subject: [PATCH 3/8] Makes the maximum toner amount in photocopiers a #define --- code/modules/paperwork/photocopier.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index b132545fed5d..59b972980cc2 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -7,6 +7,9 @@ /* * Photocopier */ + +#define MAX_TONER 40 // The maximum amount of toner in the photocopier, as well as the amount of toner given by toner cartridges. + /obj/machinery/photocopier name = "photocopier" desc = "Used to copy important documents and anatomy studies." @@ -23,7 +26,7 @@ var/obj/item/photo/photocopy = null var/obj/item/documents/doccopy = null var/copies = 1 //how many copies to print! - var/toner = 40 //how much toner is left! woooooo~ + var/toner = MAX_TONER //how much toner is left! woooooo~ var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier! var/greytoggle = "Greyscale" var/mob/living/ass //i can't believe i didn't write a stupid-ass comment about this var when i first coded asscopy. @@ -246,7 +249,7 @@ if(!user.temporarilyRemoveItemFromInventory(O)) return qdel(O) - toner = 40 + toner = MAX_TONER to_chat(user, "You insert [O] into [src].") updateUsrDialog() else @@ -339,3 +342,6 @@ grind_results = list(/datum/reagent/iodine = 40, /datum/reagent/iron = 10) var/charges = 5 var/max_charges = 5 + + +#undef MAX_TONER From aa3d231696575badb0dbbe964babca3ae43f884b Mon Sep 17 00:00:00 2001 From: Gary Lafortune Date: Sun, 29 Dec 2019 02:04:29 -0600 Subject: [PATCH 4/8] Fixes bug with handwritten paperfields always writing to bottom --- code/modules/paperwork/paper.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 7373e1938271..9c849d85afdb 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -253,7 +253,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() From 950ac88114a88e8a0361f037db08bbb09f5ffcff Mon Sep 17 00:00:00 2001 From: Gary Lafortune Date: Sun, 29 Dec 2019 02:11:57 -0600 Subject: [PATCH 5/8] Fixes old bug with faded toner printing, and paper copying in general Previously, the fading of toner would not affect copies, since they already had an inner dark span gained from the last copy. This fixes that. --- code/modules/paperwork/paper.dm | 8 +++++++- code/modules/paperwork/photocopier.dm | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 9c849d85afdb..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. @@ -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() diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 59b972980cc2..31ee47d80a2a 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -71,9 +71,9 @@ var/obj/item/paper/c = new /obj/item/paper (loc) if(length(copy.info) || length(copy.written)) //Only print and add content if the copied doc has words on it if(toner > 10) //lots of toner, make it dark - c.info = "" + c.coloroverride = "101010" else //no toner? shitty copies for you! - c.info = "" + c.coloroverride = "808080" var/copyinfo = copy.info copyinfo = replacetext(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(oldL.text,oldL.lang) + var/datum/langtext/newL = new(clearcolor(oldL.text),oldL.lang) c.written += newL else c.written += L @@ -124,7 +127,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. From 4dae674eba3b2809f279fd910889d758376bb924 Mon Sep 17 00:00:00 2001 From: Gary Lafortune Date: Mon, 13 Jan 2020 14:11:46 -0600 Subject: [PATCH 7/8] *grumble grumble* --- code/modules/paperwork/photocopier.dm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 97efd421beef..105f81be0b69 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -8,8 +8,6 @@ * Photocopier */ -#define MAX_TONER 40 // The maximum amount of toner in the photocopier, as well as the amount of toner given by toner cartridges. - /obj/machinery/photocopier name = "photocopier" desc = "Used to copy important documents and anatomy studies." @@ -26,7 +24,7 @@ var/obj/item/photo/photocopy = null var/obj/item/documents/doccopy = null var/copies = 1 //how many copies to print! - var/toner = MAX_TONER //how much toner is left! woooooo~ + var/toner = 40 //how much toner is left! woooooo~ var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier! var/greytoggle = "Greyscale" var/mob/living/ass //i can't believe i didn't write a stupid-ass comment about this var when i first coded asscopy. @@ -252,7 +250,7 @@ if(!user.temporarilyRemoveItemFromInventory(O)) return qdel(O) - toner = MAX_TONER + toner = initial(toner) to_chat(user, "You insert [O] into [src].") updateUsrDialog() else From dba3c362c215c4a8c857c3421dad16bf2edcc36c Mon Sep 17 00:00:00 2001 From: Gary Lafortune Date: Mon, 13 Jan 2020 15:21:40 -0600 Subject: [PATCH 8/8] Does the asvee Co-Authored-By: AsV9 --- code/modules/paperwork/photocopier.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 105f81be0b69..27d862e8597a 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -344,5 +344,3 @@ var/charges = 5 var/max_charges = 5 - -#undef MAX_TONER