Difference between revisions of "User:Strife Onizuka/Sandbox/Switch/Template:Test"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
__NOTOC__ <noinclude>
{{LSL Header}} __NOTOC__  
<noinclude>
<pre>
<pre>
{{LSL Generic
{{LSL_Function
|header_title
|func
|header_text
|func_id
|header_floater
|func_sleep
|footer
|func_desc
|deprecated
|func_footnote
|return_type
|return_text
|p1_type|p1_name|p1_desc
|p2_type|p2_name|p2_desc
|p3_type|p3_name|p3_desc
|p4_type|p4_name|p4_desc
|p5_type|p5_name|p5_desc
|p6_type|p6_name|p6_desc
|p7_type|p7_name|p7_desc
|p8_type|p8_name|p8_desc
|p9_type|p9_name|p9_desc
|p10_type|p10_name|p10_desc
|p11_type|p11_name|p11_desc
|p12_type|p12_name|p12_desc
|constants
|constants
|spec
|spec
Line 14: Line 29:
|also_header
|also_header
|also_functions
|also_functions
|also_tests
|also_articles
|also_articles
|also_footer
|also_footer
|notes
|notes
|mode
|mode
|template
|deprecated
|type
|permission
|negative_index
|cat1
|cat2
|cat3
|cat4
|cat5
|cat6
|sort
}}
}}
</pre>
</pre>


==Test==
The LSL_Function template is a intermediate template for LSL_Generic, which handles the formating for both functions and events (LSL_Event is also an intermediate template). The main job of this template is to change the parameter, names & setup the right-side floater and set the additional copyright message. Also makes permission requirements a part of the template.
<div id="box">
 
{{{{FULLPAGENAME}}
{| {{Prettytable}}
|header_title=Title
!parameter
|header_text=Text
!desc
|header_floater=Floater
!example
|footer=footer
|-
|deprecated
|func
|Function name
|-
|func_id
|{{LSLG|Function ID}}
|1.0
|-
|func_sleep
|{{LSLG|Delay}}
|0.0
|-
|func_energy
|{{LSLG|Energy}}
|10.0
|-
|func_desc
|Function description text.
|Gives the monkey a banana
|-
|func_footnote
|Function footnote (appears after the parameters text).
|Has the side effect of causing the avatar to run in circles shouting like on fire.
|-
|return_type
|return type
|integer
|-
|return_text
|"Returns a return_type return_text" in most cases return_text can be used instead of func_desc.
|that is a monkey
|-
|p1_type
|first parameter type
|-
|p1_name
|first parameter name
|-
|p1_desc
|first parameter desc
|-
|p2_type
|second parameter type
|-
|p2_name
|second parameter name
|-
|p2_desc
|second parameter desc
|
|-
|...
|
|
|-
|p12_type
|twelfth parameter type
|
|-
|p12_name
|twelfth parameter name
|-
|p12_desc
|twelfth parameter desc
|-
|constants
|constants
|constants area, no box, please use a table for this section.
|
|-
|spec
|spec
|spec box
|
|-
|caveats
|caveats
|caveats box
|
|-
|examples
|examples
|examples box
|
|-
|helpers
|helpers
|helper functions box
|
|-
|also_header
|also_header
|also header
|
|-
|also_functions
|also_functions
|also functions indent
|
|-
|also_articles
|also_articles
|also articles indent
|
|-
|also_tests
|also tests indent
|
|-
|also_footer
|also_footer
|also footer
|
|-
|notes
|notes
|notes box
|
|-
|mode
|mode
|template=LSLG
|if mode equals 'god' then it is tagged as requiring godmode. if set to 'request' marks the page as a feature request.
|self=self
|
|type=event
|-
}}
|deprecated
</div>
|Marks the function as deprecated. Set the value to the replacement functions name or 'none'. If it is not set to none and it is infact set, it will include a link to the replacement function.
 
|-
</noinclude><includeonly> __NOEDITSECTION__ {{#if:{{{depreciated|}}}{{{deprecated|}}}|
|permission
<div id="box" style="background:red;">
|Set to the PERMISSION_* flag that the function requires. It will amend the appropriate fields to show this requirement (without all the haste of doing it yourself)
&nbsp;&nbsp;'''Deprecated {{{type}}}'''
|PERMISSION_CHANGE_LINKS
<div style="padding: 0.5em;background:#ffffff;">
|-
''(This {{{type}}} has been deprecated{{#ifeq:{{{depreciated|}}}{{{deprecated|}}}|none|.|, please use {{LSLG|{{{depreciated|}}}{{{deprecated|}}}}} instead.)}}''</div></div>{{#if:{{{self|}}}|| {{LSLC|Deprecated|{{{sort|}}}}} }} |}}{{#ifeq:{{{mode|}}}|request|
|negative_index
<div id="box" style="background:red;">
|'true', 'false' or nothing. If set to true or false then it amends the appropriate fields so that the function is marked as supporting or not supporting negative indexes.
&nbsp;&nbsp;'''LSL Feature Request'''
|true
<div style="padding: 0.5em;background:#ffffff;">
''This {{{type}}} does not exist and is a feature request.''</div></div> {{#if:{{{self|}}}|| {{LSLC|WishList|{{{sort|}}}}} }}}}{{#ifeq:{{{mode|}}}|god|
<div id="box" style="background:yellow;">
&nbsp;&nbsp;'''Requires God Mode'''
<div style="padding: 0.5em;background:#ffffff;">
''(This {{{type}}} can only be executed in God Mode.)''</div></div>{{#if:{{{self|}}}|| {{LSLC|God_Mode|{{{sort|}}} }}}}}} <!-- {{lowercase|{{{1}}}}} -->
{| width="100%"
|-
|-
| valign="top" | <div id="box">
|self
<div style="float:right;">
|Special field that you only set if you don't want the function to be included in any categories.
== {{ucfirst:{{{type|}}}}} ==
|
</div>
== {{{header_title|}}} ==
<div style="padding: 0.5em;clear:right;">{{#if:{{{header_floater|}}}|<div id="box" style="float:right;">{{{header_floater|}}}</div>}}
{{{header_text|}}}
{{#if:{{{header_floater|}}}|<div style="clear:right;" ></div>}}
</div></div>
|-
|-
|{{ #if: {{{spec|}}} |
|cat1
<div id="box">
|An LSL specific category and sets the proper sort. (example would add the function to the "LSL Stub" category)
== Specification ==
|Stub
<div style="padding: 0.5em">
{{{spec}}}
</div>
</div>
| }}
|-
|-
|{{ #if: {{{constants_nb|}}} | {{{constants_nb}}}| }}{{ #if: {{{constants|}}} |
|cat2
<div id="box">
|"
== Constants ==
{{{constants}}}
</div>
| }}
|-
|-
|<div id="box">
|cat3
== Caveats ==
|"
<div style="padding: 0.5em">
{{#if:{{{depreciated|}}}{{{deprecated|}}}|* This {{{type}}} has been deprecated{{#ifeq:{{{depreciated|}}}{{{deprecated|}}}|none||, please use {{LSLG|{{{depreciated|}}}{{{deprecated|}}}}} instead}}.<br />|}}{{#ifeq:{{{mode|}}}|god|* This {{{type}}} can only be executed in God Mode.<br />|}}{{#if: {{{depreciated|}}}{{{deprecated|}}}{{{caveats|}}}{{#ifeq:{{{mode|}}}|god|god|}} | {{{caveats|}}} | * None known.}}
</div>
</div>
|-
|-
|{{ #if: {{#if:{{{depreciated|}}}{{{deprecated|}}}||t}}{{{examples|}}} |
|cat4
<div id="box">
|"
== Examples ==
<div style="padding: 0.5em">
{{ #if: {{{examples|}}} | {{{examples|}}} | }}
</div>
</div>
|}}
|-
|-
|{{ #if: {{{helpers|}}} |  
|cat5
<div id="box">
|"
== Helper Functions ==
<div style="padding: 0.5em">
{{{helpers}}}
</div>
</div>
| }}
|-
|-
|{{ #if: {{#if:{{{depreciated|}}}{{{deprecated|}}}||t}}{{{notes|}}} |
|cat6
<div id="box">
|"
== Notes ==
<div style="padding: 0.5em">
{{ #if: {{{notes|}}} | {{{notes|}}} | }}
</div>
</div>
|}}
|-
|-
|{{ #if: {{{also_footer|}}}{{{also_functions|}}}{{{also_events|}}}{{{also_articles|}}}{{{also_tests|}}}{{{also_header|}}} {{#ifexist:{{PAGENAME}}/test|a|{{#ifexist:{{PAGENAME}} test|a}}}}|
|sort
|not required but used to specify the sort order, if excluded the wiki will calculate this value for you.
|}
 
<div id="box">
<div id="box">
== See Also ==
{{{{FULLPAGENAME}}
<div style="padding: 0.5em">
|func=MyFunction
{{ #if: {{{also_header|}}} | {{{also_header}}}<br /> |}}{{ #if: {{{also_events|}}} |
|func_id=-1
<ul><li> Events </li></ul>
|func_sleep=100.5
<dl><dd>
|func_energy=0.0
{{{also_events|}}}</dl> | }}{{ #if: {{{also_functions|}}} |
|func_desc=A fictitious function
<ul><li> Functions </li></ul>
|func_footnote=func_footnote
<dl><dd>
|return_type=void
{{{also_functions|}}}</dl> | }}{{ #if: {{{also_tests|}}}{{#ifexist:{{PAGENAME}}/test|a|{{#ifexist:{{PAGENAME}} test|a}}}} |
|return_text=(aka nadda, nothing).
<ul><li> Tests </li></ul>
|p1_type=integer|p1_name=i|p1_desc
<dl><dd>
|p2_type=float|p2_name=f|p2_desc
{{#ifexist:{{PAGENAME}}/test|*{{LSLG|{{{1|}}}/test|{{{1|}}} conformance script}}|{{#ifexist:{{PAGENAME}} test|*{{LSLG|{{{1|}}} test|{{{1|}}} conformance script}}}}}}
|p3_type=string|p3_name=s|p3_desc
{{{also_tests|}}}</dl> | }}{{ #if: {{{also_articles|}}} |
|p4_type=key|p4_name=k|p4_desc
<ul><li> Articles </li></ul>
|p5_type=list|p5_name=l|p5_desc
<dl><dd>
|p6_type=vector|p6_name=v|p6_desc
{{{also_articles}}}</dl> | }} {{{also_footer|}}}
|p7_type=rotation|p7_name=r|p7_desc
|constants=constants
|spec=spec
|caveats=caveats
|examples=examples
|helpers=helpers
|also_header=also_header
|also_events=*also_events
|also_functions=*also_functions
|also_articles=*also_articles
|also_tests=*also_tests
|also_footer=also_footer
|notes=notes
|mode
|self=self
|permission=PERMISSION_FLAG
|negative_index=true
}}
</div>
</div>
</div>
</noinclude><includeonly>{{#if:{{{func_id|}}}{{{mode|}}}||
| }}
<div id="box" style="background:red;">
|}
&nbsp;&nbsp;'''Don't delete the 'func_id''''
{{{footer|}}}</includeonly>
<div style="padding: 0.5em;background:#ffffff;">
''func_id is a bit of technical information that should not be removed as it is pertinent to anyone writing an LSL compiler or decompiler, so you go and revert the page or set the value properly right now :P.''</div></div>{{#if:{{{self|}}}|| {{LSLC|FixMe}} }} }}{{#if:{{{also|}}}|
<div id="box" style="background:yellow;">
&nbsp;&nbsp;''' 'also' Tag Removed'''
<div style="padding: 0.5em;background:#ffffff;">
''(Please use 'also_header','also_events','also_functions','also_articles', or 'also_footer')''</div></div>{{#if:{{{self|}}}|| {{LSLC|FixMe}} }} }}{{#if:{{{return_text|}}}{{{func_desc|}}}||
<div id="box" style="background:yellow;">
&nbsp;&nbsp;''' 'return_text' and 'func_desc' can both not be undefined'''
<div style="padding: 0.5em;background:#ffffff;">
''(Please use 'return_text' or 'func_desc' to describe the functions actions.)''</div></div>{{#if:{{{self|}}}|| {{LSLC|FixMe}} }} }} {{LSL Generic
|{{{func}}}|
|header_floater=<table>
<tr>
<td> {{HoverText|{{#ifeq:{{{mode|}}}|request|REQUEST|{{{func_id|}}}}}|The function index number.}}
<td> {{LSLG|Function ID}}
</tr>
<tr>
<td> {{HoverText|{{{func_sleep|}}}|The number of seconds this script will sleep after executing this function.}}
<td> {{LSLG|Delay}}
</tr>
<tr>
<td> {{HoverText|{{{func_energy|}}}|The quantity of energy consumed by this function.}}
<td> {{LSLG|Energy}}
</tr>
</table>
|header_text={{LSL_Generic/Text
|return_type={{{return_type|}}}
|return_text={{{return_text|}}}
|header_desc={{{func_desc|}}}
|header_footnote={{{func_footnote|}}}{{{func_footer|}}}{{#if: {{{permission|}}}| {{#if: {{{func_footnote|}}}{{{func_footer|}}}|<br/>}}Requires the {{LSLG|{{{permission}}}}} permission to run.}}{{#if: {{{negative_index|}}}| {{#if: {{{func_footnote|}}}{{{func_footer|}}}{{{permission|}}}|<br/>}}This function {{#ifeq:{{{negative_index|}}}|false| ''does not'' support | supports }} {{LSLGC|Negative Index|negative indexes}}.}}
|p1_name={{{p1_name|}}}|p1_type={{{p1_type|}}}|p1_desc={{{p1_desc|}}}
|p2_name={{{p2_name|}}}|p2_type={{{p2_type|}}}|p2_desc={{{p2_desc|}}}
|p3_name={{{p3_name|}}}|p3_type={{{p3_type|}}}|p3_desc={{{p3_desc|}}}
|p4_name={{{p4_name|}}}|p4_type={{{p4_type|}}}|p4_desc={{{p4_desc|}}}
|p5_name={{{p5_name|}}}|p5_type={{{p5_type|}}}|p5_desc={{{p5_desc|}}}
|p6_name={{{p6_name|}}}|p6_type={{{p6_type|}}}|p6_desc={{{p6_desc|}}}
|p7_name={{{p7_name|}}}|p7_type={{{p7_type|}}}|p7_desc={{{p7_desc|}}}
|p8_name={{{p8_name|}}}|p8_type={{{p8_type|}}}|p8_desc={{{p8_desc|}}}
|p9_name={{{p9_name|}}}|p9_type={{{p9_type|}}}|p9_desc={{{p9_desc|}}}
|p10_name={{{p10_name|}}}|p10_type={{{p10_type|}}}|p10_desc={{{p10_desc|}}}
|p11_name={{{p11_name|}}}|p11_type={{{p11_type|}}}|p11_desc={{{p11_desc|}}}
|p12_name={{{p12_name|}}}|p12_type={{{p12_type|}}}|p12_desc={{{p12_desc|}}}}}
|header_title=Function: {{LSL_Generic/Title
|return_type={{{return_type|}}}
|name={{{func}}}
|return_end=;
|template=LSLG
|p1_name={{{p1_name|}}}|p1_type={{{p1_type|}}}
|p2_name={{{p2_name|}}}|p2_type={{{p2_type|}}}
|p3_name={{{p3_name|}}}|p3_type={{{p3_type|}}}
|p4_name={{{p4_name|}}}|p4_type={{{p4_type|}}}
|p5_name={{{p5_name|}}}|p5_type={{{p5_type|}}}
|p6_name={{{p6_name|}}}|p6_type={{{p6_type|}}}
|p7_name={{{p7_name|}}}|p7_type={{{p7_type|}}}
|p8_name={{{p8_name|}}}|p8_type={{{p8_type|}}}
|p9_name={{{p9_name|}}}|p9_type={{{p9_type|}}}
|p10_name={{{p10_name|}}}|p10_type={{{p10_type|}}}
|p11_name={{{p11_name|}}}|p11_type={{{p11_type|}}}
|p12_name={{{p12_name|}}}|p12_type={{{p12_type|}}}}}
|deprecated={{{deprecated|}}}{{{depreciated|}}}
|constants_nb={{{constants|}}}
|spec={{{spec|}}}
|caveats={{{caveats|}}}{{#if: {{{permission|}}}|
* If the script lacks the permission {{LSLG|{{{permission}}}}}, the script shout an error on {{LSLG|DEBUG_CHANNEL}} and the operation fails (but the script continues to run).}}
|examples={{{examples|}}}
|helpers={{{helpers|}}}
|also_header={{{also_header|}}}
|also_tests={{{also_tests|}}}
|also_events={{{also_events|}}}{{#if: {{{permission|}}}|
* {{LSLG|run_time_permissions}}
}}
|also_functions={{{also_functions|}}}{{#if: {{{permission|}}}|
* {{LSLG|llGetPermissions}}
* {{LSLG|llRequestPermissions}}
}}
|also_articles={{{also_articles|}}}{{#if: {{{permission|}}}|
* {{LSLG|Script permissions}}
}}{{#ifeq: {{{negative_index|}}}|true|
* {{LSLGC|Negative Index}}
}}
|also_footer={{{also_footer|}}}
|notes={{{notes|}}}
|mode={{{mode|}}}
|self={{{self|}}}
|type=function
|template=LSLG
|footer={{#ifeq:{{{mode|}}}|request||{{#if:{{{no_footer|}}}||:<div style="font-size:x-small;">This page is based on information gathered from the Second Life client {{HoverText|source|'linden\indra\lscript\lscript_library\lscript_library.cpp'}}, and as such has additional [http://secondlife.com/developers/opensource/licenses licensing restrictions].</div>}}}}
}}{{#if:{{{self|}}}|| {{#if:{{{examples|}}}||{{LSLC|Needs Example|{{{sort|}}}}}}} {{#ifeq:{{{mode|}}}|request|| {{LSLC|Functions|{{{sort|}}}}} {{#if: {{{permission|}}}|{{LSLC|Requires Permissions|{{{sort|}}}}}}} {{#ifeq:{{{negative_index|}}}|true|{{LSLC|Negative Index|{{{sort|}}}}}}}}} {{#if:{{{cat1|}}}|{{LSLC|{{{cat1}}}|{{{sort|}}}}}}} {{#if:{{{cat2|}}}|{{LSLC|{{{cat2}}}|{{{sort|}}}}}}} {{#if:{{{cat3|}}}|{{LSLC|{{{cat3}}}|{{{sort|}}}}}}} {{#if:{{{cat4|}}}|{{LSLC|{{{cat4}}}|{{{sort|}}}}}}} {{#if:{{{cat5|}}}|{{LSLC|{{{cat5}}}|{{{sort|}}}}}}} {{#if:{{{cat6|}}}|{{LSLC|{{{cat6}}}|{{{sort|}}}}}}} }}</includeonly>

Revision as of 17:39, 10 February 2007

{{LSL_Function
|func
|func_id
|func_sleep
|func_desc
|func_footnote
|return_type
|return_text
|p1_type|p1_name|p1_desc
|p2_type|p2_name|p2_desc
|p3_type|p3_name|p3_desc
|p4_type|p4_name|p4_desc
|p5_type|p5_name|p5_desc
|p6_type|p6_name|p6_desc
|p7_type|p7_name|p7_desc
|p8_type|p8_name|p8_desc
|p9_type|p9_name|p9_desc
|p10_type|p10_name|p10_desc
|p11_type|p11_name|p11_desc
|p12_type|p12_name|p12_desc
|constants
|spec
|caveats
|examples
|helpers
|also_header
|also_functions
|also_tests
|also_articles
|also_footer
|notes
|mode
|deprecated
|permission
|negative_index
|cat1
|cat2
|cat3
|cat4
|cat5
|cat6
|sort
}}

The LSL_Function template is a intermediate template for LSL_Generic, which handles the formating for both functions and events (LSL_Event is also an intermediate template). The main job of this template is to change the parameter, names & setup the right-side floater and set the additional copyright message. Also makes permission requirements a part of the template.

parameter desc example
func Function name
func_id Function ID 1.0
func_sleep Delay 0.0
func_energy Energy 10.0
func_desc Function description text. Gives the monkey a banana
func_footnote Function footnote (appears after the parameters text). Has the side effect of causing the avatar to run in circles shouting like on fire.
return_type return type integer
return_text "Returns a return_type return_text" in most cases return_text can be used instead of func_desc. that is a monkey
p1_type first parameter type
p1_name first parameter name
p1_desc first parameter desc
p2_type second parameter type
p2_name second parameter name
p2_desc second parameter desc
...
p12_type twelfth parameter type
p12_name twelfth parameter name
p12_desc twelfth parameter desc
constants constants area, no box, please use a table for this section.
spec spec box
caveats caveats box
examples examples box
helpers helper functions box
also_header also header
also_functions also functions indent
also_articles also articles indent
also_tests also tests indent
also_footer also footer
notes notes box
mode if mode equals 'god' then it is tagged as requiring godmode. if set to 'request' marks the page as a feature request.
deprecated Marks the function as deprecated. Set the value to the replacement functions name or 'none'. If it is not set to none and it is infact set, it will include a link to the replacement function.
permission Set to the PERMISSION_* flag that the function requires. It will amend the appropriate fields to show this requirement (without all the haste of doing it yourself) PERMISSION_CHANGE_LINKS
negative_index 'true', 'false' or nothing. If set to true or false then it amends the appropriate fields so that the function is marked as supporting or not supporting negative indexes. true
self Special field that you only set if you don't want the function to be included in any categories.
cat1 An LSL specific category and sets the proper sort. (example would add the function to the "LSL Stub" category) Stub
cat2 "
cat3 "
cat4 "
cat5 "
cat6 "
sort not required but used to specify the sort order, if excluded the wiki will calculate this value for you.