Template:GM/doc

From Ring of Brodgar
Jump to navigation Jump to search

Info

Main template to create a Game-Menu(GM) bar.
Currently supporting up to 6 names. (Anonymous parameters.)
Using a leading '$' character to target the used menu, or menu-item, hot-key. (Only one '$' per name.)
Includes general Legacy support.

Usage

Normal: {{GM|string1|string2|..|string6}}
Copy: {{GM|copy=<pagename>}} -- Use the GM from an other page. (Limitation: Target page to copy from can only have one GM call on it.)
Inline: {{GM|inline=|...}} -- Inline mode vs default block mode.

Example

Leading and trailing string spaces in examples here are for clarity.
{{GM| $Menu-name 1 | Menu-$name 2 | Menu-nam$e 3 | Menu-name $4| Menu Item-name 5}}
Output: Icon keyboard.pngMenu-name 1 > Menu-name 2 > Menu-name 3 > Menu-name 4 > Menu Item-name 5
or
{{GM
| $Menu Item 1
| Menu $Item 2
| Menu Ite$m 3
| Menu Item $4
| Menu Item 5
}}
Output:

Icon keyboard.pngMenu Item 1 > Menu Item 2 > Menu Item 3 > Menu Item 4 > Menu Item 5

Used sub-templates

GM -- Pre-processing of GM input data. (Uses "GM/sub".)
GM/sub -- Secondary/main GM processor. (Uses "GM/box", Saves 'Menu_usage_last' data, "GM/prop(/legacy)", "GM/cat(/legacy)".)
GM/box -- Drawing of the GM box. (Uses "GM/keys".)
GM/keys -- Adds key-box on target character. (Uses "Key/box".)
GM/prop -- Saving to 'Menu_Usage' property.
GM/prop/legacy -- Legacy support case.
GM/cat -- Auto adds categories based on uses menu-names. (Somewhat questionable practice.)
GM/cat/legacy -- Legacy support case.

Other used templates

Key/box -- Draws key-box around given string.
Str_us2sp -- Underscore to Space.
Str_sp2us -- Space to Underscore.