Module:Utilities/doc: Difference between revisionsGive feedback
Jump to navigation
Jump to search
added process_variables to doc |
|||
| Line 26: | Line 26: | ||
==process_variables== | ==process_variables== | ||
Processes a localized string by replacing variable patterns with their corresponding values. | 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=== | ===Examples=== | ||
Active Item descriptions in [[Template:Active Items]] | |||
<pre>{{#invoke:Utilities|process_variables|upgrade_thermal_detonator_desc|Alchemical Fire}}</pre> | <pre>{{#invoke:Utilities|process_variables|upgrade_thermal_detonator_desc|Alchemical Fire}}</pre> | ||
{{#invoke:Utilities|process_variables|upgrade_thermal_detonator_desc|Alchemical Fire}} | {{#invoke:Utilities|process_variables|upgrade_thermal_detonator_desc|Alchemical Fire}} | ||
Latest revision as of 21:46, 11 April 2025
Overview
[edit source]Utility functions that serve any miscellaneous purpose
Functions
[edit source]get_slot_color
[edit source]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
[edit source]- slot - slot key, options are Weapon, Armor, and Tech
- color_format - color format - Defaults to hex. Valid options are hex, rgb, hsl, cmyk
- no_wrap - (OPTIONAL) - Defaults to false. Set to true to remove prefixes and postfixes of '#' from hex, or 'rgb()', 'hsl()', and 'cmyk()' from the other formats. May be useful for altering the values dynamically
- debug_mode - (OPTIONAL) - Defaults to false. Used mostly for documentation purposes
Examples
[edit source]See examples at Template:Color
remove_trailing_colon
[edit source]Remove's the ":" character from the end of a string
Examples
[edit source]{{#invoke:Utilities|remove_trailing_colon|A Fate's Tale:}}
A Fate's Tale
process_variables
[edit source]Processes a localized string by replacing variable patterns with their corresponding values.
Parameters
[edit source]- 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
[edit source]Active Item descriptions in Template:Active Items
{{#invoke:Utilities|process_variables|upgrade_thermal_detonator_desc|Alchemical Fire}}
Throw a flask that explodes on contact, creating an area that does increasing
spirit damage per second and reduces enemy Bullet Resist.
50% less effective vs non-heroes.