Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@
if(!SSticker.IsRoundInProgress() || QDELETED(character))
return
var/area/A = get_area(character)
if(character.mind.role_alt_title)
rank = character.mind.role_alt_title
deadchat_broadcast(" has arrived at the station at <span class='name'>[A.name]</span>.", "<span class='game'><span class='name'>[character.real_name]</span> ([rank])", follow_target = character, message_type=DEADCHAT_ARRIVALRATTLE)
if((!GLOB.announcement_systems.len) || (!character.mind))
return
Expand Down
11 changes: 8 additions & 3 deletions code/controllers/subsystem/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ SUBSYSTEM_DEF(job)
SetupOccupations()
return type_occupations[jobtype]

/datum/controller/subsystem/job/proc/GetPlayerAltTitle(mob/dead/new_player/player, rank)
return player.client.prefs.GetPlayerAltTitle(GetJob(rank))

// Attempts to Assign player to Role
/datum/controller/subsystem/job/proc/AssignRole(mob/dead/new_player/player, rank, latejoin = FALSE)
JobDebug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
Expand All @@ -96,6 +99,7 @@ SUBSYSTEM_DEF(job)
position_limit = job.spawn_positions
JobDebug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
player.mind.assigned_role = rank
player.mind.role_alt_title = GetPlayerAltTitle(player, rank)
unassigned -= player
job.current_positions++
return TRUE
Expand Down Expand Up @@ -463,10 +467,11 @@ SUBSYSTEM_DEF(job)
log_world("Couldn't find a round start spawn point for [rank]")
SendToLateJoin(living_mob)


var/alt_title = null
if(living_mob.mind)
living_mob.mind.assigned_role = rank
to_chat(M, "<b>You are the [rank].</b>")
alt_title = living_mob.mind.role_alt_title
to_chat(M, "<b>You are the [alt_title ? alt_title : rank].</b>")
if(job)
var/new_mob = job.equip(living_mob, null, null, joined_late , null, M.client)
if(ismob(new_mob))
Expand All @@ -483,7 +488,7 @@ SUBSYSTEM_DEF(job)
M.client.holder.auto_deadmin()
else
handle_auto_deadmin_roles(M.client, rank)
to_chat(M, "<b>As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>")
to_chat(M, "<b>As the [alt_title ? alt_title : rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>")
job.radio_help_message(M)
if(job.req_admin_notify)
to_chat(M, "<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>")
Expand Down
12 changes: 11 additions & 1 deletion code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@

/datum/datacore/proc/manifest_modify(name, assignment)
var/datum/data/record/foundrecord = find_record("name", name, GLOB.data_core.general)
var/real_title = assignment
for(var/datum/job/J in SSjob.occupations)
var/list/alttitles = get_alternate_titles(J.title)
if(!J) continue
if(assignment in alttitles)
real_title = J.title
break
if(foundrecord)
foundrecord.fields["rank"] = assignment
foundrecord.fields["real_rank"] = real_title

/datum/datacore/proc/get_manifest()
var/list/manifest_out = list()
Expand Down Expand Up @@ -283,7 +291,9 @@
var/static/list/show_directions = list(SOUTH, WEST)
if(H.mind && (H.mind.assigned_role != H.mind.special_role))
var/assignment
if(H.mind.assigned_role)
if(H.mind.role_alt_title)
assignment = H.mind.role_alt_title
else if(H.mind.assigned_role)
assignment = H.mind.assigned_role
else if(H.job)
assignment = H.job
Expand Down
5 changes: 4 additions & 1 deletion code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
var/memory

var/assigned_role

var/role_alt_title

var/special_role
var/list/restricted_roles = list()
var/list/datum/objective/objectives = list()
Expand Down Expand Up @@ -821,4 +824,4 @@
/mob/living/silicon/pai/mind_initialize()
..()
mind.assigned_role = ROLE_PAI
mind.special_role = ""
mind.special_role = ""
4 changes: 2 additions & 2 deletions code/game/machinery/computer/crew.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new)

if (I)
name = I.registered_name
assignment = I.assignment
ijob = jobs[I.assignment]
assignment = I.originalassignment
ijob = jobs[I.originalassignment]
else
name = "Unknown"
assignment = ""
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
var/list/access = list()
var/registered_name = null // The name registered_name on the card
var/assignment = null
var/originalassignment = null
var/access_txt // mapping aid
var/datum/bank_account/registered_account
var/obj/machinery/paystand/my_store
Expand Down
16 changes: 8 additions & 8 deletions code/modules/admin/sql_ban_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
output += "<div class='row'><div class='column'><label class='rolegroup command'><input type='checkbox' name='Command' class='hidden' [usr.client.prefs.tgui_fancy ? " onClick='toggle_checkboxes(this, \"_dep\")'" : ""]>Command</label><div class='content'>"
//all heads are listed twice so have a javascript call to toggle both their checkboxes when one is pressed
//for simplicity this also includes the captain even though it doesn't do anything
for(var/job in GLOB.command_positions)
for(var/job in GLOB.original_command_positions)
if(break_counter > 0 && (break_counter % 3 == 0))
output += "<br>"
output += {"<label class='inputlabel checkbox'>[job]
Expand All @@ -228,11 +228,11 @@
break_counter++
output += "</div></div>"
//standard departments all have identical handling
var/list/job_lists = list("Security" = GLOB.security_positions,
"Engineering" = GLOB.engineering_positions,
"Medical" = GLOB.medical_positions,
"Science" = GLOB.science_positions,
"Supply" = GLOB.supply_positions)
var/list/job_lists = list("Security" = GLOB.original_security_positions,
"Engineering" = GLOB.original_engineering_positions,
"Medical" = GLOB.original_medical_positions,
"Science" = GLOB.original_science_positions,
"Supply" = GLOB.original_supply_positions)
for(var/department in job_lists)
//the first element is the department head so they need the same javascript call as above
output += "<div class='column'><label class='rolegroup [ckey(department)]'><input type='checkbox' name='[department]' class='hidden' [usr.client.prefs.tgui_fancy ? " onClick='toggle_checkboxes(this, \"_com\")'" : ""]>[department]</label><div class='content'>"
Expand All @@ -251,7 +251,7 @@
break_counter++
output += "</div></div>"
//departments/groups that don't have command staff would throw a javascript error since there's no corresponding reference for toggle_head()
var/list/headless_job_lists = list("Silicon" = GLOB.nonhuman_positions,
var/list/headless_job_lists = list("Silicon" = GLOB.original_nonhuman_positions,
"Abstract" = list("Appearance", "Emote", "OOC", "Voice Announcements"))
for(var/department in headless_job_lists)
output += "<div class='column'><label class='rolegroup [ckey(department)]'><input type='checkbox' name='[department]' class='hidden' [usr.client.prefs.tgui_fancy ? " onClick='toggle_checkboxes(this, \"_com\")'" : ""]>[department]</label><div class='content'>"
Expand All @@ -265,7 +265,7 @@
"}
break_counter++
output += "</div></div>"
var/list/long_job_lists = list("Civilian" = GLOB.civilian_positions,
var/list/long_job_lists = list("Civilian" = GLOB.original_civilian_positions,
"Ghost and Other Roles" = list(ROLE_BRAINWASHED, ROLE_DEATHSQUAD, ROLE_DRONE, ROLE_FUGITIVE, ROLE_HOLOPARASITE, ROLE_LAVALAND, ROLE_MIND_TRANSFER, ROLE_POSIBRAIN, ROLE_SENTIENCE),
"Antagonist Positions" = list(ROLE_ABDUCTOR, ROLE_ALIEN, ROLE_BLOB,
ROLE_BROTHER, ROLE_CHANGELING, ROLE_CULTIST,
Expand Down
34 changes: 32 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/show_credits = TRUE
var/uses_glasses_colour = 0

var/list/player_alt_titles = new()

///Whether emotes will be displayed on runechat. Requires chat_on_map to have effect. Boolean.
var/see_rc_emotes = TRUE

Expand Down Expand Up @@ -976,10 +978,17 @@ GLOBAL_LIST_EMPTY(preferences_datums)
HTML += "<font color=blue>[rank]</font></td><td><font color=blue><b> \[QUIET\]</b></font></td></tr>"
continue
// yogs end

var/rank_display
if(job.alt_titles)
rank_display = "<a class='white' href='?_src_=prefs;preference=job;task=alt_title;job=[rank]'>[GetPlayerAltTitle(job)]</a>"
else
rank_display = "<span class='dark'>[rank]</span>"

if((rank in GLOB.command_positions) || (rank == "AI"))//Bold head jobs
HTML += "<b><span class='dark'>[rank]</span></b>"
HTML += "<b>[rank_display]</b>"
else
HTML += "<span class='dark'>[rank]</span>"
HTML += rank_display

HTML += "</td><td width='40%'>"

Expand Down Expand Up @@ -1042,6 +1051,19 @@ GLOBAL_LIST_EMPTY(preferences_datums)
popup.set_content(HTML)
popup.open(FALSE)

/datum/preferences/proc/GetPlayerAltTitle(datum/job/job)
return player_alt_titles.Find(job.title) > 0 \
? player_alt_titles[job.title] \
: job.title

/datum/preferences/proc/SetPlayerAltTitle(datum/job/job, new_title)
// remove existing entry
if(player_alt_titles.Find(job.title))
player_alt_titles -= job.title
// add one if it's not default
if(job.title != new_title)
player_alt_titles[job.title] = new_title

/datum/preferences/proc/SetJobPreferenceLevel(datum/job/job, level)
if (!job)
return FALSE
Expand Down Expand Up @@ -1231,6 +1253,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(BERANDOMJOB)
joblessrole = RETURNTOLOBBY
SetChoices(user)
if ("alt_title")
var/datum/job/job = SSjob.GetJob(href_list["job"])
if (job)
var/choices = list(job.title) + job.alt_titles
var/choice = input("Pick a title for [job.title].", "Character Generation", GetPlayerAltTitle(job)) as anything in choices | null
if(choice)
SetPlayerAltTitle(job, choice)
SetChoices(user)
if("setJobLevel")
UpdateJobPreference(user, href_list["text"], text2num(href_list["level"]))
else
Expand Down
67 changes: 35 additions & 32 deletions code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
READ_FILE(S["buttons_locked"], buttons_locked)
READ_FILE(S["windowflash"], windowflashing)
READ_FILE(S["be_special"] , be_special)

READ_FILE(S["player_alt_titles"], player_alt_titles)

READ_FILE(S["default_slot"], default_slot)
READ_FILE(S["chat_toggles"], chat_toggles)
Expand Down Expand Up @@ -221,40 +221,40 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
update_preferences(needs_update, S) //needs_update = savefile_version if we need an update (positive integer)

//Sanitize
asaycolor = sanitize_ooccolor(sanitize_hexcolor(asaycolor, 6, 1, initial(asaycolor)))
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1])
hotkeys = sanitize_integer(hotkeys, FALSE, TRUE, initial(hotkeys))
chat_on_map = sanitize_integer(chat_on_map, FALSE, TRUE, initial(chat_on_map))
max_chat_length = sanitize_integer(max_chat_length, 1, CHAT_MESSAGE_MAX_LENGTH, initial(max_chat_length))
asaycolor = sanitize_ooccolor(sanitize_hexcolor(asaycolor, 6, 1, initial(asaycolor)))
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1])
hotkeys = sanitize_integer(hotkeys, FALSE, TRUE, initial(hotkeys))
chat_on_map = sanitize_integer(chat_on_map, FALSE, TRUE, initial(chat_on_map))
max_chat_length = sanitize_integer(max_chat_length, 1, CHAT_MESSAGE_MAX_LENGTH, initial(max_chat_length))
see_chat_non_mob = sanitize_integer(see_chat_non_mob, FALSE, TRUE, initial(see_chat_non_mob))
see_rc_emotes = sanitize_integer(see_rc_emotes, FALSE, TRUE, initial(see_rc_emotes))
tgui_fancy = sanitize_integer(tgui_fancy, FALSE, TRUE, initial(tgui_fancy))
tgui_lock = sanitize_integer(tgui_lock, FALSE, TRUE, initial(tgui_lock))
buttons_locked = sanitize_integer(buttons_locked, FALSE, TRUE, initial(buttons_locked))
windowflashing = sanitize_integer(windowflashing, FALSE, TRUE, initial(windowflashing))
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
toggles = sanitize_integer(toggles, 0, (1 << 23), initial(toggles)) // Yogs -- Fixes toggles not having >16 bits of flagspace
clientfps = sanitize_integer(clientfps, 0, 1000, 0)
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null)
see_rc_emotes = sanitize_integer(see_rc_emotes, FALSE, TRUE, initial(see_rc_emotes))
tgui_fancy = sanitize_integer(tgui_fancy, FALSE, TRUE, initial(tgui_fancy))
tgui_lock = sanitize_integer(tgui_lock, FALSE, TRUE, initial(tgui_lock))
buttons_locked = sanitize_integer(buttons_locked, FALSE, TRUE, initial(buttons_locked))
windowflashing = sanitize_integer(windowflashing, FALSE, TRUE, initial(windowflashing))
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
toggles = sanitize_integer(toggles, 0, (1 << 23), initial(toggles)) // Yogs -- Fixes toggles not having >16 bits of flagspace
clientfps = sanitize_integer(clientfps, 0, 1000, 0)
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null)
ambientocclusion = sanitize_integer(ambientocclusion, FALSE, TRUE, initial(ambientocclusion))
auto_fit_viewport = sanitize_integer(auto_fit_viewport, FALSE, TRUE, initial(auto_fit_viewport))
widescreenpref = sanitize_integer(widescreenpref, FALSE, TRUE, initial(widescreenpref))
pixel_size = sanitize_integer(pixel_size, PIXEL_SCALING_AUTO, PIXEL_SCALING_3X, initial(pixel_size))
scaling_method = sanitize_text(scaling_method, initial(scaling_method))
ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form))
ghost_orbit = sanitize_inlist(ghost_orbit, GLOB.ghost_orbits, initial(ghost_orbit))
ghost_accs = sanitize_inlist(ghost_accs, GLOB.ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION)
ghost_others = sanitize_inlist(ghost_others, GLOB.ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION)
menuoptions = SANITIZE_LIST(menuoptions)
be_special = SANITIZE_LIST(be_special)
pda_style = sanitize_inlist(pda_style, GLOB.pda_styles, initial(pda_style))
pda_color = sanitize_hexcolor(pda_color, 6, 1, initial(pda_color))
skillcape = sanitize_integer(skillcape, 1, 82, initial(skillcape))
map = sanitize_integer(map, FALSE, TRUE, initial(map))
flare = sanitize_integer(flare, FALSE, TRUE, initial(flare))
bar_choice = sanitize_text(bar_choice, initial(bar_choice))
widescreenpref = sanitize_integer(widescreenpref, FALSE, TRUE, initial(widescreenpref))
pixel_size = sanitize_integer(pixel_size, PIXEL_SCALING_AUTO, PIXEL_SCALING_3X, initial(pixel_size))
scaling_method = sanitize_text(scaling_method, initial(scaling_method))
ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form))
ghost_orbit = sanitize_inlist(ghost_orbit, GLOB.ghost_orbits, initial(ghost_orbit))
ghost_accs = sanitize_inlist(ghost_accs, GLOB.ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION)
ghost_others = sanitize_inlist(ghost_others, GLOB.ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION)
menuoptions = SANITIZE_LIST(menuoptions)
be_special = SANITIZE_LIST(be_special)
pda_style = sanitize_inlist(pda_style, GLOB.pda_styles, initial(pda_style))
pda_color = sanitize_hexcolor(pda_color, 6, 1, initial(pda_color))
skillcape = sanitize_integer(skillcape, 1, 82, initial(skillcape))
map = sanitize_integer(map, FALSE, TRUE, initial(map))
flare = sanitize_integer(flare, FALSE, TRUE, initial(flare))
bar_choice = sanitize_text(bar_choice, initial(bar_choice))

var/bar_sanitize = FALSE
for(var/A in GLOB.potential_box_bars)
Expand All @@ -264,6 +264,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(!bar_sanitize)
bar_choice = "Random"

if(!player_alt_titles) player_alt_titles = new()

show_credits = sanitize_integer(show_credits, FALSE, TRUE, initial(show_credits))

// yogs start - Donor features & yogtoggles
Expand Down Expand Up @@ -303,6 +305,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["buttons_locked"], buttons_locked)
WRITE_FILE(S["windowflash"], windowflashing)
WRITE_FILE(S["be_special"], be_special)
WRITE_FILE(S["player_alt_titles"], player_alt_titles)
WRITE_FILE(S["default_slot"], default_slot)
WRITE_FILE(S["toggles"], toggles)
WRITE_FILE(S["chat_toggles"], chat_toggles)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@
if(!I)
return
var/jobName = I.assignment
if(I.originalassignment)
jobName = I.originalassignment
if(jobName in get_all_job_icons()) //Check if the job has a hud icon
return jobName
if(jobName in get_all_centcom_jobs()) //Return with the NT logo if it is a CentCom job
Expand Down
13 changes: 11 additions & 2 deletions code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
//Sellection screen color
var/selection_color = "#ffffff"

//List of alternate titles, if any
var/list/alt_titles

//If this is set to 1, a text is printed to the player when jobs are assigned, telling him that he should let admins know that he has to disconnect.
var/req_admin_notify
Expand Down Expand Up @@ -260,7 +262,11 @@
C.access = J.get_access()
shuffle_inplace(C.access) // Shuffle access list to make NTNet passkeys less predictable
C.registered_name = H.real_name
C.assignment = J.title
if(H.mind?.role_alt_title)
C.assignment = H.mind.role_alt_title
else
C.assignment = J.title
C.originalassignment = H.mind.assigned_role
if(H.age)
C.registered_age = H.age
C.update_label()
Expand All @@ -275,7 +281,10 @@
var/obj/item/pda/PDA = H.get_item_by_slot(pda_slot)
if(istype(PDA))
PDA.owner = H.real_name
PDA.ownjob = J.title
if(H.mind?.role_alt_title)
PDA.ownjob = H.mind.role_alt_title
else
PDA.ownjob = J.title
PDA.update_label()

/datum/outfit/job/get_chameleon_disguise_info()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/jobs/job_types/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
display_order = JOB_DISPLAY_ORDER_AI
var/do_special_check = TRUE

alt_titles = list("Station Central Processor", "Central Silicon Intelligence", "Cyborg Overlord")

/datum/job/ai/equip(mob/living/carbon/human/H, visualsOnly, announce, latejoin, datum/outfit/outfit_override, client/preference_source = null)
if(visualsOnly)
CRASH("dynamic preview is unsupported")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/artist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
selection_color = "#dddddd"

outfit = /datum/outfit/job/artist

alt_titles = list("Painter", "Composer", "Artisan")
access = list()
minimal_access = list()
paycheck = PAYCHECK_ASSISTANT
Expand Down
2 changes: 2 additions & 0 deletions code/modules/jobs/job_types/assistant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Assistant
paycheck_department = ACCOUNT_CIV
display_order = JOB_DISPLAY_ORDER_ASSISTANT

alt_titles = list("Intern", "Apprentice", "Subordinate", "Temporary Worker", "Colleague", "Associate")

/datum/job/assistant/get_access()
if(CONFIG_GET(flag/assistants_have_maint_access) || !CONFIG_GET(flag/jobs_have_minimal_access)) //Config has assistant maint access set
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/modules/jobs/job_types/atmospheric_technician.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
selection_color = "#fff5cc"
exp_requirements = 180
exp_type = EXP_TYPE_CREW
alt_titles = list("Breach Fixer", "Radiation Creator", "Habitation Technician", "Fire Suppression Technician", "Atmospherics Trainee", "Environmental Maintainer")

outfit = /datum/outfit/job/atmos

Expand Down
Loading