Bolt-Scripts / MHR-InGame-ModMenu-API

A user-friendly IMGUI inspired API for drawing in-game settings menus for REF mods in MHRise
13 stars 4 forks source link

Adding optional text wrapping support #8

Closed raff-run closed 2 years ago

raff-run commented 2 years ago

Text wrapping will occur if the string is bigger than the maximum length (basically, before the text starts resizing too much) and only if the input string has no newlines. If it has, we'll assume the mod author wants to format it themselves, and leave it as is.

So this change won't affect anyone already using newlines in their tooltips, but will allow them to opt in.

Implements #7.

raff-run commented 2 years ago

Some screenshots (I made sure to remove the function from my own mod and also refreshed scripts before taking them): These will be kind of the same since it's almost the same code. image image image image

Not changing because it has newlines: image

Not changing one option in the array passed to modUI.Options because of newlines: image

Not placing newlines because it's not big enough: image

No errors thrown even though some items don't even have tooltips: image

Bolt-Scripts commented 2 years ago

should be good to go if youre good with it

raff-run commented 2 years ago

Sure! Just took a last look and found nothing else I want to change.

Bolt-Scripts commented 2 years ago

Cool, I think I will go ahead and remove this separate "needsUpdate" check and just mark the whole mod with mod.regenOptions instead to centralize how changes are updated, should remove oversights like forgetting to update displayMessage.