Page 1 of 1

tooltip_path in LuaGuiElement.add to show vanilla tooltips

Posted: Fri Aug 11, 2017 8:08 pm
by Mooncat
Request:
A simple way to replicate vanilla tooltips, including the yellow mod names.
ItemTooltip.jpg
ItemTooltip.jpg (50.51 KiB) Viewed 1056 times
Add an additional optional parameter "tooltip_path" in LuaGuiElement.add.
An additional concept is also needed: TooltipPath.

tooltip_path :: TooltipPath (optional): Path to the object whose tooltip will be used as the tooltip of this element. It is used only if "tooltip" is not provided.

TooltipPath : It is specified by string. It is the path of the interested object whose tooltip will be displayed. It is in form "type/name". Supported types are:
  • "item" - for example "item/iron-plate" is the tooltip of iron plate item.
  • "entity" - for example "entity/small-biter" is the tooltip of small biter entity.
  • "recipe"
  • "technology"

Re: tooltip_path in LuaGuiElement.add to show vanilla tooltips

Posted: Mon Aug 21, 2017 8:33 pm
by eradicator
I very much second this request for an easy way to replicate tooltips, also importantly including recipie tooltips that properly show the resources required and available.

Additionally i'd like to extent the request to allow rendering of any arbitrary gui element inside a "tooltip_frame" in order to construct custom tooltips that can contain pictures, sprite buttons and proper custom coloring.