Template:BSLfuncinfo: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(dropping name/parameter font size down to regular size, but bold)
(forgot to make name bold; it's hard to close the parameters' bold tags, so what if we just don't?)
Line 45: Line 45:
             -->}}
             -->}}
|-
|-
|{{{name}}}(
|'''{{{name}}}('''
|align="center"|'''{{#if:{{{arg1name|}}}<!--
|align="center"|'''{{#if:{{{arg1name|}}}<!--
                     -->|{{#if:{{{arg1optional|}}}|''|}}<!--        start italics if optional arg
                     -->|{{#if:{{{arg1optional|}}}|''|}}<!--        start italics if optional arg
Line 55: Line 55:
                       -->{{#if:{{{arg2name|}}}|, |}}<!--            if there is a next arg, print comma
                       -->{{#if:{{{arg2name|}}}|, |}}<!--            if there is a next arg, print comma
                     -->| );<!--                                    if no args, just close parentheses
                     -->| );<!--                                    if no args, just close parentheses
                 -->}}'''
                 -->}}
|align="center"|'''{{#if:{{{arg2name|}}}<!--
|align="center"|'''{{#if:{{{arg2name|}}}<!--
                     -->|{{#if:{{{arg2optional|}}}|''|}}<!--
                     -->|{{#if:{{{arg2optional|}}}|''|}}<!--
Line 65: Line 65:
                       -->{{#if:{{{arg3name|}}}|, |}}<!--
                       -->{{#if:{{{arg3name|}}}|, |}}<!--
                     -->|{{#if:{{{arg1name|}}}| ); |}}<!--          if this was last arg, close parentheses
                     -->|{{#if:{{{arg1name|}}}| ); |}}<!--          if this was last arg, close parentheses
                 -->}}'''
                 -->}}
|align="center"|'''{{#if:{{{arg3name|}}}<!--
|align="center"|'''{{#if:{{{arg3name|}}}<!--
                     -->|{{#if:{{{arg3optional|}}}|''|}}<!--
                     -->|{{#if:{{{arg3optional|}}}|''|}}<!--
Line 75: Line 75:
                       -->{{#if:{{{arg4name|}}}|, |}}<!--
                       -->{{#if:{{{arg4name|}}}|, |}}<!--
                     -->|{{#if:{{{arg2name|}}}| ); |}}<!--
                     -->|{{#if:{{{arg2name|}}}| ); |}}<!--
                 -->}}'''
                 -->}}
|align="center"|'''{{#if:{{{arg4name|}}}<!--
|align="center"|'''{{#if:{{{arg4name|}}}<!--
                     -->|{{#if:{{{arg4optional|}}}|''|}}<!--
                     -->|{{#if:{{{arg4optional|}}}|''|}}<!--
Line 85: Line 85:
                       -->{{#if:{{{arg5name|}}}|, |}}<!--
                       -->{{#if:{{{arg5name|}}}|, |}}<!--
                     -->|{{#if:{{{arg3name|}}}| ); |}}<!--
                     -->|{{#if:{{{arg3name|}}}| ); |}}<!--
                 -->}}'''
                 -->}}
|align="center"|'''{{#if:{{{arg5name|}}}<!--
|align="center"|'''{{#if:{{{arg5name|}}}<!--
                     -->|{{#if:{{{arg5optional|}}}|''|}}<!--
                     -->|{{#if:{{{arg5optional|}}}|''|}}<!--
Line 95: Line 95:
                       -->{{#if:{{{arg6name|}}}|, |}}<!--
                       -->{{#if:{{{arg6name|}}}|, |}}<!--
                     -->|{{#if:{{{arg4name|}}}| ); |}}<!--
                     -->|{{#if:{{{arg4name|}}}| ); |}}<!--
                 -->}}'''
                 -->}}
|align="center"|'''{{#if:{{{arg6name|}}}<!--
|align="center"|'''{{#if:{{{arg6name|}}}<!--
                     -->|{{#if:{{{arg6optional|}}}|''|}}<!--
                     -->|{{#if:{{{arg6optional|}}}|''|}}<!--
Line 105: Line 105:
                       -->{{#if:{{{arg7name|}}}|, |}}<!--
                       -->{{#if:{{{arg7name|}}}|, |}}<!--
                     -->|{{#if:{{{arg5name|}}}| ); |}}<!--
                     -->|{{#if:{{{arg5name|}}}| ); |}}<!--
                 -->}}'''
                 -->}}
|align="center"|'''{{#if:{{{arg7name|}}}<!--
|align="center"|'''{{#if:{{{arg7name|}}}<!--
                     -->|{{#if:{{{arg7optional|}}}|''|}}<!--
                     -->|{{#if:{{{arg7optional|}}}|''|}}<!--
Line 115: Line 115:
                       -->{{#if:{{{arg8name|}}}|, |}}<!--
                       -->{{#if:{{{arg8name|}}}|, |}}<!--
                     -->|{{#if:{{{arg6name|}}}| ); |}}<!--
                     -->|{{#if:{{{arg6name|}}}| ); |}}<!--
                 -->}}'''
                 -->}}
|align="center"|'''{{#if:{{{arg8name|}}}<!--
|align="center"|'''{{#if:{{{arg8name|}}}<!--
                     -->|{{#if:{{{arg8optional|}}}|''|}}<!--
                     -->|{{#if:{{{arg8optional|}}}|''|}}<!--
Line 124: Line 124:
                       -->{{#if:{{{arg8optional|}}}|''|}}<!-- no check for comma after this since this is the last possible arg
                       -->{{#if:{{{arg8optional|}}}|''|}}<!-- no check for comma after this since this is the last possible arg
                     -->|{{#if:{{{arg7name|}}}| ); |}}<!--
                     -->|{{#if:{{{arg7name|}}}| ); |}}<!--
                 -->}}'''
                 -->}}
|-
|-
|default:      {{#if:{{{default|}}}    |{{{default|}}}| --}}                              <!-- print "--" if there is no default return value for function -->
|default:      {{#if:{{{default|}}}    |{{{default|}}}| --}}                              <!-- print "--" if there is no default return value for function -->

Revision as of 02:39, 22 December 2015

BSLfuncinfo allows for standardized listing of BSL functions. Since BSL allows for functions to take up to eight arguments, and each argument can be described here by up to six parameters, this makes BSLfuncinfo the most complex template on the wiki. However, you'll rarely need to use more than a few of these parameters to describe an average function.

Parameters:

type
Return type of function; should be "int", "string", "float", "bool", or "void".
default
Default return value of function, if there is one at the time the level starts.
name
Name of function.
mac, win
You don't have to use these unless the function is not available and working on one platform; set the appropriate parameter(s) to "no" if that is the case.
arg[1-8]optional
If this argument can be omitted, set this to "yes".
arg[1-8]default
Optional arguments have default assumed values that are used when the argument is not provided; give those values here.
arg[1-8]type
If these arguments to the BSL function exist, give their types here.
arg[1-8]name
If these arguments to the BSL function exist, give their names here.
arg[1-8]alttype
If a BSL function can take more than one kind of data in a given argument position, give the second argument type here.
arg[1-8]altname
If a BSL function can take more than one kind of data in a given argument position, give the second argument name here.

Below is a default blank call for all parameters up through the fourth function argument, to save some time. You can omit any parameters you don't need when adding this template to a page. However, you may find it easier to use the GUI for this template that is provided by XEB.

{{BSLfuncinfo
|type=
|default=
|name=
|mac=
|win=
|arg1optional= |arg1default= |arg1type= |arg1name= |arg1alttype= |arg1altname=
|arg2optional= |arg2default= |arg2type= |arg2name= |arg2alttype= |arg2altname=
|arg3optional= |arg3default= |arg3type= |arg3name= |arg3alttype= |arg3altname=
|arg4optional= |arg4default= |arg4type= |arg4name= |arg4alttype= |arg4altname= }}