From 203a508acd01dca643564e61671fabf269428c6d Mon Sep 17 00:00:00 2001
From: Henri215 <77684085+Henri215@users.noreply.github.com>
Date: Mon, 13 Mar 2023 19:16:36 -0300
Subject: [PATCH] Ports SS220 AutoComplete for Documents (#20481)
* documents_autocomplete
* part 2
* final adjustments
* Removed some comments by accident
* Apply suggestions from code review
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
* Duplicate definition
* fixing runtime
* S43NW review
---------
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
---
code/modules/paperwork/paper.dm | 110 ++++++++++++++++++--------------
1 file changed, 63 insertions(+), 47 deletions(-)
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index c5743dd64d0..de940873f7c 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -250,11 +250,11 @@
/obj/item/paper/proc/updateinfolinks()
info_links = info
- var/i = 0
- for(i=1,i<=fields,i++)
- addtofield(i, "write", 1)
- info_links = info_links + "write"
-
+ for(var/i in 1 to length(fields))
+ var/write_1 = "write"
+ var/write_2 = "\[a\]"
+ addtofield(i, "[write_1][write_2]", 1)
+ info_links = info_links + "write" + "\[a\]"
/obj/item/paper/proc/clearpaper()
info = null
@@ -304,53 +304,69 @@
\[time\] : Inserts the current station time in HH:MM:SS.