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
+2 -2
View File
@@ -241,7 +241,7 @@
/// Lack of angle means that we are trying to halt movement
if (isnull(target_angle))
// Going through newtonian_move ensures that all Process_Spacemove code runs properly, instead of directly adjusting forces
parent.newtonian_move(reverse_angle(drifting_loop.angle), drift_force = min(drift_force, stabilization_force))
parent.newtonian_move(REVERSE_ANGLE(drifting_loop.angle), drift_force = min(drift_force, stabilization_force))
return
// Force required to be applied in order to get to the desired movement vector, with projection of current movement onto desired vector to ensure that we only compensate for excess
@@ -264,4 +264,4 @@
var/projected_force = max(0, cos(target_angle - drifting_loop.angle)) * drift_force
if (projected_force > 0)
parent.newtonian_move(reverse_angle(target_angle), projected_force)
parent.newtonian_move(REVERSE_ANGLE(target_angle), projected_force)