Stat normalization mod
Hi there,
I want to write a mod, that normalizes stats for display, as I hate the big numbers of ESO. Basically, I want to modify any label displaying a stamina/health/magicka value to show something like: Quote:
Are there any methods like GetCurrent/Max([attributeType]) or GetCost([attributeType]), or would I need to modify every tooltip manually? |
You'd have to check the eso source code how the tooltips are build:
https://github.com/esoui/esoui/tree/master/esoui Most probably there are API functions used, which are defined in the API txt documentation files then: https://wiki.esoui.com/APIVersion#live_API_version -> Search for GetUnitPower |
|
I've tried overwriting zo_strformat, as it's called for all relevant strings I want to modify. But it seems like the tooltips get build before the mod even loads. I could only intercept strings for map tooltips, not ability tooltips.
Is there even a clean solution to modify the tooltips then? Or do I need to inject the code, when the tooltip opens? |
Code:
I've tried overwriting zo_strformat, Some parts of the tooltips use a constant like SI_QUALITY_TEXT etc. Tooltip text is build before the tooltip opens and just replaced in the tooltip into the palceholder SI_whatever as far as I know. Chekc other addons code like Alchemy Tooltips. Could be that the stats are not handled the sme way and cannot be altered! But there was an addon "CritPercent" or similar which altered the text to show the crit percentage instead of values I think, so it might be possible. |
Quote:
Only problem as said: Even though the tooltip calls the zo_strformat method, it does so before I can inject my overwrite, which makes the overwrite basically useless. Quote:
But thanks for the tip with other Mods, I will have a look at those. :) I really had trouble finding anything up-to-date so far, which is why I just stopped looking, but that might have been a bit prematurely. |
Quote:
By overwriting and running your own code before the original function, you are slowing it down compared to just leaving it alone. Most of the time not something you'd notice, but maybe some other code calls it a bazillion times in a loop and now it's twice as slow and suddenly people notice freezes with the combination of your addon and another one. Not something that most authors can easily debug. Another huge difference is that any function touched (as in replaced) by an addon is marked as unsafe. When the game calls that function from a secure context, you suddenly get an error. Something like zo_strformat is called from literally anywhere in the game, so it's likely to fail in some situations. Really huge pain in the ass to find out why it suddenly does that, since the error can't tell you which addon is at fault. Can't tell you how many hours I wasted hunting down such bugs. And depending on how your replacement operates, it may break in the future in case ZOS changes the signature of the function. Wouldn't be the first time that happens due to some addon naively overwriting some function. So please don't say it wouldn't be a problem. You always gotta be careful when you change shared resources. ;) |
All times are GMT -6. The time now is 11:47 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI