diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 45c84978c64..e979556e747 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -52,31 +52,6 @@ GLOB.laugh_types[L.name] = spath sortList(GLOB.laugh_types, /proc/cmp_typepaths_asc) - //For alt titles. - for(var/spath in subtypesof(/datum/job)) - var/datum/job/J = new spath() - if(istype(J, /datum/job/captain)) - GLOB.captain_alttitles += J.alt_titles - if(/datum/job_department/central_command in J.departments_list) - GLOB.central_command_alttitles += J.alt_titles - if(/datum/job_department/command in J.departments_list) - GLOB.command_alttitles += J.alt_titles - if(/datum/job_department/security in J.departments_list) - GLOB.security_alttitles += J.alt_titles - if(/datum/job_department/cargo in J.departments_list) - GLOB.supply_alttitles += J.alt_titles - if(/datum/job_department/service in J.departments_list) - GLOB.service_alttitles += J.alt_titles - if(/datum/job_department/medical in J.departments_list) - GLOB.medical_alttitles += J.alt_titles - if(/datum/job_department/science in J.departments_list) - GLOB.science_alttitles += J.alt_titles - if(/datum/job_department/engineering in J.departments_list) - GLOB.engineering_alttitles += J.alt_titles - if(/datum/job_department/silicon in J.departments_list) - GLOB.nonhuman_alttitles += J.alt_titles - //SKYRAT EDIT END - //Species for(var/spath in subtypesof(/datum/species)) var/datum/species/S = new spath() diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index b0881e6223f..f032a357f70 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -141,6 +141,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) var/datum/data/record/foundrecord = find_record("name", name, GLOB.data_core.general) if(foundrecord) foundrecord.fields["rank"] = assignment + foundrecord.fields["truerank"] = assignment // SKYRAT EDIT - ALT TITLES /datum/datacore/proc/get_manifest() // First we build up the order in which we want the departments to appear in. @@ -153,12 +154,14 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) for(var/datum/data/record/record as anything in GLOB.data_core.general) var/name = record.fields["name"] var/rank = record.fields["rank"] - var/datum/job/job = SSjob.GetJob(rank) + var/truerank = record.fields["truerank"] // SKYRAT EDIT ADD - ALT TITLES + var/datum/job/job = SSjob.GetJob(truerank) // SKYRAT EDIT - ORIGINAL CALLED GetJob(rank) if(!job || !(job.job_flags & JOB_CREW_MANIFEST) || !LAZYLEN(job.departments_list)) // In case an unlawful custom rank is added. var/list/misc_list = manifest_out[DEPARTMENT_UNASSIGNED] misc_list[++misc_list.len] = list( "name" = name, "rank" = rank, + "truerank" = truerank, ) continue for(var/department_type as anything in job.departments_list) @@ -169,6 +172,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) var/list/entry = list( "name" = name, "rank" = rank, + "truerank" = truerank, ) var/list/department_list = manifest_out[department.department_name] if(istype(job, department.department_head)) @@ -220,10 +224,11 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) if(H.mind?.assigned_role.job_flags & JOB_CREW_MANIFEST) var/assignment = H.mind.assigned_role.title //SKYRAT EDIT ADD - ALTERNATE JOB TITLES - if(H.client && H.client.prefs && H.client.prefs.alt_titles_preferences[assignment]) // latejoin - assignment = H.client.prefs.alt_titles_preferences[assignment] - else if(C && C.prefs && C.prefs.alt_titles_preferences[assignment]) // roundstart - yes both do separate things i don't fucking know why but they do and if they're not both there then they don't fucking work leave me ALONE - assignment = C.prefs.alt_titles_preferences[assignment] + var/true_assignment = assignment + if(H.client && H.client.prefs && H.client.prefs.alt_titles_preferences[true_assignment]) // latejoin + assignment = H.client.prefs.alt_titles_preferences[true_assignment] + else if(C && C.prefs && C.prefs.alt_titles_preferences[true_assignment]) // roundstart - yes both do separate things i don't fucking know why but they do and if they're not both there then they don't fucking work leave me ALONE + assignment = C.prefs.alt_titles_preferences[true_assignment] //SKYRAT EDIT ADD END var/static/record_id_num = 1001 var/id = num2hex(record_id_num++,6) @@ -247,6 +252,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) G.fields["id"] = id G.fields["name"] = H.real_name G.fields["rank"] = assignment + G.fields["truerank"] = true_assignment // SKYRAT EDIT ADD - ALT TITLES G.fields["age"] = H.age G.fields["species"] = H.dna.species.name G.fields["fingerprint"] = md5(H.dna.unique_identity) @@ -306,6 +312,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) L.fields["id"] = md5("[H.real_name][assignment]") //surely this should just be id, like the others? L.fields["name"] = H.real_name L.fields["rank"] = assignment + L.fields["truerank"] = true_assignment // SKYRAT EDIT ADD - ALT TITLES L.fields["age"] = H.age L.fields["gender"] = H.gender if(H.gender == "male") diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index c090de197a1..a8aaf6dc973 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -289,7 +289,9 @@ C.registered_name = H.real_name if(H.age) C.registered_age = H.age - J.get_id_titles(H, C) // SKYRAT EDIT ADD - ALT TITLES + if(H.alt_title_holder) // SKYRAT EDIT ADD -- ALT TITLES + C.real_title = J.title + C.assignment = H.alt_title_holder // SKYRAT EDIT ADD END C.update_label() C.update_icon() var/datum/bank_account/B = SSeconomy.bank_accounts_by_id["[H.account_id]"] @@ -301,8 +303,9 @@ var/obj/item/pda/PDA = H.get_item_by_slot(pda_slot) if(istype(PDA)) PDA.owner = H.real_name - J.get_pda_titles(H, PDA) // SKYRAT EDIT ADD - ALT TITLES - // PDA.ownjob = J.title - SKYRAT EDIT - OVERWRITTEN IN ALT TITLES + PDA.ownjob = J.title + if(H.alt_title_holder) // SKYRAT EDIT ADD -- ALT TITLES + PDA.ownjob = H.alt_title_holder // SKYRAT EDIT ADD END PDA.update_label() if(H.client?.prefs.playtime_reward_cloak) @@ -422,6 +425,11 @@ player_client.prefs.real_name = player_client.prefs.pref_species.random_name(player_client.prefs.gender, TRUE) dna.update_dna_identity() + //SKYRAT EDIT ADD -- ALT TITLES + if(player_client && player_client.prefs && player_client.prefs.alt_titles_preferences[job.title]) + alt_title_holder = player_client.prefs.alt_titles_preferences[job.title] + //SKYRAT EDIT ADD END + /mob/living/silicon/ai/apply_prefs_job(client/player_client, datum/job/job) if(GLOB.current_anonymous_theme) @@ -430,6 +438,12 @@ apply_pref_name("ai", player_client) // This proc already checks if the player is appearance banned. set_core_display_icon(null, player_client) + //SKYRAT EDIT ADD -- ALT TITLES + if(player_client && player_client.prefs && player_client.prefs.alt_titles_preferences[job.title]) + alt_title_holder = player_client.prefs.alt_titles_preferences[job.title] + if(aiPDA && alt_title_holder) + aiPDA.ownjob = alt_title_holder + //SKYRAT EDIT ADD END /mob/living/silicon/robot/apply_prefs_job(client/player_client, datum/job/job) if(mmi) @@ -455,6 +469,13 @@ if(!GLOB.current_anonymous_theme && player_client.prefs.custom_names["cyborg"] != DEFAULT_CYBORG_NAME) apply_pref_name("cyborg", player_client) + //SKYRAT EDIT ADD -- ALT TITLES + if(player_client && player_client.prefs && player_client.prefs.alt_titles_preferences[job.title]) + alt_title_holder = player_client.prefs.alt_titles_preferences[job.title] + if(aiPDA && alt_title_holder) + aiPDA.ownjob = alt_title_holder + //SKYRAT EDIT ADD END + /** * Called after a successful roundstart spawn. * Client is not yet in the mob. diff --git a/code/modules/jobs/job_types/security_officer.dm b/code/modules/jobs/job_types/security_officer.dm index 967bf5ca258..272b2a1db65 100644 --- a/code/modules/jobs/job_types/security_officer.dm +++ b/code/modules/jobs/job_types/security_officer.dm @@ -115,13 +115,10 @@ GLOBAL_LIST_EMPTY(security_officer_distribution) var/obj/item/card/id/worn_id = spawning.wear_id SSid_access.apply_trim_to_card(worn_id, dep_trim) spawning.sec_hud_set_ID() - //SKYRAT EDIT ADDITION + //SKYRAT EDIT ADDITION -- ALT TITLES if(player_client && player_client.prefs && player_client.prefs.alt_titles_preferences[title]) - worn_id.assignment = player_client.prefs.alt_titles_preferences[title] - worn_id.update_label() - else if (alt_title_pref) - worn_id.assignment = alt_title_pref - worn_id.update_label() + spawning.alt_title_holder = player_client.prefs.alt_titles_preferences[title] + worn_id.assignment = "[spawning.alt_title_holder] ([department])" //SKYRAT EDIT END var/spawn_point = pick(LAZYACCESS(GLOB.department_security_spawns, department)) diff --git a/modular_skyrat/master_files/code/modules/mob/living/dead/new_player/new_player.dm b/modular_skyrat/master_files/code/modules/mob/living/dead/new_player/new_player.dm index 10fe5149849..0cbbe0f6d7b 100644 --- a/modular_skyrat/master_files/code/modules/mob/living/dead/new_player/new_player.dm +++ b/modular_skyrat/master_files/code/modules/mob/living/dead/new_player/new_player.dm @@ -486,13 +486,18 @@ for(var/datum/job/job_datum as anything in department.department_jobs) if(IsJobUnavailable(job_datum.title, TRUE) != JOB_AVAILABLE) continue + var/jobline = "" var/command_bold = "" - if(job_datum.departments_bitflags & DEPARTMENT_BITFLAG_COMMAND) + if((job_datum.departments_bitflags & DEPARTMENT_BITFLAG_COMMAND) || (job_datum.departments_bitflags & DEPARTMENT_BITFLAG_CENTRAL_COMMAND)) command_bold = " command" if(job_datum in SSjob.prioritized_jobs) - dept_data += "[job_datum.title] ([job_datum.current_positions])" + jobline = "[job_datum.title] ([job_datum.current_positions])" else - dept_data += "[job_datum.title] ([job_datum.current_positions])" + jobline = "[job_datum.title] ([job_datum.current_positions])" + + if(client && client.prefs && client.prefs.alt_titles_preferences[job_datum.title]) + jobline += "(as [client.prefs.alt_titles_preferences[job_datum.title]])" + dept_data += jobline if(!length(dept_data)) dept_data += "No positions open." diff --git a/modular_skyrat/modules/altjobtitles/code/_job.dm b/modular_skyrat/modules/altjobtitles/code/_job.dm index 2cfece422fb..f0828a420cd 100644 --- a/modular_skyrat/modules/altjobtitles/code/_job.dm +++ b/modular_skyrat/modules/altjobtitles/code/_job.dm @@ -1,37 +1,25 @@ -/datum/job - var/alt_title_pref - -/datum/job/proc/get_alt_title_pref(client/preference_source) - if(preference_source && preference_source.prefs && preference_source.prefs.alt_titles_preferences[title]) - alt_title_pref = preference_source.prefs.alt_titles_preferences[title] - else - alt_title_pref = title - -/datum/job/proc/get_id_titles(mob/living/carbon/human/H, obj/item/card/id/ID) - ID.real_title = title - if(H.client && H.client.prefs && H.client.prefs.alt_titles_preferences[title]) - ID.assignment = H.client.prefs.alt_titles_preferences[title] - else if (alt_title_pref) - ID.assignment = alt_title_pref - else - ID.assignment = title - -/datum/job/proc/get_pda_titles(mob/living/carbon/human/H, obj/item/pda/PDA) - if(H.client && H.client.prefs && H.client.prefs.alt_titles_preferences[title]) - PDA.ownjob = H.client.prefs.alt_titles_preferences[title] - else if (alt_title_pref) - PDA.ownjob = alt_title_pref - else - PDA.ownjob = title +/mob/living + /// used to hold alt titles because apparently a round-start player applies post-equip before there's a goddamn client in the mob AAAAAAAAAAAAAAAAA + var/alt_title_holder /datum/job/proc/announce_head(mob/living/carbon/human/H, channels) //tells the given channel that the given mob is the new department head. See communications.dm for valid channels. if(H && GLOB.announcement_systems.len) - if(alt_title_pref) + if(H.alt_title_holder) //timer because these should come after the captain announcement - SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/_addtimer, CALLBACK(pick(GLOB.announcement_systems), /obj/machinery/announcement_system/proc/announce, "NEWHEAD", H.real_name, alt_title_pref, channels), 1)) + SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/_addtimer, CALLBACK(pick(GLOB.announcement_systems), /obj/machinery/announcement_system/proc/announce, "NEWHEAD", H.real_name, H.alt_title_holder, channels), 1)) else SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/_addtimer, CALLBACK(pick(GLOB.announcement_systems), /obj/machinery/announcement_system/proc/announce, "NEWHEAD", H.real_name, H.job, channels), 1)) +//Central Command +/datum/job/admiral + alt_titles = list("Fleet Admiral", "Fleet Commander") + +/datum/job/nanotrasen_representative + alt_titles = list("Nanotrasen Diplomat", "Central Command Representative") + +/datum/job/blueshield + alt_titles = list("Command Bodyguard", "Executive Protection Agent", "Personal Protection Specialist") + //Command /datum/job/captain alt_titles = list("Station Commander", "Commanding Officer", "Site Manager") @@ -84,6 +72,9 @@ /datum/job/geneticist alt_titles = list("Mutation Researcher") +/datum/job/expeditionary_trooper // taken from chesify's classes update. miss 'em + alt_titles = list("Vanguard Medic", "Vanguard Technician", "Vanguard Pointman", "Vanguard Marksman") + //Cargo /datum/job/cargo_technician alt_titles = list("Deck Worker", "Mailman") @@ -119,12 +110,6 @@ /datum/job/clown alt_titles = list("Jester") -/datum/job/prisoner - alt_titles = list("Low Risk Prisoner", "High Risk Prisoner", "Extreme Risk Prisoner", "Protective Custody Prisoner") - -/datum/job/assistant - alt_titles = list("Civilian", "Tourist", "Businessman", "Trader", "Entertainer", "Off-Duty Staff", "Freelancer") - /datum/job/botanist alt_titles = list("Hydroponicist", "Gardener", "Botanical Researcher", "Herbalist") @@ -150,8 +135,12 @@ /datum/job/brigoff alt_titles = list("Brig Officer", "Prison Guard") -/datum/job/blueshield - alt_titles = list("Command Bodyguard", "Executive Protection Agent", "Personal Protection Specialist") +//Civillian +/datum/job/prisoner + alt_titles = list("Low Risk Prisoner", "High Risk Prisoner", "Extreme Risk Prisoner", "Protective Custody Prisoner") + +/datum/job/assistant + alt_titles = list("Civilian", "Tourist", "Businessman", "Trader", "Entertainer", "Off-Duty Staff", "Freelancer") //Silicon /datum/job/ai diff --git a/modular_skyrat/modules/altjobtitles/code/jobs.dm b/modular_skyrat/modules/altjobtitles/code/jobs.dm deleted file mode 100644 index 668d5d26b69..00000000000 --- a/modular_skyrat/modules/altjobtitles/code/jobs.dm +++ /dev/null @@ -1,19 +0,0 @@ -GLOBAL_LIST_EMPTY(captain_alttitles) - -GLOBAL_LIST_EMPTY(central_command_alttitles) - -GLOBAL_LIST_EMPTY(command_alttitles) - -GLOBAL_LIST_EMPTY(engineering_alttitles) - -GLOBAL_LIST_EMPTY(medical_alttitles) - -GLOBAL_LIST_EMPTY(science_alttitles) - -GLOBAL_LIST_EMPTY(supply_alttitles) - -GLOBAL_LIST_EMPTY(service_alttitles) - -GLOBAL_LIST_EMPTY(security_alttitles) - -GLOBAL_LIST_EMPTY(nonhuman_alttitles) diff --git a/modular_skyrat/modules/nanotrasen_rep/code/nanotrasen_representative.dm b/modular_skyrat/modules/nanotrasen_rep/code/nanotrasen_representative.dm index d5b5585c4f2..628d8ae00c3 100644 --- a/modular_skyrat/modules/nanotrasen_rep/code/nanotrasen_representative.dm +++ b/modular_skyrat/modules/nanotrasen_rep/code/nanotrasen_representative.dm @@ -36,8 +36,6 @@ veteran_only = TRUE - alt_titles = list("Nanotrasen Diplomat", "Central Command Representative") - job_flags = JOB_ANNOUNCE_ARRIVAL | JOB_CREW_MANIFEST | JOB_EQUIP_RANK | JOB_CREW_MEMBER | JOB_NEW_PLAYER_JOINABLE /datum/job/nanotrasen_representative/after_spawn(mob/living/H, mob/M, latejoin) diff --git a/tgstation.dme b/tgstation.dme index 027dd342daf..73947e184eb 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3994,7 +3994,6 @@ #include "modular_skyrat\modules\altjobtitles\code\_job.dm" #include "modular_skyrat\modules\altjobtitles\code\cards_ids.dm" #include "modular_skyrat\modules\altjobtitles\code\game.dm" -#include "modular_skyrat\modules\altjobtitles\code\jobs.dm" #include "modular_skyrat\modules\ambitions\code\ambition.dm" #include "modular_skyrat\modules\ambitions\code\ambition_templates.dm" #include "modular_skyrat\modules\ambitions\code\antag_datums.dm"