From 4178abcc33ef74456643462fcd8d5965ab8940f4 Mon Sep 17 00:00:00 2001 From: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Date: Fri, 28 Apr 2023 23:18:40 -0400 Subject: [PATCH] Allows the book binder to remember font typing (#75007) use that for book binding ## About The Pull Request Closes https://github.com/tgstation/tgstation/issues/74996 ## Why It's Good For The Game ## Changelog :cl: fix: Bookbinder no longer takes your pen's font and throws it out the nearest window /:cl: --- code/modules/library/book.dm | 7 ++----- code/modules/paperwork/paper.dm | 11 +++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/modules/library/book.dm b/code/modules/library/book.dm index cb7bd2063f8..42578728554 100644 --- a/code/modules/library/book.dm +++ b/code/modules/library/book.dm @@ -44,12 +44,9 @@ /datum/book_info/proc/set_content_using_paper(obj/item/paper/paper) // Just the paper's raw data. var/raw_content = "" - for(var/datum/paper_input/text_input as anything in paper.raw_text_inputs) - if(!isnull(text_input.colour)) - raw_content += text_input.raw_text - else - raw_content += "[text_input.raw_text]" + raw_content += text_input.to_raw_html() + content = trim(html_encode(raw_content), MAX_PAPER_LENGTH) /datum/book_info/proc/get_content(default="N/A") diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index c7c08ef0d46..b1c3b626101 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -695,6 +695,17 @@ advanced_html = advanced_html, ) +/// Returns the raw contents of the input as html, with **ZERO SANITIZATION** +/datum/paper_input/proc/to_raw_html() + var/final = raw_text + if(font) + final = "[final]" + if(colour) + final = "[final]" + if(bold) + final = "[final]" + return final + /// A single instance of a saved stamp on paper. /datum/paper_stamp /// Asset class of the for rendering in tgui