diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index ba9d701b03a..7f08afd0704 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1370,3 +1370,26 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects) copy.underlays = underlays_to_keep return copy + +/// Returns the (isolated) security HUD icon for the given job. +/proc/get_job_hud_icon(datum/job/job) as /icon + var/static/alist/icon_cache = alist() + if(isnull(job)) + return + + if(!is_job(job)) + if(ispath(job, /datum/job)) + job = SSjob.get_job_type(job) + else if(istext(job)) + job = SSjob.get_job(job) + if(isnull(job)) + return null + + //add it to the cache if it isn't already + var/job_type = job.type + if(!icon_cache[job_type]) + var/icon/sechud_icon = job.get_lobby_icon() + sechud_icon.Crop(1, 17, 8, 24) + icon_cache[job_type] = sechud_icon + + return icon(icon_cache[job_type]) diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index 643a6c167bd..e363240b72e 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -688,30 +688,58 @@ ///Boolean on whether or not we should have our static overlay, so we 'turn' the TV off when collapsing. var/show_static = TRUE + ///Static mutable appearance of a job icon we're displaying on the TV for overflow job. + var/static/mutable_appearance/job_overlay /atom/movable/screen/lobby/new_player_info/Initialize(mapload, datum/hud/hud_owner) . = ..() START_PROCESSING(SSnewplayer_info, src) update_text() + + //only go if the station trait is selected, otherwise it'll show "Assistant" every round. + var/datum/station_trait/overflow_job_bureaucracy/overflow_job = locate() in SSstation.station_traits + if(overflow_job && isnull(job_overlay)) + var/icon/job_icon = get_job_hud_icon(SSjob.overflow_role) + if(isnull(job_icon)) + stack_trace("[SSjob.overflow_role::title] was selected as the Job Overflow but has no icon!") + else + job_icon.Scale(ICON_SIZE_X / 2, ICON_SIZE_X / 2) + job_overlay = mutable_appearance(job_icon, offset_spokesman = src, alpha = 120, layer = src.layer+0.02) + var/matrix/job_matrix = matrix() + job_matrix.Translate(6, 14) //this is completely arbitruary just what I thought looked good. + job_overlay.transform = job_matrix + update_appearance(UPDATE_ICON) /atom/movable/screen/lobby/new_player_info/Destroy() STOP_PROCESSING(SSnewplayer_info, src) return ..() +/atom/movable/screen/lobby/new_player_info/MouseEntered(location, control, params) + . = ..() + if(QDELETED(src) || isnull(job_overlay)) + return + openToolTip(usr, src, params, title = "[SSjob.overflow_role::title] overflow", content = "The overflow for the round has been set as [SSjob.overflow_role::title].") + +/atom/movable/screen/lobby/new_player_info/MouseExited() + closeToolTip(usr) + return ..() + /atom/movable/screen/lobby/new_player_info/update_icon_state() . = ..() icon_state = base_icon_state /atom/movable/screen/lobby/new_player_info/update_overlays() . = ..() - . += mutable_appearance(icon, "[base_icon_state]_overlay", layer = src.layer+0.03) + . += mutable_appearance(icon, "[base_icon_state]_overlay", layer = src.layer+0.01) if(!show_static) return . - . += mutable_appearance(icon, "static_base", alpha = 20, layer = src.layer+0.01) + if(job_overlay) + . += job_overlay + . += mutable_appearance(icon, "static_base", alpha = 20, layer = src.layer+0.03) //we have this in a separate file because `generate_icon_alpha_mask` puts lighting even on non-existent pixels, //giving the icon a weird background color. - var/mutable_appearance/scanline = mutable_appearance(generate_icon_alpha_mask('icons/hud/lobby/newplayer_scanline.dmi', "scanline"), alpha = 20, layer = src.layer+0.02) + var/mutable_appearance/scanline = mutable_appearance(generate_icon_alpha_mask('icons/hud/lobby/newplayer_scanline.dmi', "scanline"), alpha = 20, layer = src.layer+0.04) scanline.pixel_y = OVERLAY_X_DIFF scanline.pixel_x = OVERLAY_Y_DIFF . += scanline @@ -751,9 +779,6 @@ new_maptext = "[SSmapping.current_map.map_name]
\ [LAZYLEN(GLOB.clients)] player\s online
\ [ROUND_TIME()] in
" - var/datum/station_trait/overflow_job_bureaucracy/overflow = locate() in SSstation.station_traits - if(overflow) - new_maptext += "[overflow.chosen_job_name] overflow" new_maptext += "
" else var/time_remaining = SSticker.GetTimeLeft() diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index ed286ea66d0..6cb6dd8f760 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -31,7 +31,7 @@ SUBSYSTEM_DEF(job) var/list/prioritized_jobs = list() var/list/latejoin_trackers = list() - var/overflow_role = /datum/job/assistant + var/datum/job/overflow_role = /datum/job/assistant var/list/level_order = list(JP_HIGH, JP_MEDIUM, JP_LOW) diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index 1dc0d8cef0c..a7e22b570d1 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -647,3 +647,15 @@ /// This proc may be called when someone of this job is made into a traitor to create custom objectives related to the job. /datum/job/proc/generate_traitor_objective() return null + +/// Returns a large (due to cropping) icon of this job's sechud icon state. +/datum/job/proc/get_lobby_icon() as /icon + var/datum/outfit/job_outfit = outfit + if(!job_outfit || !job_outfit::id_trim) + CRASH("[src.type] has no job outfit but isn't overwriting get_lobby_icon().") + var/datum/id_trim/job_trim = job_outfit::id_trim + var/icon_state = job_trim::sechud_icon_state + if(!icon_state || icon_state == SECHUD_UNKNOWN) + CRASH("[src.type] has no job icon state.") + + return icon('icons/mob/huds/hud.dmi', icon_state) diff --git a/code/modules/jobs/job_types/ai.dm b/code/modules/jobs/job_types/ai.dm index bd582705507..0a35b5f53ac 100644 --- a/code/modules/jobs/job_types/ai.dm +++ b/code/modules/jobs/job_types/ai.dm @@ -89,3 +89,6 @@ /datum/job/ai/on_respawn(mob/new_character) new_character.AIize() + +/datum/job/ai/get_lobby_icon() + return icon('icons/mob/huds/hud.dmi', "hudai") diff --git a/code/modules/jobs/job_types/cyborg.dm b/code/modules/jobs/job_types/cyborg.dm index 7a70f52ab25..059f12a3f3d 100644 --- a/code/modules/jobs/job_types/cyborg.dm +++ b/code/modules/jobs/job_types/cyborg.dm @@ -38,3 +38,6 @@ /datum/job/cyborg/on_respawn(mob/new_character) new_character.Robotize(TRUE) + +/datum/job/cyborg/get_lobby_icon() + return icon('icons/mob/huds/hud.dmi', "hudcyborg") diff --git a/icons/mob/huds/hud.dmi b/icons/mob/huds/hud.dmi index 53dd33a4544..3927f3f0144 100644 Binary files a/icons/mob/huds/hud.dmi and b/icons/mob/huds/hud.dmi differ