Skip to content

Commit

Permalink
Fix job entry message wiki links (cmss13-devs#4823)
Browse files Browse the repository at this point in the history
# About the pull request

This PR is a followup to the issues created by cmss13-devs#4449 fixing job
entry_message_body links to the wiki.

/datum/controller/configuration now has a variable `is_loaded` that can
be checked to see if configuration has already occurred such as the case
for the ASO where subsequent creations of the job datum were not hitting
the proc that would be called on the config load signal.

# Explain why it's good for the game

Broken wiki links harm the new player experience.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


![aso](https://github.com/cmss13-devs/cmss13/assets/76988376/73c0b8e4-78f6-4f34-bfbe-9f74b7f05b14)

![CO](https://github.com/cmss13-devs/cmss13/assets/76988376/30b627bc-afe3-4064-b745-fecab5925970)

![marine](https://github.com/cmss13-devs/cmss13/assets/76988376/25250d85-445f-4506-8d91-3c12d500d20c)

</details>


# Changelog
:cl: Drathek
fix: Fixed various job's entry messages having broken links to the wiki
/:cl:
  • Loading branch information
Drulikar authored Nov 6, 2023
1 parent 81f0ede commit 3ea4e87
Show file tree
Hide file tree
Showing 32 changed files with 45 additions and 30 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/urls.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// placeholder strings to be replaced
#define WIKI_PLACEHOLDER "%WIKIURL%"
#define LAW_PLACEHOLDER "%LAWURL%"

// ------ MISC WIKI LINKS ------ //
#define URL_WIKI_LAW "Marine_Law"
#define URL_WIKI_XENO_QUICKSTART "Xeno_Quickstart_Guide"
Expand Down
4 changes: 4 additions & 0 deletions code/controllers/configuration/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
var/static/regex/ic_filter_regex
var/list/fail_to_topic_whitelisted_ips

var/is_loaded = FALSE

/datum/controller/configuration/proc/admin_reload()
if(IsAdminAdvancedProcCall())
alert_proccall("configuration admin_reload")
Expand Down Expand Up @@ -55,6 +57,8 @@
LoadChatFilter()
LoadTopicRateWhitelist()

is_loaded = TRUE

if(Master)
Master.OnConfigLoad()

Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/civilians/other/liaison.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
selection_class = "job_cl"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/liaison
entry_message_body = "As a <a href='%WIKIURL%'>representative of Weyland-Yutani Corporation</a>, your job requires you to stay in character at all times. You are not required to follow military orders; however, you cannot give military orders. Your primary job is to observe and report back your findings to Weyland-Yutani. Follow regular game rules unless told otherwise by your superiors. Use your office fax machine to communicate with corporate headquarters or to acquire new directives. You may not receive anything back, and this is normal."
entry_message_body = "As a <a href='"+WIKI_PLACEHOLDER+"'>representative of Weyland-Yutani Corporation</a>, your job requires you to stay in character at all times. You are not required to follow military orders; however, you cannot give military orders. Your primary job is to observe and report back your findings to Weyland-Yutani. Follow regular game rules unless told otherwise by your superiors. Use your office fax machine to communicate with corporate headquarters or to acquire new directives. You may not receive anything back, and this is normal."
var/mob/living/carbon/human/active_liaison

/datum/job/civilian/liaison/generate_entry_conditions(mob/living/liaison, whitelist_status)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/civilians/other/mess_seargent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
supervisors = "the auxiliary support officer"
gear_preset = /datum/equipment_preset/uscm_ship/chef
entry_message_body = "<a href='%WIKIURL%'>Your job is to service the marines with excellent food</a>, drinks and entertaining the shipside crew when needed. You have a lot of freedom and it is up to you, to decide what to do with it. Good luck!"
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to service the marines with excellent food</a>, drinks and entertaining the shipside crew when needed. You have a lot of freedom and it is up to you, to decide what to do with it. Good luck!"

/obj/effect/landmark/start/chef
name = JOB_MESS_SERGEANT
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/civilians/support/cmo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
selection_class = "job_cmo"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/uscm_medical/cmo
entry_message_body = "You're a commissioned officer of the USCM. <a href='%WIKIURL%'>You have authority over everything related to Medbay and Research</a>, only able to be overriden by the XO and CO. You are in charge of medical staff, surgery, chemistry, stimulants and keeping the marines healthy overall."
entry_message_body = "You're a commissioned officer of the USCM. <a href='"+WIKI_PLACEHOLDER+"'>You have authority over everything related to Medbay and Research</a>, only able to be overriden by the XO and CO. You are in charge of medical staff, surgery, chemistry, stimulants and keeping the marines healthy overall."

AddTimelock(/datum/job/civilian/professor, list(
JOB_MEDIC_ROLES = 10 HOURS
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/civilians/support/nurse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
selection_class = "job_doctor"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/uscm_medical/nurse
entry_message_body = "<a href='%WIKIURL%'>You are tasked with keeping the Marines healthy and strong.</a> You are also an expert when it comes to medication and treatment, and can do minor surgical procedures. Focus on assisting doctors and triaging wounded marines."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>You are tasked with keeping the Marines healthy and strong.</a> You are also an expert when it comes to medication and treatment, and can do minor surgical procedures. Focus on assisting doctors and triaging wounded marines."

/obj/effect/landmark/start/nurse
name = JOB_NURSE
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/civilians/support/researcher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
selection_class = "job_researcher"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/uscm_medical/researcher
entry_message_body = "You're a commissioned officer of the USCM, though you are not in the ship's chain of command. You are tasked with <a href='%WIKIURL%'>researching</a> and developing new medical treatments, helping your fellow doctors, and generally learning new things. Your role involves a lot of roleplaying, but you can perform the function of a regular doctor. Do not hand out things to Marines without getting permission from your supervisor."
entry_message_body = "You're a commissioned officer of the USCM, though you are not in the ship's chain of command. You are tasked with <a href='"+WIKI_PLACEHOLDER+"'>researching</a> and developing new medical treatments, helping your fellow doctors, and generally learning new things. Your role involves a lot of roleplaying, but you can perform the function of a regular doctor. Do not hand out things to Marines without getting permission from your supervisor."

/datum/job/civilian/researcher/set_spawn_positions(count)
spawn_positions = rsc_slot_formula(count)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/civilians/support/synthetic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
flags_startup_parameters = ROLE_ADD_TO_DEFAULT|ROLE_ADMIN_NOTIFY|ROLE_WHITELISTED|ROLE_CUSTOM_SPAWN
flags_whitelist = WHITELIST_SYNTHETIC
gear_preset = /datum/equipment_preset/synth/uscm
entry_message_body = "You are a <a href='%WIKIURL%'>Synthetic!</a> You are held to a higher standard and are required to obey not only the Server Rules but Marine Law and Synthetic Rules. Failure to do so may result in your White-list Removal. Your primary job is to support and assist all USCM Departments and Personnel on-board. In addition, being a Synthetic gives you knowledge in every field and specialization possible on-board the ship. As a Synthetic you answer to the acting commanding officer. Special circumstances may change this!"
entry_message_body = "You are a <a href='"+WIKI_PLACEHOLDER+"'>Synthetic!</a> You are held to a higher standard and are required to obey not only the Server Rules but Marine Law and Synthetic Rules. Failure to do so may result in your White-list Removal. Your primary job is to support and assist all USCM Departments and Personnel on-board. In addition, being a Synthetic gives you knowledge in every field and specialization possible on-board the ship. As a Synthetic you answer to the acting commanding officer. Special circumstances may change this!"

/datum/job/civilian/synthetic/New()
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
allow_additional = TRUE
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/auxiliary_officer
entry_message_body = "<a href='%WIKIPAGE%'>Your job is to oversee</a> the hangar crew, the intel officers, the engineering department, and requisition department. You have many responsibilities and a few plates to keep spinning but your subordinates are mostly self-reliant. Assist where you can and make sure command personnel are confident the auxiliary departments are operating at peak efficiency."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to oversee</a> the hangar crew, the intel officers, the engineering department, and requisition department. You have many responsibilities and a few plates to keep spinning but your subordinates are mostly self-reliant. Assist where you can and make sure command personnel are confident the auxiliary departments are operating at peak efficiency."

AddTimelock(/datum/job/command/auxiliary_officer, list(
JOB_SQUAD_ROLES = 5 HOURS,
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/auxiliary/crew_chief.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
supervisors = "the pilot officers"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/dcc
entry_message_body = "<a href='%WIKIPAGE%'>Your job is to assist</a> the pilot officer maintain the ship's dropship. You have authority only on the dropship, but you are expected to maintain order, as not to disrupt the pilot."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to assist</a> the pilot officer maintain the ship's dropship. You have authority only on the dropship, but you are expected to maintain order, as not to disrupt the pilot."

AddTimelock(/datum/job/command/crew_chief, list(
JOB_SQUAD_ROLES = 5 HOURS
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/auxiliary/intel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
supervisors = "the auxiliary support officer"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT|ROLE_ADD_TO_SQUAD
gear_preset = "USCM Intelligence Officer (IO) (Cryo)"
entry_message_body = "<a href='%WIKIURL%'>Your job is to assist the marines in collecting intelligence related</a> to the current operation to better inform command of their opposition. You are in charge of gathering any data disks, folders, and notes you may find on the operational grounds and decrypt them to grant the USCM additional resources."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to assist the marines in collecting intelligence related</a> to the current operation to better inform command of their opposition. You are in charge of gathering any data disks, folders, and notes you may find on the operational grounds and decrypt them to grant the USCM additional resources."

/datum/job/command/intel/set_spawn_positions(count)
spawn_positions = int_slot_formula(count)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/auxiliary/pilot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
supervisors = "the auxiliary support officer"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/po
entry_message_body = "<a href='%WIKIPAGE%'>Your job is to fly, protect, and maintain the ship's dropship.</a> While you are an officer, your authority is limited to the dropship, where you have authority over the enlisted personnel. If you are not piloting, there is an autopilot fallback for command, but don't leave the dropship without reason."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to fly, protect, and maintain the ship's dropship.</a> While you are an officer, your authority is limited to the dropship, where you have authority over the enlisted personnel. If you are not piloting, there is an autopilot fallback for command, but don't leave the dropship without reason."

// Dropship Roles is both PO and DCC combined to not force people to backtrack
AddTimelock(/datum/job/command/pilot, list(
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/auxiliary/senior.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
job_options = list("Gunnery Sergeant" = "GySGT", "Master Sergeant" = "MSgt", "First Sergeant" = "1Sgt", "Master Gunnery Sergeant" = "MGySgt", "Sergeant Major" = "SgtMaj")

/datum/job/command/senior/on_config_load()
entry_message_body = "<a href='%WIKIPAGE%'>You are</a> held to a higher standard and are required to obey not only the Server Rules but <a href='%LAWURL%'>Marine Law</a> and <a href='[CONFIG_GET(string/wikiarticleurl)]/[URL_WIKI_SOP]'>Standard Operating Procedure</a>. Failure to do so may result in your Mentorship Removal. Your primary job is to teach others the game and its mechanics, and offer advice to all USCM Departments and Personnel on-board."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>You are</a> held to a higher standard and are required to obey not only the Server Rules but <a href='"+LAW_PLACEHOLDER+"'>Marine Law</a> and <a href='[CONFIG_GET(string/wikiarticleurl)]/[URL_WIKI_SOP]'>Standard Operating Procedure</a>. Failure to do so may result in your Mentorship Removal. Your primary job is to teach others the game and its mechanics, and offer advice to all USCM Departments and Personnel on-board."
return ..()

/datum/job/command/senior/announce_entry_message(mob/living/carbon/human/H)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/cic/captain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)

/datum/job/command/commander/generate_entry_message()
entry_message_body = "<a href='%WIKIPAGE%'>You are the Commanding Officer of the [MAIN_SHIP_NAME] as well as the operation.</a> Your goal is to lead the Marines on their mission as well as protect and command the ship and her crew. Your job involves heavy roleplay and requires you to behave like a high-ranking officer and to stay in character at all times. As the Commanding Officer your only superior is High Command itself. You must abide by the <a href='[CONFIG_GET(string/wikiarticleurl)]/[URL_WIKI_CO_RULES]'>Commanding Officer Code of Conduct</a>. Failure to do so may result in punitive action against you. Godspeed."
entry_message_body = "<a href='[generate_wiki_link()]'>You are the Commanding Officer of the [MAIN_SHIP_NAME] as well as the operation.</a> Your goal is to lead the Marines on their mission as well as protect and command the ship and her crew. Your job involves heavy roleplay and requires you to behave like a high-ranking officer and to stay in character at all times. As the Commanding Officer your only superior is High Command itself. You must abide by the <a href='[CONFIG_GET(string/wikiarticleurl)]/[URL_WIKI_CO_RULES]'>Commanding Officer Code of Conduct</a>. Failure to do so may result in punitive action against you. Godspeed."
return ..()

/datum/job/command/commander/get_whitelist_status(list/roles_whitelist, client/player)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/cic/staffofficer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
scaled = FALSE
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/so
entry_message_body = "<a href='%WIKIPAGE%'>Your job is to monitor the Marines, man the CIC, and listen to your superior officers.</a> You are in charge of logistics and the overwatch system. You are also in line to take command after other eligible superior commissioned officers."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to monitor the Marines, man the CIC, and listen to your superior officers.</a> You are in charge of logistics and the overwatch system. You are also in line to take command after other eligible superior commissioned officers."

/datum/job/command/bridge/set_spawn_positions(count)
spawn_positions = so_slot_formula(count)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/police/chief_police.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
selection_class = "job_cmp"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/uscm_police/cmp
entry_message_body = "<a href='%WIKIURL%'>You</a> are held by a higher standard and are required to obey not only the server rules but the <a href='%LAWURL%'>Marine Law</a>. Failure to do so may result in a job ban or server ban. You lead the Military Police, ensure your officers maintain peace and stability aboard the ship. Marines can get rowdy after a few weeks of cryosleep! In addition, you are tasked with the security of high-ranking personnel, including the command staff. Keep them safe!"
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>You</a> are held by a higher standard and are required to obey not only the server rules but the <a href='"+LAW_PLACEHOLDER+"'>Marine Law</a>. Failure to do so may result in a job ban or server ban. You lead the Military Police, ensure your officers maintain peace and stability aboard the ship. Marines can get rowdy after a few weeks of cryosleep! In addition, you are tasked with the security of high-ranking personnel, including the command staff. Keep them safe!"

AddTimelock(/datum/job/command/warrant, list(
JOB_POLICE_ROLES = 15 HOURS,
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/police/police.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
selection_class = "job_mp"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/uscm_police/mp
entry_message_body = "<a href='%WIKIPAGE%'>You</a> are held by a higher standard and are required to obey not only the server rules but the <a href='%LAWURL%'>Marine Law</a>. Failure to do so may result in a job ban or server ban. Your primary job is to maintain peace and stability aboard the ship. Marines can get rowdy after a few weeks of cryosleep! In addition, you are tasked with the security of high-ranking personnel, including the command staff. Keep them safe!"
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>You</a> are held by a higher standard and are required to obey not only the server rules but the <a href='"+LAW_PLACEHOLDER+"'>Marine Law</a>. Failure to do so may result in a job ban or server ban. Your primary job is to maintain peace and stability aboard the ship. Marines can get rowdy after a few weeks of cryosleep! In addition, you are tasked with the security of high-ranking personnel, including the command staff. Keep them safe!"

/datum/job/command/police/set_spawn_positions(count)
spawn_positions = mp_slot_formula(count)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/command/police/warden.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
supervisors = "the Chief MP"
gear_preset = /datum/equipment_preset/uscm_ship/uscm_police/warden
entry_message_body = "<a href='%WIKIPAGE%'>You</a> are held by a higher standard and are required to obey not only the server rules but the <a href='%LAWURL%'>Marine Law</a>. Failure to do so may result in a job ban or server ban. Your primary job is to maintain peace and stability aboard the ship. Marines can get rowdy after a few weeks of cryosleep! In addition, you are tasked with the mainting security records and overwatching any prisoners in Brig."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>You</a> are held by a higher standard and are required to obey not only the server rules but the <a href='"+LAW_PLACEHOLDER+"'>Marine Law</a>. Failure to do so may result in a job ban or server ban. Your primary job is to maintain peace and stability aboard the ship. Marines can get rowdy after a few weeks of cryosleep! In addition, you are tasked with the mainting security records and overwatching any prisoners in Brig."

AddTimelock(/datum/job/command/warden, list(
JOB_POLICE_ROLES = 10 HOURS
Expand Down
7 changes: 5 additions & 2 deletions code/game/jobs/job/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
if(!disp_title)
disp_title = title

if(global.config.is_loaded)
on_config_load()

/datum/job/proc/on_config_load()
if(entry_message_body)
entry_message_body = replace_placeholders(entry_message_body)

/datum/job/proc/replace_placeholders(replacement_string)
replacement_string = replacetextEx(replacement_string, "%WIKIURL%", generate_wiki_link())
replacement_string = replacetextEx(replacement_string, "%LAWURL%", "[CONFIG_GET(string/wikiarticleurl)]/[URL_WIKI_LAW]")
replacement_string = replacetextEx(replacement_string, WIKI_PLACEHOLDER, generate_wiki_link())
replacement_string = replacetextEx(replacement_string, LAW_PLACEHOLDER, "[CONFIG_GET(string/wikiarticleurl)]/[URL_WIKI_LAW]")
return replacement_string

/datum/job/proc/generate_wiki_link()
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/logistics/cargo/cargo_tech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
selection_class = "job_ct"
flags_startup_parameters = ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_ship/cargo
entry_message_body = "<a href='%WIKIURL%'>Your job</a> is to dispense supplies to the marines, including weapon attachments. Stay in your department when possible to ensure the marines have full access to the supplies they may require. Listen to the radio in case someone requests a supply drop via the overwatch system."
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job</a> is to dispense supplies to the marines, including weapon attachments. Stay in your department when possible to ensure the marines have full access to the supplies they may require. Listen to the radio in case someone requests a supply drop via the overwatch system."

/datum/job/logistics/cargo/set_spawn_positions(count)
spawn_positions = ct_slot_formula(count)
Expand Down
Loading

0 comments on commit 3ea4e87

Please sign in to comment.