kamejosh / owlbear-hp-tracker

HP Tracker Extension for Owlbear
MIT License
8 stars 6 forks source link

temporary HP bar not showing correctly when max HP is lower than temporary HP #42

Open dmraydm opened 9 months ago

dmraydm commented 9 months ago

Same as what the title says, temporary HP bar not showing correctly when max HP is lower than temporary HP. The HP bar turns completely blue and keeps extending to the right outside of the box width it normally stays within. Screenshot_20240210_195057

kamejosh commented 9 months ago

Yes, this behaviour is by design. Because all healthbars get their length as a percentage of the max HP. So the temp HP are 3 times the max HP which means they get a length of 300% of the hp bar.

The alternative would be to have it at max 100% but then people would complain that it shows too little because it should actually be longer.

Do you have a better idea to solve this problem?

dmraydm commented 9 months ago

I appreciate the response, I understand what you mean and that makes sense. I think you're right, the way this is currently programmed may be the best solution with this situation because it may be unlikely that many people will run in to this issue at all.

I've dabbled in programming in the past but I am no expert- the first idea that comes to mind for a solution here could be to keep the bar the same width it normally is, and invert the colors. So in my example above, the HP bar would be 1/4 red and 3/4 blue (1/4 of the shown current total HP of 12 is equal to max HP of 3 and 3/4 of current total HP is equal to current temp HP of 9)

To put it another way, instead of extending the blue bar further to the right, the blue bar would instead push the red bar smaller as the temp HP goes up, keeping both bars still confined in that width while still visually representing what % of each bar makes up the total combined current HP of both max and temp.

I apologize if this is explained poorly or if I am missing anything obvious, I appreciate your work and this extension is awesome, so I completely understand if this particular issue isn't a priority. I enjoy thinking it through at least!

kamejosh commented 9 months ago

@dmraydm so it would basically mean that maxHP = tempHP + HP + HP lost? This could work, I will test how it feels and how complicated it is. I can't guarante that I will do it this way, but it sounds like a good alternative.

I'll keep the issue open until I've tested it 👍