HUD tweaks and fixes (#19492)

Fixed paramedics not having the FR HUD icon anymore on the Security HUD.
Moved all the HUD icon files in the hud folder.
Changed the in_view() proc used for HUDs to use the more performant
get_hearers_in_LOS() / get_hearers_in_range() over view() and a list
traversal with range comparisons.
HUD now respects the client view size instead of just using the world
view size.
This commit is contained in:
Fluffy
2024-06-23 12:07:31 +00:00
committed by GitHub
parent 7bdf48994f
commit 069a5e9d51
11 changed files with 106 additions and 40 deletions
+12 -6
View File
@@ -97,14 +97,20 @@ the HUD updates properly! */
GLOB.sec_hud_users -= src
/mob/proc/in_view(var/turf/T)
return view(T)
RETURN_TYPE(/list)
return get_hearers_in_LOS(client?.view, T)
/mob/abstract/eye/in_view(var/turf/T)
var/list/viewed = new
for(var/mob/living/carbon/human/H in GLOB.mob_list)
if(get_dist(H, T) <= 7)
viewed += H
return viewed
RETURN_TYPE(/list)
// This was like this before, honestly i don't see the point of doing it this way hence the change, but I left the code for reference in case shit hits the fan
// var/list/viewed = new
// for(var/mob/living/carbon/human/H in GLOB.mob_list)
// if(get_dist(H, T) <= client?.view)
// viewed += H
// return viewed
return get_hearers_in_range(client?.view, T)
/proc/get_sec_hud_icon(var/mob/living/carbon/human/H)//This function is called from human/life,dm, ~line 1663
var/state