Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix health bar renderer #97

Merged
merged 9 commits into from
Sep 24, 2023
Merged

Fix health bar renderer #97

merged 9 commits into from
Sep 24, 2023

Conversation

Alexdoru
Copy link
Member

Tinkers constructs completely overwrites the health bar rendering and there were multiple bugs with it. Notably it was drawing all of the hearts that your character has on top of each other even though you can only see the 10 hearts at the very top, costing performance for nothing.

In this pr I :

  • add some code that has been forgotten when copying and overriding the vanilla renderHealth method
  • create dedicated class HealthBarRenderer extending Gui to stop copy-pasting certain vanilla methods
  • fix renegeration hearts moving when the game is paused
  • only bind tinkers hearts textures if it's actually going to draw tinkers' hearts (helth above 20)
  • stop drawing vanilla hearts when they are hidden by tinkers' heart being drawn on top
  • fix tinker's half heart not moving with regeneration
  • fix drawing all tinkers' hearts on top of each others, and now only draw the top most hearts

@Dream-Master
Copy link
Member

Dream-Master commented Sep 14, 2023

@Alexdoru are you know that we have overloaded bar as a mod which seems to override stuff as well ?

@Alexdoru
Copy link
Member Author

I did not know, where is that ?

@Dream-Master
Copy link
Member

@Alexdoru nevermind it was the Armor bar not the health bar. https://github.com/GTNewHorizons/OverloadedArmorBar

@Dream-Master Dream-Master requested review from a team September 14, 2023 17:11
Copy link

@mitchej123 mitchej123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine as long as it's tested in game

@Dream-Master Dream-Master merged commit 098783f into master Sep 24, 2023
@Dream-Master Dream-Master deleted the fix_health_render branch September 24, 2023 17:31
DrParadox7 pushed a commit to DrParadox7/TinkersConstruct that referenced this pull request May 10, 2024
* delete unused locals

* add some code that has been forgotten when copying and overriding the vanilla renderHealth method

* create dedicated class HealthBarRenderer extending Gui to stop copy-pasting certain vanilla methods

* fix renegeration hearts moving when the game is paused

* only bind tinkers hearts textures if it's actually going to draw tinkers' hearts

* stop drawing vanilla hearts when they are hidden by tinkers' heart being drawn on top

* fix tinker's half heart not moving with regeneration

* fix drawing all tinkers' hearts on top of each others, and now only draw the top most hearts

* add comment to help with debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants