From b78728e4de02c67db59de7ab58dea549f855ccf5 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:28:06 +0200 Subject: [PATCH] [MIRROR] new keywords for paperwork (#28136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * new keywords for paperwork (#83737) ## About The Pull Request Adds new keywords for fields on paper: %d or %date to set the current in-game date %t or %time to set the current server time (because no one uses station time) ![изображение_2024-06-05_193346902](https://github.com/tgstation/tgstation/assets/112967882/f7e12e6a-f4ac-4f14-a018-c966195ab3bf) ![изображение_2024-06-05_193428394](https://github.com/tgstation/tgstation/assets/112967882/9ccb6e4f-d130-434e-b02a-03cc3221a825) ## Why It's Good For The Game Entering dates and times into documents is very frustrating. This makes it faster and easier ## Changelog :cl: add: Added new keywords (%d, %date, %t, %time) for fields /:cl: * new keywords for paperwork --------- Co-authored-by: Kocma-san <112967882+Kocma-san@users.noreply.github.com> --- code/modules/paperwork/paper.dm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 5dd5515c47c..fe2de7e7520 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -205,8 +205,17 @@ var/datum/paper_field/field_data_datum = null var/is_signature = ((text == "%sign") || (text == "%s")) + var/is_date = ((text == "%date") || (text == "%d")) + var/is_time = ((text == "%time") || (text == "%t")) + + var/field_text = text + if(is_signature) + field_text = signature_name + else if(is_date) + field_text = "[time2text(world.timeofday, "DD/MM")]/[CURRENT_STATION_YEAR]" + else if(is_time) + field_text = time2text(world.timeofday, "hh:mm") - var/field_text = is_signature ? signature_name : text var/field_font = is_signature ? SIGNATURE_FONT : font for(var/datum/paper_field/field_input in raw_field_input_data)