mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-09 15:05:38 +01:00
Merge pull request #384 from Jay-Sparrow/Bug-fixin
Alternate Job Titles fix
This commit is contained in:
@@ -202,6 +202,7 @@
|
||||
var/static/list/show_directions = list(SOUTH, WEST)
|
||||
if(H.mind && (H.mind.assigned_role != H.mind.special_role))
|
||||
var/assignment
|
||||
var/displayed_rank
|
||||
if(H.mind.assigned_role)
|
||||
assignment = H.mind.assigned_role
|
||||
else if(H.job)
|
||||
@@ -210,6 +211,8 @@
|
||||
assignment = "Unassigned"
|
||||
if(C && C.prefs && C.prefs.alt_titles_preferences[assignment])
|
||||
assignment = C.prefs.alt_titles_preferences[assignment]
|
||||
if(assignment)
|
||||
displayed_rank = H.client.prefs.alt_titles_preferences[assignment]
|
||||
|
||||
var/static/record_id_num = 1001
|
||||
var/id = num2hex(record_id_num++,6)
|
||||
@@ -233,6 +236,7 @@
|
||||
G.fields["id"] = id
|
||||
G.fields["name"] = H.real_name
|
||||
G.fields["rank"] = assignment
|
||||
G.fields["job_title"] = displayed_rank
|
||||
G.fields["age"] = H.age
|
||||
G.fields["species"] = H.dna.species.name
|
||||
G.fields["fingerprint"] = md5(H.dna.uni_identity)
|
||||
@@ -275,6 +279,7 @@
|
||||
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others?
|
||||
L.fields["name"] = H.real_name
|
||||
L.fields["rank"] = H.mind.assigned_role
|
||||
L.fields["job_title"] = displayed_rank
|
||||
L.fields["age"] = H.age
|
||||
L.fields["sex"] = H.gender
|
||||
L.fields["blood_type"] = H.dna.blood_type
|
||||
|
||||
@@ -17,9 +17,9 @@ GLOBAL_LIST_EMPTY(announcement_systems)
|
||||
circuit = /obj/item/circuitboard/machine/announcement_system
|
||||
|
||||
var/obj/item/radio/headset/radio
|
||||
var/arrival = "%PERSON has signed up as %RANK"
|
||||
var/arrival = "%PERSON has signed up as %DISP_RANK (%RANK)"
|
||||
var/arrivalToggle = 1
|
||||
var/newhead = "%PERSON, %RANK, is the department head."
|
||||
var/newhead = "%PERSON, %DISP_RANK (%RANK), is the department head."
|
||||
var/newheadToggle = 1
|
||||
|
||||
var/greenlight = "Light_Green"
|
||||
@@ -73,24 +73,25 @@ GLOBAL_LIST_EMPTY(announcement_systems)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/announcement_system/proc/CompileText(str, user, rank) //replaces user-given variables with actual thingies.
|
||||
/obj/machinery/announcement_system/proc/CompileText(str, user, rank, displayed_rank) //replaces user-given variables with actual thingies.
|
||||
str = replacetext(str, "%PERSON", "[user]")
|
||||
str = replacetext(str, "%RANK", "[rank]")
|
||||
str = replacetext(str, "%DISP_RANK", "[displayed_rank]")
|
||||
return str
|
||||
|
||||
/obj/machinery/announcement_system/proc/announce(message_type, user, rank, list/channels)
|
||||
/obj/machinery/announcement_system/proc/announce(message_type, user, rank, displayed_rank, list/channels)
|
||||
if(!is_operational())
|
||||
return
|
||||
|
||||
var/message
|
||||
|
||||
if(message_type == "ARRIVAL" && arrivalToggle)
|
||||
message = CompileText(arrival, user, rank)
|
||||
message = CompileText(arrival, user, rank, displayed_rank)
|
||||
else if(message_type == "NEWHEAD" && newheadToggle)
|
||||
message = CompileText(newhead, user, rank)
|
||||
message = CompileText(newhead, user, rank, displayed_rank)
|
||||
//CITADEL EDIT for cryopods
|
||||
else if(message_type == "CRYOSTORAGE")
|
||||
message = CompileText("%PERSON, %RANK has been moved to cryo storage.", user, rank)
|
||||
message = CompileText("%PERSON, %DISP_RANK (%RANK) has been moved to cryo storage.", user, rank, displayed_rank)
|
||||
//END EDIT
|
||||
else if(message_type == "ARRIVALS_BROKEN")
|
||||
message = "The arrivals shuttle has been damaged. Docking for repairs..."
|
||||
|
||||
@@ -27,8 +27,12 @@ Captain
|
||||
return get_all_accesses()
|
||||
|
||||
/datum/job/captain/announce(mob/living/carbon/human/H)
|
||||
..()
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/minor_announce, "Captain [H.nameless ? "" : "[H.real_name] "]on deck!"))
|
||||
..()
|
||||
var/displayed_rank = H.client.prefs.alt_titles_preferences[title]
|
||||
if(!displayed_rank)
|
||||
displayed_rank = "Captain"
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/minor_announce, "[displayed_rank] [H.nameless ? "" : "[H.real_name] "]on deck!"))
|
||||
|
||||
|
||||
/datum/outfit/job/captain
|
||||
name = "Captain"
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
/datum/job/proc/announce_head(var/mob/living/carbon/human/H, var/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)
|
||||
//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, H.job, 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.job, H.client.prefs.alt_titles_preferences[H.job], channels), 1))
|
||||
|
||||
//If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1
|
||||
/datum/job/proc/player_old_enough(client/C)
|
||||
|
||||
@@ -277,6 +277,7 @@
|
||||
// Delete them from datacore.
|
||||
|
||||
var/announce_rank = null
|
||||
var/announce_job_title = null
|
||||
for(var/datum/data/record/R in GLOB.data_core.medical)
|
||||
if((R.fields["name"] == mob_occupant.real_name))
|
||||
qdel(R)
|
||||
@@ -286,6 +287,7 @@
|
||||
for(var/datum/data/record/G in GLOB.data_core.general)
|
||||
if((G.fields["name"] == mob_occupant.real_name))
|
||||
announce_rank = G.fields["rank"]
|
||||
announce_job_title = G.fields["job_title"]
|
||||
qdel(G)
|
||||
|
||||
for(var/obj/machinery/computer/cloning/cloner in world)
|
||||
@@ -299,7 +301,7 @@
|
||||
|
||||
if(GLOB.announcement_systems.len)
|
||||
var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems)
|
||||
announcer.announce("CRYOSTORAGE", mob_occupant.real_name, announce_rank, list())
|
||||
announcer.announce("CRYOSTORAGE", mob_occupant.real_name, announce_rank, announce_job_title, list())
|
||||
visible_message("<span class='notice'>\The [src] hums and hisses as it moves [mob_occupant.real_name] into storage.</span>")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user