Difference between revisions of "Template:Moddef"
From DoomRL Wiki
Game Hunter (Talk | contribs) m (added UI) |
Shark20061 (Talk | contribs) (Final bugfix) |
||
(4 intermediate revisions by one user not shown) | |||
Line 14: | Line 14: | ||
See [[Template:Modarg]] for argument handling. | See [[Template:Modarg]] for argument handling. | ||
</noinclude>{{#ifeq:{{{1}}}|desc|{{Anchor|{{lc:{{#sub:{{PAGENAME}}|8|0}}}}_{{{2}}}}} | </noinclude>{{#ifeq:{{{1}}}|desc|{{Anchor|{{lc:{{#sub:{{PAGENAME}}|8|0}}}}_{{{2}}}}} | ||
− | ;}}{{#switch: {{#sub:{{PAGENAME}}|8|0}} | + | ;}}{{#switch: {{#sub:{{PAGENAME}}|8|{{#if:{{#pos:{{PAGENAME}}| |8}}|{{#expr:{{#pos:{{PAGENAME}}| |8}} - 7|0}}}}}} |
− | | | + | | area = {{#switch: {{{3}}} | dot = area. | cln = '''area'''<nowiki>:</nowiki>}} |
− | | | + | | being = {{#switch: {{{3}}} | dot = being. | cln = '''being'''<nowiki>:</nowiki>}} |
− | | | + | | coord = {{#switch: {{{3}}} | dot = coord. | cln = '''coord'''<nowiki>:</nowiki>}} |
− | | | + | | generator = {{#switch: {{{3}}} | dot = generator. | cln = '''generator'''<nowiki>:</nowiki>}} |
− | | | + | | item = {{#switch: {{{3}}} | dot = item. | cln = '''item'''<nowiki>:</nowiki>}} |
− | | | + | | level = {{#switch: {{{3}}} | dot = Level. | cln = '''level'''<nowiki>:</nowiki>}} |
− | | | + | | player = {{#switch: {{{3}}} | dot = player. | cln = '''player'''<nowiki>:</nowiki>}} |
− | | | + | | thing = {{#switch: {{{3}}} | dot = thing. | cln = '''thing'''<nowiki>:</nowiki>}} |
− | + | | ui = {{#switch: {{{3}}} | dot = ui. | cln = '''ui'''<nowiki>:</nowiki>}} | |
+ | |||
}}{{#switch: {{{1}}} | }}{{#switch: {{{1}}} | ||
| list = [[#{{lc:{{#sub:{{PAGENAME}}|8|0}}}}_{{{2}}}|{{{2}}}]] | | list = [[#{{lc:{{#sub:{{PAGENAME}}|8|0}}}}_{{{2}}}|{{{2}}}]] | ||
| desc = {{{2}}} | | desc = {{{2}}} | ||
}}({{#if: {{{5|}}}|{{#if: {{{6|}}} | {{modarg|{{{5}}}}} {{{6}}}}}{{#if:{{{7|}}}|<nowiki>, </nowiki>{{#if: {{{8|}}} |{{modarg|{{{7}}}}} {{{8}}}}}}}{{#if:{{{9|}}}|<nowiki>, </nowiki>{{#if: {{{10|}}} |{{modarg|{{{9}}}}} {{{10}}}}}}}{{#if:{{{11|}}}|<nowiki>, </nowiki>{{#if: {{{12|}}} |{{modarg|{{{11}}}}} {{{12}}}}}}}{{#if:{{{13|}}}|<nowiki>, </nowiki>{{#if: {{{14|}}} |{{modarg|{{{13}}}}} {{{14}}}}}}}{{#if:{{{15|}}}|<nowiki>, </nowiki>{{#if: {{{16|}}} |{{modarg|{{{15}}}}} {{{16}}}}}}}{{#if:{{{17|}}}|<nowiki>, </nowiki>{{#if: {{{18|}}} |{{modarg|{{{17}}}}} {{{18}}}}}}}{{#if:{{{19|}}}|<nowiki>, </nowiki>{{#if: {{{20|}}} |{{modarg|{{{19}}}}} {{{20}}}}}}}{{#if:{{{21|}}}|<nowiki>, </nowiki>{{#if: {{{22|}}} |{{modarg|{{{21}}}}} {{{22}}}}}}}{{#if:{{{23|}}}|<nowiki>, </nowiki>{{#if: {{{24|}}} |{{modarg|{{{23}}}}} {{{24}}}}}}}}}){{#if: {{{4|}}}|<nowiki> </nowiki>→ {{#if: {{#pos:{{{4}}}|,}}|{{modarg|{{#explode:{{{4}}}|,|0}}}},{{modarg|{{#explode:{{{4}}}|,|1}}}}|{{modarg|{{{4}}}}} }} }} | }}({{#if: {{{5|}}}|{{#if: {{{6|}}} | {{modarg|{{{5}}}}} {{{6}}}}}{{#if:{{{7|}}}|<nowiki>, </nowiki>{{#if: {{{8|}}} |{{modarg|{{{7}}}}} {{{8}}}}}}}{{#if:{{{9|}}}|<nowiki>, </nowiki>{{#if: {{{10|}}} |{{modarg|{{{9}}}}} {{{10}}}}}}}{{#if:{{{11|}}}|<nowiki>, </nowiki>{{#if: {{{12|}}} |{{modarg|{{{11}}}}} {{{12}}}}}}}{{#if:{{{13|}}}|<nowiki>, </nowiki>{{#if: {{{14|}}} |{{modarg|{{{13}}}}} {{{14}}}}}}}{{#if:{{{15|}}}|<nowiki>, </nowiki>{{#if: {{{16|}}} |{{modarg|{{{15}}}}} {{{16}}}}}}}{{#if:{{{17|}}}|<nowiki>, </nowiki>{{#if: {{{18|}}} |{{modarg|{{{17}}}}} {{{18}}}}}}}{{#if:{{{19|}}}|<nowiki>, </nowiki>{{#if: {{{20|}}} |{{modarg|{{{19}}}}} {{{20}}}}}}}{{#if:{{{21|}}}|<nowiki>, </nowiki>{{#if: {{{22|}}} |{{modarg|{{{21}}}}} {{{22}}}}}}}{{#if:{{{23|}}}|<nowiki>, </nowiki>{{#if: {{{24|}}} |{{modarg|{{{23}}}}} {{{24}}}}}}}}}){{#if: {{{4|}}}|<nowiki> </nowiki>→ {{#if: {{#pos:{{{4}}}|,}}|{{modarg|{{#explode:{{{4}}}|,|0}}}},{{modarg|{{#explode:{{{4}}}|,|1}}}}|{{modarg|{{{4}}}}} }} }} |
Latest revision as of 17:54, 10 June 2013
This is the prototypical template for expressing API functions. It works with the following args:
- Sets the type of expression. Currently there are two cases:
- list is what's used in the table: it automatically comes with the necessary link for the description's anchor.
- desc is what's used underneath the table: this provides the anchor that is linked to the list.
- Sets the function name. For example, if the function is called Level.place_tile, then this should be set to place_tile.
- Determines the function type. There are two cases:
- dot is the dot form
- cln is the colon form
- Sets the output argument, if any. Leaving this blank should always be done for list functions. You can include up to two comma-separated outputs.
- From here, input arguments are set. These are be handled in pairs: the first should be the arg type, while the second should be the arg name. You can include up to eight arg pairs in this manner.
Please note that this template is set up to include information based on the page name, so they can only be used on their appropriate pages. Thus, you can write being API functions using this template for the being page, but not for the coord page.
See Template:Modarg for argument handling. ()