Page 1 of 1

Expose rendering of specialized tooltips

Posted: Thu Mar 14, 2019 7:10 am
by Therax
Proposed behavior:

If a LuaGuiElement's tooltip consists only of a rich tag string, i.e. "[entity=assembling-machine-1]", "[item=iron-plate]", display the tooltip as used when hovering over such a tag string in chat.

Current behavior:

Setting these special strings shows only the icon of the entity, item, or recipe, as if the tooltip were "[img = item/iron-plate]", etc.

Motivation:

Item and recipe browsing mods such as FNEI would strongly benefit from having a consistent tooltip experience with vanilla GUI elements.

Re: Expose rendering of specialized tooltips

Posted: Thu Mar 14, 2019 9:17 am
by Therenas
Yes I always wanted this too, but for now you can fake it by building the tooltips yourself I guess (Example). But that is not as nice and not consistent with the base game tooltip, so there should be a way to get the normal tooltip.

Re: Expose rendering of specialized tooltips

Posted: Thu Mar 14, 2019 10:44 am
by vibes81
+1 I've been looking for a way to do this for my mod (https://mods.factorio.com/mod/qsMenu) it just doesn't feel right without that little tooltip on rollover

Re: Expose rendering of specialized tooltips

Posted: Fri Mar 15, 2019 6:49 pm
by Rseding91
You just want to use the elem-button type and it will have the correct tooltip automatically.

Re: Expose rendering of specialized tooltips

Posted: Fri Mar 15, 2019 9:46 pm
by Therenas
Rseding91 wrote: Fri Mar 15, 2019 6:49 pm You just want to use the elem-button type and it will have the correct tooltip automatically.
Oh yeah I guess that is a solution.