GoldpawsStuff / AzeriteUI5

Custom user interface suite for World of Warcraft. Design and code by Lars Norberg and Daniel Troconis.
https://www.patreon.com/GoldpawsStuff
Other
22 stars 7 forks source link

Components: Add addon memory usage tooltip to framerate widget #92

Closed PatTheMav closed 1 month ago

PatTheMav commented 2 months ago

The default Blizzard interface displays framerate, latency, and addon memory usage in the tooltip for the main menu button in the MicroMenu.

AzeriteUI displays framerate and latency in its info widget, but has no equivalent display for addon memory usage.

This change adds a tooltip to the fps widget with that information, using similar code to Blizzard's own tooltip code.

[!NOTE] One interesting detail of this implementation is that this code generates garbage memory on every tooltip update as at the very least the line with AzeriteUI's own memory usage will be updated, which in turn increases its memory usage, which will require an update of the tooltip.

Thus when displaying the tooltip, AzeriteUI's own memory usage will constantly increase (but also cleaned up by garbage collection), something that Blizzard's own code does not run into when showing this tooltip.