Template:BSLfuncinfo: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(working on comma/parens fix)
(adding semicolon to "finish" function call; putting Win/Mac icons in consistent order)
Line 15: Line 15:
|-
|-
|{{#ifeq:{{{mac|yes}}}|no|{{#ifeq:{{{win|yes}}}|no|[[Image:Cmbox deletion.png|20px]]                                <!--if neither platform, show error icon
|{{#ifeq:{{{mac|yes}}}|no|{{#ifeq:{{{win|yes}}}|no|[[Image:Cmbox deletion.png|20px]]                                <!--if neither platform, show error icon
                                               -->|[[Image:Platform-empty.png|20px]] [[Image:Platform-Win.png|20px]]  <!--if only Win, show blank and Win icon
                                               -->|[[Image:Platform-Win.png|20px]] [[Image:Platform-empty.png|20px]]  <!--if only Win, show Win and blank icon
                       -->}}<!--
                       -->}}<!--
                       -->|{{#ifeq:{{{win|yes}}}|no|[[Image:Platform-Mac.png|20px]] [[Image:Platform-empty.png|20px]] <!--if only Mac, show Mac and blank icon
                       -->|{{#ifeq:{{{win|yes}}}|no|[[Image:Platform-empty.png|20px]] [[Image:Platform-Mac.png|20px]] <!--if only Mac, show blank and Mac icon
                                               -->|[[Image:Platform-Win.png|20px]] [[Image:Platform-Mac.png|20px]]    <!--if both platforms, show both icons
                                               -->|[[Image:Platform-Win.png|20px]] [[Image:Platform-Mac.png|20px]]    <!--if both platforms, show both icons
                       -->}}<!--
                       -->}}<!--
Line 26: Line 26:
                                                                     |<u>or</u> {{{arg1altname|}}}|}} <!-- print alternative arg 1 if present
                                                                     |<u>or</u> {{{arg1altname|}}}|}} <!-- print alternative arg 1 if present
                                                               -->{{#if:{{{arg2name|}}}|, |}}        <!-- if there is a next arg, print comma
                                                               -->{{#if:{{{arg2name|}}}|, |}}        <!-- if there is a next arg, print comma
                                               -->|void )}}                                           <!-- if no args, print "void" and a close parens -->
                                               -->|void );}}                                         <!-- if no args, print "void" and a close parens -->
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg2name|}}}
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg2name|}}}
                                                 |{{{arg2name|}}} {{#if:{{{arg2altname|}}}
                                                 |{{{arg2name|}}} {{#if:{{{arg2altname|}}}
                                                                     |<u>or</u> {{{arg2altname|}}}|}} <!-- print alternative arg 2 if present
                                                                     |<u>or</u> {{{arg2altname|}}}|}} <!-- print alternative arg 2 if present
                                                               -->{{#if:{{{arg3name|}}}|, |}}        <!-- if there is a next arg, print comma
                                                               -->{{#if:{{{arg3name|}}}|, |}}        <!-- if there is a next arg, print comma
                                               -->|{{#if:{{{arg1name|}}}| ) |}} }}                   <!-- if this was last arg, close parentheses -->
                                               -->|{{#if:{{{arg1name|}}}| ); |}} }}                   <!-- if this was last arg, close parentheses -->
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg3name|}}}
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg3name|}}}
                                                 |{{{arg3name|}}} {{#if:{{{arg3altname|}}}
                                                 |{{{arg3name|}}} {{#if:{{{arg3altname|}}}
                                                                     |<u>or</u> {{{arg3altname|}}}|}} <!-- print alternative arg 3 if present
                                                                     |<u>or</u> {{{arg3altname|}}}|}} <!-- print alternative arg 3 if present
                                                               -->{{#if:{{{arg4name|}}}|, |}}        <!-- if there is a next arg, print comma
                                                               -->{{#if:{{{arg4name|}}}|, |}}        <!-- if there is a next arg, print comma
                                               -->|{{#if:{{{arg2name|}}}| ) |}} }}                   <!-- if this was last arg, close parentheses -->
                                               -->|{{#if:{{{arg2name|}}}| ); |}} }}                   <!-- if this was last arg, close parentheses -->
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg4name|}}}
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg4name|}}}
                                                 |{{{arg4name|}}} {{#if:{{{arg4altname|}}}           
                                                 |{{{arg4name|}}} {{#if:{{{arg4altname|}}}           
                                                                     |<u>or</u> {{{arg4altname|}}}|}} <!-- print alternative arg 4 if present
                                                                     |<u>or</u> {{{arg4altname|}}}|}} <!-- print alternative arg 4 if present
                                             -->}}                                                    <!-- this must be last arg, so no comma
                                             -->}}                                                    <!-- there can't be a next arg, so no comma
                                             -->{{#if:{{{arg3name|}}}| ) |}}                         <!-- if this was last arg, close parentheses -->
                                             -->{{#if:{{{arg3name|}}}| ); |}}                         <!-- if this was last arg, close parentheses -->
|-
|-
|default:
|default:

Revision as of 23:46, 13 November 2015


BSLfunc allows for standardized listing of BSL functions. The assumption at the moment is that the most arguments a function can take is four; this will be raised if some functions are discovered to take more arguments.

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.
arg1optional, arg2optional, arg3optional, arg4optional
If this argument can be omitted, set this to "yes".
arg1default, arg2default, arg3default, arg4default
Optional arguments have default assumed values that are used when the argument is not used explicitly; give those values here.
arg1type, arg2type, arg3type, arg4type
If these arguments to the BSL function exist, give their types here.
arg1name, arg2name, arg3name, arg4name
If these arguments to the BSL function exist, give their names here.
arg1alttype, arg2alttype, arg3alttype, arg4alttype
If a BSL function can take more than one kind of data in a given argument position, give the second argument type here.
arg1altname, arg2altname, arg3altname, arg4altname
If a BSL function can take more than one kind of data in a given argument position, give the second argument name here.

Here's a default blank call with all parameters:

{{BSLfunc
|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= }}