Module:Infobox/doc: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "Lua methods used for the infobox template == Functions == === item_parsing === Takes one argument in the form of a string. The string is expected to have the following format: <pre>Iron plate, 2 + Iron ore, 45 + Electronic circuit, 5</pre> This string is split so that each entry between a <code>+</code> is forwarded to Template:Icon/special so that it displays the item and has the number as the caption. <noinclude>Category:Template documentation</noinclude>")
 
(Added technology_parsing)
 
Line 1: Line 1:
Lua methods used for the infobox template
Lua methods used by [[Template:Infobox]].


== Functions ==
== Functions ==
=== technology_parsing ===
Takes one argument in the form of a string and one named argument, "color". The string is expected to have the following format:
<pre>Military 4 + Advanced oil processing + Advanced electronics 2, 2</pre>
This string is split so that each entry between a <code>+</code> is forwarded to [[Template:Icon/special]] so that it displays the technology and has the level as the caption.
Before forwarding the arguments to the icon template, " (research)" is appended to the technology if a page with that name exists. Furthermore, the technology level is deduced from the technology name if it is not manually specified.
The color defaults to "999".


=== item_parsing ===
=== item_parsing ===

Latest revision as of 18:47, 1 October 2024

Lua methods used by Template:Infobox.

Functions

technology_parsing

Takes one argument in the form of a string and one named argument, "color". The string is expected to have the following format:

Military 4 + Advanced oil processing + Advanced electronics 2, 2

This string is split so that each entry between a + is forwarded to Template:Icon/special so that it displays the technology and has the level as the caption.

Before forwarding the arguments to the icon template, " (research)" is appended to the technology if a page with that name exists. Furthermore, the technology level is deduced from the technology name if it is not manually specified.

The color defaults to "999".

item_parsing

Takes one argument in the form of a string. The string is expected to have the following format:

Iron plate, 2 + Iron ore, 45 + Electronic circuit, 5

This string is split so that each entry between a + is forwarded to Template:Icon/special so that it displays the item and has the number as the caption.