Fixes an 8 year old bug which colored your HUDs with you (#88667)

## About The Pull Request

Partially a port of
https://github.com/DaedalusDock/daedalusdock/pull/1163 which is a port
of my own code from bitbus
Closes #88579

Instead of manually setting hud images and positioning we now can use
set_hud_image_state which also updates their position to ensure that
they scale with the owner atom. HUDs had RESET_COLOR and RESET_TRANSFORM
but no KEEP_APART, so they were stuck with mobs all this time. I
replaced RESET_TRANSFORM with PIXEL_SCALE (shouldn't be reserved to mob
huds only to be honest) and added KEEP_APART, so that HUDs still
scale/rotate with their owner but don't inherit their color. Also fixed
the dragon issue, that's where this PR actually started.

Closes https://github.com/tgstation/tgstation/issues/45411

## Why It's Good For The Game

I don't want my HUDs to be pretty pink when I make a barbie Clarke.

## Changelog
🆑
refactor: Rewrote some of HUD code so they're no longer colored in their
owner's color
fix: Space dragons no longer turn invisible when toggling seethrough
mode
/🆑
This commit is contained in:
SmArtKar
2024-12-26 15:06:04 +01:00
committed by GitHub
parent e8d0611341
commit 8d48f8d4d2
21 changed files with 228 additions and 250 deletions
+9 -10
View File
@@ -219,19 +219,18 @@
listener.RegisterSignal(src, COMSIG_LIVING_REVIVE, TYPE_PROC_REF(/datum/alarm_listener, allow_alarm_changes))
/mob/living/basic/drone/med_hud_set_health()
var/image/holder = hud_list[DIAG_HUD]
holder.pixel_y = get_cached_height() - ICON_SIZE_Y
holder.icon_state = "huddiag[RoundDiagBar(health/maxHealth)]"
set_hud_image_state(DIAG_HUD, "huddiag[RoundDiagBar(health/maxHealth)]")
/mob/living/basic/drone/med_hud_set_status()
var/image/holder = hud_list[DIAG_STAT_HUD]
holder.pixel_y = get_cached_height() - ICON_SIZE_Y
if(stat == DEAD)
holder.icon_state = "huddead2"
else if(incapacitated)
holder.icon_state = "hudoffline"
else
holder.icon_state = "hudstat"
set_hud_image_state(DIAG_STAT_HUD, "huddead2")
return
if(incapacitated)
set_hud_image_state(DIAG_STAT_HUD, "hudoffline")
return
set_hud_image_state(DIAG_STAT_HUD, "hudstat")
/mob/living/basic/drone/Destroy()
GLOB.drones_list -= src