Closed raff-run closed 2 years ago
Neato. Was wondering if someone would bother to do something like this.
I think you should make a PR to implement this.
Though you shouldn't need the cache thing since they should basically be cached in the option data itself already.
Should just need to look around the ModMenuApi.lua line 140:
displayMessage = toolTip;
and send the tooltip through the function and assign to the display message and bingo
If you really don't wanna bother though, I can implement it.
Sure! I'll give it a try.
Hey! When I was implementing my mod options with your API, I noticed that the text will resize and become unreadable if too lengthy. This means that it needs carefully applied newlines, and also that the newlines need to be at different places if you're also using the usual REF UI since they have different default window sizes.
So I made a lua util function that automatically finds the best way to fit a text in a tooltip and caches the result, and wanted to share it with you if you in case want to incorporate it into the mod's API:
Here are some example outputs:
Of course, if the string is long enough, it will overflow downwards, but I think that's better than seeing this and then having to place line breaks yourself: