From 16b780cdbcaae9742dcaabf5e9632c508672b31a Mon Sep 17 00:00:00 2001 From: Markolie Date: Mon, 24 Nov 2014 02:03:42 +0100 Subject: [PATCH] Make sure alt titles have HUD icons --- code/game/jobs/access.dm | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 7d9f591c0d9..cb40a1557c3 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -534,20 +534,28 @@ proc/get_all_job_icons() //For all existing HUD icons return joblist + list("Prisoner") /obj/proc/GetJobName() //Used in secHUD icon generation - if (!istype(src, /obj/item/device/pda) && !istype(src,/obj/item/weapon/card/id)) + var/obj/item/weapon/card/id/I + if(istype(src, /obj/item/device/pda)) + var/obj/item/device/pda/P = src + I = P.id + else if(istype(src, /obj/item/weapon/card/id)) + I = src + + if(I) + var/job_icons = get_all_job_icons() + var/centcom = get_all_centcom_jobs() + + if(I.assignment in job_icons) //Check if the job has a hud icon + return I.assignment + if(I.rank in job_icons) + return I.rank + + if(I.assignment in centcom) //Return with the NT logo if it is a Centcom job + return "Centcom" + if(I.rank in centcom) + return "Centcom" + else return - var/jobName - - if(istype(src, /obj/item/device/pda)) - if(src:id) - jobName = src:id:assignment - if(istype(src, /obj/item/weapon/card/id)) - jobName = src:assignment - - 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 - return "Centcom" return "Unknown" //Return unknown if none of the above apply