Ninjune / coleweight

https://www.chattriggers.com/modules/v/Coleweight
MIT License
17 stars 8 forks source link

Fix NaN % in Powdersum in HOTM Menu if API request fails #3

Closed CrazyTech4 closed 1 year ago

CrazyTech4 commented 1 year ago

If the API request to get the powder amount of the player fails this extracts the powder totals from the HOTM Info & Reset buttons by hovering over them. There are two ways in which it is a bit scuffed: 1) If the player hovers over the perks before hovering over the Info & Reset button it can show NaN (if no button was checked before) or the wrong % if only 1 button was checked. This can be fixed by the player by hovering the not checked buttons and reopening the HOTM menu. This is because the code to set the % runs once per opening the HOTM menu 2) If the player opens the HOTM Menu before the API request completes the same NaN or wrong % from 1) can occur since then the buttons get checked for powder. This has the same fix of re-opening the HOTM Menu