Template:BSLvarinfo: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(using edit pencil icon instead of "[edit]")
(attempt at a revised, briefer listing; revised docs as well)
Line 1: Line 1:
<includeonly>{{Anchor|{{{name|placeholder}}}}}
<includeonly>{{Anchor|{{{name|placeholder}}}}}
{| class="BSLVarInfo"
<span class="BSLVarInfo" title="Initial value at level-load: {{#ifeq:{{{type|int}}}|int|{{{default|0}}}|{{#ifeq:{{{type}}}|float|{{{default|0.0}}}|{{#ifeq:{{{type}}}|bool|{{{default|true}}}|{{{default|""}}} }} }} }}">{{{type}}} '''[[{{{name|}}}|{{{name|}}}]]'''</span></includeonly><noinclude>'''BSLvarinfo''' allows for standardized listing of BSL variables. The output looks like this:
|-
|{{{type}}}
|align="right"|[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]
|-
|'''{{{name|}}}'''
|= {{#ifeq:{{{type|int}}}|int|{{{default|0}}}|{{#ifeq:{{{type}}}|float|{{{default|0.0}}}|{{#ifeq:{{{type}}}|bool|{{{default|true}}}|{{{default|""}}} }} }} }};'''
|}</includeonly><noinclude>'''BSLvarinfo''' allows for standardized listing of BSL variables.


Parameters:
Imagine that this is a tutorial and we mention {{:chr_all_active}}, and then here is some other text.
 
==Usage==
This template is not to be called directly by an editor on various pages. If you look at the wiki markup for the above sample usage, it's actually:
 
<nowiki>Imagine that this is a tutorial and we mention {{:chr_all_active}}, and then here is some other text.</nowiki>
 
So if you want to see a variable listing, you transclude the text of the page for that variable. You'll notice that the default value for the variable at the time of level-load will pop up if you hover over the listing.
 
The '''BSLvarinfo''' template is used on that variable's "personal" page, but even there it's only invoked indirectly by another template. If you click on the link behind the text "chr_all_active" above, then look at the markup for that page, you'll see that the information about a variable is being fed into a template. The end result is the output you see above. A full explanation of the system is at [[BSL:Grouping]], but the main thing you need to know is that you can enter the information about a variable by starting a page in its name, then either pasting in the template below, or clicking on the [[Image:Button_BSL_var.png]] button supplied in the toolbar by [[XEB]] and filling in the fields in the dialog that pops up.
 
==Parameters==
;<tt>name</tt>
;<tt>name</tt>
:Name of variable.
:Name of variable.
Line 22: Line 26:
:You don't have to use these unless the variable is <u>not</u> available and working on one platform; set the appropriate parameter(s) to "no" if that is the case.
:You don't have to use these unless the variable is <u>not</u> available and working on one platform; set the appropriate parameter(s) to "no" if that is the case.


Below is a blank call for the template, to save some time. You may find it easier to use the GUI for this template that is provided by [[XEB]].
==Starter text==
Here is a blank call for the template, to save some time, but you may find it easier to use the GUI for this template that is provided by XEB.


  <nowiki>{{</nowiki>BSLvarinfo
  <nowiki>{{</nowiki>BSLvarinfo

Revision as of 15:49, 20 February 2018

BSLvarinfo allows for standardized listing of BSL variables. The output looks like this:

Imagine that this is a tutorial and we mention bool chr_all_active, and then here is some other text.

Usage

This template is not to be called directly by an editor on various pages. If you look at the wiki markup for the above sample usage, it's actually:

Imagine that this is a tutorial and we mention {{:chr_all_active}}, and then here is some other text.

So if you want to see a variable listing, you transclude the text of the page for that variable. You'll notice that the default value for the variable at the time of level-load will pop up if you hover over the listing.

The BSLvarinfo template is used on that variable's "personal" page, but even there it's only invoked indirectly by another template. If you click on the link behind the text "chr_all_active" above, then look at the markup for that page, you'll see that the information about a variable is being fed into a template. The end result is the output you see above. A full explanation of the system is at BSL:Grouping, but the main thing you need to know is that you can enter the information about a variable by starting a page in its name, then either pasting in the template below, or clicking on the File:Button BSL var.png button supplied in the toolbar by XEB and filling in the fields in the dialog that pops up.

Parameters

name
Name of variable.
type
Type of variable; should be "bool", "int", "float", or "string".
default
Default value of variable, if there is one at the time the level starts.
mac, win
You don't have to use these unless the variable is not available and working on one platform; set the appropriate parameter(s) to "no" if that is the case.

Starter text

Here is a blank call for the template, to save some time, but you may find it easier to use the GUI for this template that is provided by XEB.

{{BSLvarinfo
|type=
|default=
|name=
|mac=
|win=
}}