tooltip_path in LuaGuiElement.add to show vanilla tooltips

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

tooltip_path in LuaGuiElement.add to show vanilla tooltips

Post by Mooncat »

Request:
A simple way to replicate vanilla tooltips, including the yellow mod names.
ItemTooltip.jpg
ItemTooltip.jpg (50.51 KiB) Viewed 1055 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"

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: tooltip_path in LuaGuiElement.add to show vanilla tooltips

Post 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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding interface requests”