Earendel's Informatron mod uses custom GUI elements to display text information, however more than a single line of text will result in a tooltip that repeats the text. With large sections, the tooltip blocks half the screen.
The mod adds custom GUI elements by a variation of:
Code: Select all
if page_name == "name" then
element.add{type="label", name="text_1", caption={"mod_name.text_1"}}
end
The Factorio Runtime API docs list 'tooltip' as a member of the GuiElement class, and describes it as:
I modified the code that adds the custom GUI elements two different ways, adding parts to disable the tooltip using the empty string.tooltip :: LocalisedString Read/Write
The text to display when hovering over this element. Writing "" will disable the tooltip, while writing nil will set it to "nil".
Code: Select all
if page_name == "name" then
element.add{type="label", name="text_1", caption={"mod_name.text_1"}, tooltip=""}
end
Code: Select all
if page_name == "name" then
element.add{type="label", name="text_1", caption={"mod_name.text_1"}}
element.text_1.tooltip=""
end
Adding text to the tooltip string like:
Code: Select all
if page_name == "name" then
element.add{type="label", name="text_1", caption={"mod_name.text_1"}, tooltip="Some text here"}
end
Code: Select all
if page_name == "name" then
element.add{type="label", name="text_1", caption={"mod_name.text_1"}}
element.text_1.tooltip="Some text here"
end
I wrote a basic mod called InformatronBugTest to test the tooltip, found here. The relevant code is found in scripts\interface.lua and contains some further examples commented out. Included in this post is a savegame with only my test mod and the Informatron mod installed. The Informatron can be opened with the I key or by clicking the icon in the top left of the screen.
My conclusion is that either this is a bug in the tooltip LuaGuiElement or a mistake in the API docs.