Module:Utilities/doc: Difference between revisions

Sur (talk | contribs)
m moving examples to SlotColor
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Overview=
==Overview==
Utility functions that serve any miscellaneous purpose
Utility functions that serve any miscellaneous purpose


=Functions=
==Functions==


==get_slot_color==
==get_slot_color==
Retrieve's the color of a certain slot/category in any color format (default hex), formerly known in english as Weapon, Vitality, and Spirit, though their unlocalized names are Weapon, Armor, and Tech. Utilized by [[Template:SlotColor]]
Retrieve's the color of a certain slot/category in any color format (default hex), formerly known in english as Weapon, Vitality, and Spirit, though their unlocalized names are Weapon, Armor, and Tech. Utilized by [[Template:Color]]


===Parameters===
===Parameters===
Line 14: Line 14:


===Examples===
===Examples===
See examples at [[Template:SlotColor]]
See examples at [[Template:Color]]
 
==remove_trailing_colon==
Remove's the ":" character from the end of a string
 
===Examples===
<pre>{{#invoke:Utilities|remove_trailing_colon|A Fate's Tale:}}</pre>
 
{{#invoke:Utilities|remove_trailing_colon|A Fate's Tale:}}
 
==process_variables==
Processes a localized string by replacing variable patterns with their corresponding values.
 
===Parameters===
* string_key - The localization key used to retrieve the base string (via Module:Lang)
 
* item_name - The name of the item used to look up variable values (via Module:ItemData)
 
===Examples===
Active Item descriptions in [[Template:Active Items]]
<pre>{{#invoke:Utilities|process_variables|upgrade_thermal_detonator_desc|Alchemical Fire}}</pre>
 
{{#invoke:Utilities|process_variables|upgrade_thermal_detonator_desc|Alchemical Fire}}