From fcde6a37d970a522ed9dacdbebb0bab0902befa2 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Sat, 30 Sep 2023 08:41:10 -0400 Subject: [PATCH] fix hardcoded para URLs, add wiki link formatter (#22504) * fix hardcoded para URLs, introduce wiki link helper * add tiny doc --- code/__HELPERS/text.dm | 7 +++++++ code/controllers/subsystem/SSjobs.dm | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 1405baa53ef..e141eb0f828 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -768,3 +768,10 @@ if(ofthree == 0) return "[num]" return "[num / (10 ** (ofthree * 3))][GLOB.si_suffixes[round(length(GLOB.si_suffixes) / 2) + ofthree + 1]]" + +/** + * Creates a hyperlink for a specified wiki article. + */ +/proc/wiki_link(article_name, link_text = null) + var/url = "[GLOB.configuration.url.wiki_url]/index.php?title=[article_name]" + return "[link_text ? link_text : url]" diff --git a/code/controllers/subsystem/SSjobs.dm b/code/controllers/subsystem/SSjobs.dm index d49321a9f23..dfbe65c22e2 100644 --- a/code/controllers/subsystem/SSjobs.dm +++ b/code/controllers/subsystem/SSjobs.dm @@ -432,26 +432,26 @@ SUBSYSTEM_DEF(jobs) var/list/L = list("

----------------") L.Add("Your role on the station is: [alt_title ? alt_title : rank].") L.Add("You answer directly to [job.supervisors]. Special circumstances may change this.") - L.Add("For more information on how the station works, see Standard Operating Procedure (SOP).") + L.Add("For more information on how the station works, see [wiki_link("Standard_Operating_Procedure", "Standard Operating Procedure (SOP)")].") if(job.job_department_flags & DEP_FLAG_SERVICE) - L.Add("As a member of Service, make sure to read up on your Department SOP.") + L.Add("As a member of Service, make sure to read up on your [wiki_link("Standard_Operating_Procedure_(Service)", "Department SOP")].") if(job.job_department_flags & DEP_FLAG_SUPPLY) - L.Add("As a member of Supply, make sure to read up on your Department SOP.") + L.Add("As a member of Supply, make sure to read up on your [wiki_link("Standard_Operating_Procedure_(Supply)", "Department SOP")].") if(job.job_department_flags == DEP_FLAG_COMMAND) // Check if theyre only command, like captain/hop/bs/ntrep, to not spam their chatbox - L.Add("As an important member of Command, read up on your Department SOP.") + L.Add("As an important member of Command, read up on your [wiki_link("Standard_Operating_Procedure_(Command)", "Department SOP")].") if(job.job_department_flags & DEP_FLAG_LEGAL) - L.Add("Your job requires complete knowledge of Space Law and Legal Standard Operating Procedure.") + L.Add("Your job requires complete knowledge of [wiki_link("Space Law", "Space Law")] and [wiki_link("Legal_Standard_Operating_Procedure", "Legal Standard Operating Procedure")].") if(job.job_department_flags & DEP_FLAG_ENGINEERING) - L.Add("As a member of Engineering, make sure to read up on your Department SOP.") + L.Add("As a member of Engineering, make sure to read up on your [wiki_link("Standard_Operating_Procedure_(Engineering)", "Department SOP")].") if(job.job_department_flags & DEP_FLAG_MEDICAL) - L.Add("As a member of Medbay, make sure to read up on your Department SOP.") + L.Add("As a member of Medbay, make sure to read up on your [wiki_link("Standard_Operating_Procedure_(Medical)", "Department SOP")].") if(job.job_department_flags & DEP_FLAG_SCIENCE) // geneticist gets both, yeah sure why not - L.Add("As a member of Science, make sure to read up on your Department SOP.") + L.Add("As a member of Science, make sure to read up on your [wiki_link("Standard_Operating_Procedure_(Science)", "Department SOP")].") if(job.job_department_flags & DEP_FLAG_SECURITY) - L.Add("As a member of Security, you are to know Space Law, Legal Standard Operating Procedure, as well as your Department SOP.") + L.Add("As a member of Security, you are to know [wiki_link("Space Law", "Space Law")] and [wiki_link("Legal_Standard_Operating_Procedure", "Legal Standard Operating Procedure")], as well as your [wiki_link("Standard_Operating_Procedure_(Security)", "Department SOP")].") if(job.req_admin_notify) L.Add("You are playing a job that is important for the game progression. If you have to disconnect, please go to cryo and inform command. If you are unable to do so, please notify the admins via adminhelp.") - L.Add("
If you need help, check the wiki or use Mentorhelp(F1)!
") + L.Add("
If you need help, check the [wiki_link("Main_Page", "wiki")] or use Mentorhelp(F1)!") if(job.important_information) L.Add("[job.important_information]") L.Add("----------------


")