Module:Currency/doc
This is the documentation page for Module:Currency
Module documentation (view)
Usage
This Lua module outputs the currency and its price for the {{Currency}} template to account for preprocessor node count limits. Data is stored in a table, and can determine how certain variables are used.
Portions of the module uses Module:Formatnum, see module for more information.
Inserting a new currency
["name_of_currency"] = { "currency_image", "currency_image_size", "link_to_currency", "name_of_currency", "short_name_of_currency" }
When adding a new currency to be used on pages, the following syntax must be inserted into the main data table.
name_of_currencydescribes the name of the currency that the editor will write in the Currency template. There is also a second instance ofname_of_source, which can also feature a different text to its first instance.currency_imagerequires an image (preferably an icon) to be added. It must include the filename extension.currency_image_sizedescribes the default size thatcurrency_imagewill be presented in.link_to_currencydescribes the link that the player will click on (provided that the link is present).short_name_of_currencydescribes a shorter name of the currency when applying theshortparameter on the main Currency template.
Example
["Bells"] = { "99k Bells NH Inv Icon cropped.png", "15px", "Bell", "Bell", "Bell" }
"Bells" is the name_of_currency, while "Bell" functions as the second instance of name_of_source, link_to_currency, and short_name_of_currency. Its currency_image is "99k Bells NH Inv Icon cropped.png", and the currency_image_size is set to "15px".
The output is: File:99k Bells NH Inv Icon cropped.png Bells
["Nook Miles"] = { "Nook Miles NH Icon Cropped.png", "18px", "Nook Miles", "Nook Mile", "Mile" }
"Nook Mile" is the name_of_currency and link_to_currency, while "Nook Mile" functions as the second instance of name_of_source. Its short_name_of_currency is "Mile". Its currency_image is "Nook Miles NH Icon Cropped.png", and the currency_image_size is set to "18px".
The output is: File:Nook Miles NH Icon Cropped.png Nook Miles
When short is applied, the output is: File:Nook Miles NH Icon Cropped.png Miles