diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm index 8596a9af07e2b..89ef4ced24114 100644 --- a/code/modules/jobs/job_exp.dm +++ b/code/modules/jobs/job_exp.dm @@ -56,6 +56,12 @@ GLOBAL_PROTECT(exp_to_update) for(var/job in typelist["titles"]) if(job in explist) amount += explist[job] + // Removed job support + typelist = GLOB.exp_removed_jobsmap[exptype] + if(typelist) + for(var/job in typelist["titles"]) + if(job in explist) + amount += explist[job] return amount /client/proc/get_exp_living(pure_numeric = FALSE) @@ -107,6 +113,9 @@ GLOBAL_PROTECT(exp_to_update) for(var/rtype in SSjob.name_occupations) if(!play_records[rtype]) play_records[rtype] = 0 + for(var/rtype in GLOB.exp_removed_jobs) + if(!play_records[rtype]) + play_records[rtype] = 0 for(var/rtype in GLOB.exp_specialmap) if(!play_records[rtype]) play_records[rtype] = 0 diff --git a/code/modules/jobs/job_report.dm b/code/modules/jobs/job_report.dm index 49f50f72c64de..4a404e3a8a7f4 100644 --- a/code/modules/jobs/job_report.dm +++ b/code/modules/jobs/job_report.dm @@ -29,12 +29,17 @@ var/list/data = list() data["jobPlaytimes"] = list() + data["jobRemovedPlaytimes"] = list() data["specialPlaytimes"] = list() for (var/job_name in SSjob.name_occupations) var/playtime = play_records[job_name] ? text2num(play_records[job_name]) : 0 data["jobPlaytimes"][job_name] = playtime + for (var/job_name in GLOB.exp_removed_jobs) + var/playtime = play_records[job_name] ? text2num(play_records[job_name]) : 0 + data["jobRemovedPlaytimes"][job_name] = playtime + for (var/special_name in GLOB.exp_specialmap[EXP_TYPE_SPECIAL]) var/playtime = play_records[special_name] ? text2num(play_records[special_name]) : 0 data["specialPlaytimes"][special_name] = playtime diff --git a/code/modules/jobs/jobs.dm b/code/modules/jobs/jobs.dm index 08d8da75aa13a..0c3764e702b3d 100644 --- a/code/modules/jobs/jobs.dm +++ b/code/modules/jobs/jobs.dm @@ -228,7 +228,18 @@ GLOBAL_LIST_INIT(security_positions_hud, list( JOB_HUD_DEPUTY, JOB_HUD_RAWSECURITY)) +/// Put any removed jobs here so they can still show in playtime listings. +GLOBAL_LIST_INIT(exp_removed_jobs, list( +// "Virologist", +)) +GLOBAL_PROTECT(exp_removed_jobs) +/// Put any removed jobs here so they can still show in playtime listings. +GLOBAL_LIST_INIT(exp_removed_jobsmap, list( +// EXP_TYPE_CREW = list("titles" = list("Virologist")), +// EXP_TYPE_MEDICAL = list("titles" = list("Virologist")), +)) +GLOBAL_PROTECT(exp_removed_jobsmap) GLOBAL_LIST_INIT(exp_jobsmap, list( EXP_TYPE_CREW = list("titles" = command_positions | engineering_positions | medical_positions | science_positions | supply_positions | security_positions | civilian_positions | gimmick_positions | list(JOB_NAME_AI,JOB_NAME_CYBORG)), // crew positions diff --git a/tgui/packages/tgui/interfaces/TrackedPlaytime.js b/tgui/packages/tgui/interfaces/TrackedPlaytime.js index 5e8e2f44c043b..dca0712b59df2 100644 --- a/tgui/packages/tgui/interfaces/TrackedPlaytime.js +++ b/tgui/packages/tgui/interfaces/TrackedPlaytime.js @@ -9,7 +9,7 @@ const JOB_REPORT_MENU_FAIL_REASON_NO_RECORDS = 2; const sortByPlaytime = sortBy(([_, playtime]) => -playtime); const PlaytimeSection = (props) => { - const { playtimes } = props; + const { playtimes, removedJobs } = props; const sortedPlaytimes = sortByPlaytime(Object.entries(playtimes)); const mostPlayed = sortedPlaytimes[0][1]; return ( @@ -24,7 +24,7 @@ const PlaytimeSection = (props) => { style={{ 'vertical-align': 'middle', }}> - {jobName} + {jobName + (removedJobs?.includes(jobName) ? ' (Removed)' : '')} @@ -49,7 +49,7 @@ const PlaytimeSection = (props) => { export const TrackedPlaytime = (props, context) => { const { data } = useBackend(context); - const { failReason, jobPlaytimes, specialPlaytimes, livingTime, ghostTime } = data; + const { failReason, jobPlaytimes = {}, jobRemovedPlaytimes = {}, specialPlaytimes, livingTime, ghostTime } = data; return ( @@ -66,7 +66,10 @@ export const TrackedPlaytime = (props, context) => { />
- +