rbjaxter / budhud

A Team Fortress 2 hud inspired by whayay's yahud and rays' rayshud.
MIT License
186 stars 89 forks source link

Clipping issues with `HudPlayerHealth.res` files #521

Closed PeanutKarver closed 1 month ago

PeanutKarver commented 1 month ago

There are 2 issues and 1 suggestion in this post. They're all related to each other.

(1. ISSUE) Status effects shift to the left and space out from each other as the player's resolution gets lower. This problems persists in the Default HUD and all the other custom HUDS I've checked. As far as I know, the only possible way to defer, not prevent, this effect is to decrease the wide value for all the status effects, which seem to only be handled in the hudplayerhealth.res in _tf2hud/resource/ui right now. I don't expect a fix for this, I just wanted to get your opinion on this.

Every image has addcond 58; addcond 59; addcond 60; addcond 48; addcond 30; addcond 93 enabled for a total of 6 status effects.

1600x900: 20240729025549_1

1280x720: 20240729025614_1

800x600: 20240729025703_1

640x480: 20240729025728_1

(2. SUGGESTION) Currently, almost every HudPlayerHealth.res file listed in resource/ui/hudplayerhealth.res shows up to a maximum of 3 status effects. That's the same behavior as the default HUD, but it's possible to increase that number up to what a player's monitor can handle instead. This can somewhat help with the issue above.

To add it, you'd have to modify the HudPlayerHealth element's wide to a bigger number for more space, decrease its xpos by a certain amount, then increase the xpos of any enabled, unpinned, normally positioned hudplayerhealth.res elements by the number you subtracted from the HudPlayerHealth element (PlayerStatusHealthImage, bh_PlayerStatusPin, PlayerStatusHealthValue, PlayerStatus_WheelOfDoom, etc.). This should get the exact positioning before with the new benefit of fitting more status effects on screen. For elements that use cs for their xpos (bh_HealthBG), you will need to trial-and-error it's new position.

Example (Compare to First Image) (Only PlayerStatusHealthValue is slightly offset): 20240729154131_1

The thing is though, if you want to do this, you'll need to do that for every existing HudPlayerHealth.res file aside from the one in _tf2hud/resource/ui, so long as it has any enabled, normally positioned elements. It may help to try creating a pin so that every HudPlayerHealth.res element can be moved together without touching their individual xposs, but that's a task in itself. I also worry that creating a pin like that would break the alignments between PlayerStatusHealthImage, PlayerStatusHealthImageBG, and PlayerStatusHealthImage that some files use.

(3. ISSUE) If you don't want to commit to a change like that, at the very least, bh_player_healthcross.res and bh_player_m0re_healthcross.res need to be fixed to show 3 status effects instead of the 1.5 status effects they show currently. The solution is the same as detailed in the suggestion above.

1600x900 resolution. I assume this issue persists even on higher resolutions.

bh_player_healthcross.res: 20240729030741_1

bh_player_m0re_healthcross.res (If bh_player_m0re_healthcross.res is an import, then I guess it's fine to keep it as is): 20240729031023_1