From 0a80e42d1a0dc296e9828ff9737175a57e42ede1 Mon Sep 17 00:00:00 2001 From: The Malf E <89947174+bruhlookatthisdood@users.noreply.github.com> Date: Tue, 22 Apr 2025 06:46:12 -0500 Subject: [PATCH] Adds [Name] autofill to paperwork (#29000) * add name * Update code/__HELPERS/text.dm Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> Signed-off-by: The Lusty E <89947174+bruhlookatthisdood@users.noreply.github.com> --------- Signed-off-by: The Lusty E <89947174+bruhlookatthisdood@users.noreply.github.com> Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> --- code/__HELPERS/text.dm | 4 +++- code/modules/paperwork/paper.dm | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index eed0db379b5..4f3eeced157 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -449,7 +449,7 @@ // Pencode -/proc/pencode_to_html(text, mob/user, obj/item/pen/P = null, format = 1, sign = 1, fields = 1, deffont = PEN_FONT, signfont = SIGNFONT, crayonfont = CRAYON_FONT, no_font = FALSE) +/proc/pencode_to_html(text, mob/user, obj/item/pen/P = null, format = 1, sign = 1, fields = 1, deffont = PEN_FONT, signfont = SIGNFONT, crayonfont = CRAYON_FONT, no_font = FALSE, name = TRUE) text = replacetext(text, "\[b\]", "") text = replacetext(text, "\[/b\]", "") text = replacetext(text, "\[i\]", "") @@ -470,6 +470,8 @@ text = replacetext(text, "\[sign\]", "[chameleon_pen.forge_name ? chameleon_pen.forge_name : "No name was provided"]") else text = replacetext(text, "\[sign\]", "[user ? user.real_name : "Anonymous"]") + if(name) + text = replacetext(text, "\[name\]", "[user ? user.real_name : "Anonymous"]") if(fields) text = replacetext(text, "\[field\]", "") if(format) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 22eba0bec73..c0b0274893b 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -308,6 +308,7 @@ \[u\] - \[/u\] : Makes the text underlined.
\[large\] - \[/large\] : Increases the size of the text.
\[sign\] : Inserts a signature of your name in a foolproof way.
+ \[name\] : Inserts your regular name, not like your signature.
\[field\] : Inserts an invisible field which lets you start type from there. Useful for forms.

Pen exclusive commands