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

From Second Life Wiki
Jump to navigation Jump to search
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{LSL Header}} __NOTOC__ <noinclude>
{{LSL Header}} __NOTOC__ <noinclude>
See [[{{FULLPAGENAME}}/docs]] for additional documentation.
See [[{{FULLPAGENAME}}/docs]] for documentation.
<pre>
{{LSL_Function
|func
|func_id
|func_sleep
|func_energy
|func_desc
|func_footnote
|return_type
|return_text
|p1_type|p1_name|p1_desc|p1_hover
|p2_type|p2_name|p2_desc|p2_hover
|p3_type|p3_name|p3_desc|p3_hover
|p4_type|p4_name|p4_desc|p4_hover
|p5_type|p5_name|p5_desc|p5_hover
|p6_type|p6_name|p6_desc|p6_hover
|p7_type|p7_name|p7_desc|p7_hover
|p8_type|p8_name|p8_desc|p8_hover
|p9_type|p9_name|p9_desc|p9_hover
|p10_type|p10_name|p10_desc|p10_hover
|p11_type|p11_name|p11_desc|p11_hover
|p12_type|p12_name|p12_desc|p12_hover
|constants
|spec
|caveats
|examples
|helpers
|also_header
|also_functions
|also_tests
|also_events
|also_articles
|also_footer
|notes
|mode
|deprecated
|location
|cat1
|cat2
|cat3
|cat4
|cat5
|cat6
}}
</pre>
 
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. Also makes permission requirements a part of the template.
 
{| {{Prettytable}}
|-{{Hl2}}
!parameter
!desc
!example
|-
|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
|-
|p1_hover
|first parameter hover, if not included it defaults to p1_desc
|-
|p2_type
|second parameter type
|-
|p2_name
|second parameter name
|-
|p2_desc
|second parameter desc
|-
|p2_hover
|second parameter hover, if not included it defaults to p2_desc
|-
|...
|
|
|-
|p12_type
|twelfth parameter type
|
|-
|p12_name
|twelfth parameter name
|-
|p12_desc
|twelfth parameter desc
|-
|p12_hover
|twelfth parameter hover, if not included it defaults to p12_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_events
|also events 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.
|-
|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.
|-
|location
|optional: location box, used to say which source file it is defined in.
|-
|history
|a box for function history
|}
 
<div id="box">
{{{{FULLPAGENAME}}
|func=MyFunction
|func_id=-1
|func_sleep=100.5
|func_energy=0.0
|func_desc=A fictitious function
|func_footnote=func_footnote
|return_type=void
|return_text=(aka nadda, nothing).
|p1_type=integer|p1_name=i|p1_desc
|p2_type=float|p2_name=f|p2_desc
|p3_type=string|p3_name=s|p3_desc
|p4_type=key|p4_name=k|p4_desc
|p5_type=list|p5_name=l|p5_desc
|p6_type=vector|p6_name=v|p6_desc
|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
|location=location
|history=history
}}
</div>
</noinclude><includeonly>{{#if:{{#vardefine:sort|{{#if:{{#var:sort}}|{{#var:sort}}|{{{sort|}}}}}}}{{{{#if:{{#var:sort}}|!|LSL_Sort}}|}}}}<div id="sort" style="display:none">{{DEFAULTSORT:{{#var:sort}}}}{{#var:sort}}</div>{{#if:{{#var:nofixname}}||{{#if:{{#pos:{{lc:{{FULLPAGENAMEE}}}}|{{lc:{{{func}}}}}}}|<div id="RealTitleBanner" style="display:none"><span id="RealTitle">{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{{func}}}</span></div>}}}}{{#if:
</noinclude><includeonly>{{#if:{{#vardefine:sort|{{#if:{{#var:sort}}|{{#var:sort}}|{{{sort|}}}}}}}{{{{#if:{{#var:sort}}|!|LSL_Sort}}|}}}}<div id="sort" style="display:none">{{DEFAULTSORT:{{#var:sort}}}}{{#var:sort}}</div>{{#if:{{#var:nofixname}}||{{#if:{{#pos:{{lc:{{FULLPAGENAMEE}}}}|{{lc:{{{func}}}}}}}|<div id="RealTitleBanner" style="display:none"><span id="RealTitle">{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{{func}}}</span></div>}}}}{{#if:
{{#vardefine:history|{{{history|}}}}}
{{#vardefine:func_id|{{{func_id|}}}}}
{{#vardefine:func_id|{{{func_id|}}}}}
{{#vardefine:p_{{{p1_name|}}}_desc|{{#var:p_{{{p1_name|}}}_desc}}{{{p1_desc|}}}}}
{{#vardefine:p_{{{p1_name|}}}_desc|{{#var:p_{{{p1_name|}}}_desc}}{{{p1_desc|}}}}}
Line 290: Line 40:
{{#vardefine:also_articles|{{#var:also_articles}}
{{#vardefine:also_articles|{{#var:also_articles}}
{{{also_articles|}}}}}
{{{also_articles|}}}}}
{{#vardefine:also_library|{{#var:also_library}}
{{{also_library|}}}}}
{{#vardefine:also_footer|{{#var:also_footer}}{{{also_footer|}}}}}
{{#vardefine:also_footer|{{#var:also_footer}}{{{also_footer|}}}}}
{{#vardefine:notes|{{#var:notes}}{{{notes|}}}}}
{{#vardefine:notes|{{#var:notes}}{{{notes|}}}}}
Line 316: Line 68:
<div style="padding: 0.5em;background:#ffffff;">
<div style="padding: 0.5em;background:#ffffff;">
''(Please use 'return_text' or 'func_desc' to describe the functions actions.)''</div></div>{{#if:{{#var:self}}|| [[Category:LSL FixMe]] }} }}
''(Please use 'return_text' or 'func_desc' to describe the functions actions.)''</div></div>{{#if:{{#var:self}}|| [[Category:LSL FixMe]] }} }}
{{{!}} width="100%"
<div id="box">
<h2>Function: {{#if:{{{return_type|}}}|[[{{{return_type|}}}]]||}} [[{{{func}}}]]( {{#if:{{{p1_name|}}}{{{p1_type|}}}| [[{{{p1_type|}}}]] {{LSL Param|{{{p1_name|}}}}}{{#if:{{{p2_name|}}}{{{p2_type|}}}|, [[{{{p2_type|}}}]] {{LSL Param|{{{p2_name|}}}}}{{#if:{{{p3_name|}}}{{{p3_type|}}}|, [[{{{p3_type|}}}]] {{LSL Param|{{{p3_name|}}}}}{{#if:{{{p4_name|}}}{{{p4_type|}}}|, [[{{{p4_type|}}}]] {{LSL Param|{{{p4_name|}}}}}{{#if:{{{p5_name|}}}{{{p5_type|}}}|, [[{{{p5_type|}}}]] {{LSL Param|{{{p5_name|}}}}}{{#if:{{{p6_name|}}}{{{p6_type|}}}|, [[{{{p6_type|}}}]] {{LSL Param|{{{p6_name|}}}}}{{#if:{{{p7_name|}}}{{{p7_type|}}}|, [[{{{p7_type|}}}]] {{LSL Param|{{{p7_name|}}}}}{{#if:{{{p8_name|}}}{{{p8_type|}}}|, [[{{{p8_type|}}}]] {{LSL Param|{{{p8_name|}}}}}{{#if:{{{p9_name|}}}{{{p9_type|}}}|, [[{{{p9_type|}}}]] {{LSL Param|{{{p9_name|}}}}}{{#if:{{{p10_name|}}}{{{p10_type|}}}|, [[{{{p10_type|}}}]] {{LSL Param|{{{p10_name|}}}}}{{#if:{{{p11_name|}}}{{{p11_type|}}}|, [[{{{p11_type|}}}]] {{LSL Param|{{{p11_name|}}}}}{{#if:{{{p12_name|}}}{{{p12_type|}}}|, [[{{{p12_type|}}}]] {{LSL Param|{{{p12_name|}}}}}}}}}}}}}}}}}}}}}}}}}}}}} )<nowiki>;</nowiki></h2>
<div style="padding: 0.5em">{{#ifeq:{{#var:mode}}|user|{{#if:{{#var:floater}}|<div id="box" style="float:right;">{{#var:floater}}</div>}}|<div id="box" style="float:right;">
{{{!}} class="collapsible"
{{!}}- style="font-size:75%;"
{{!}}+
{{!}}-
{{!}}-
{{!}} valign="top" {{!}} <div id="box">
{{!}} {{HoverText|{{#var:func_id}}|The function index number.}}
<h2>Function: {{#if:{{{return_type|}}}|[[{{{return_type|}}}]]||}} [[{{{func}}}]]( {{#if:{{{p1_name|}}}{{{p1_type|}}}| [[{{{p1_type|}}}]] {{LSL Param|{{{p1_name|}}}}}{{#if:{{{p2_name|}}}{{{p2_type|}}}|, [[{{{p2_type|}}}]] {{LSL Param|{{{p2_name|}}}}}{{#if:{{{p3_name|}}}{{{p3_type|}}}|, [[{{{p3_type|}}}]] {{LSL Param|{{{p3_name|}}}}}{{#if:{{{p4_name|}}}{{{p4_type|}}}|, [[{{{p4_type|}}}]] {{LSL Param|{{{p4_name|}}}}}{{#if:{{{p5_name|}}}{{{p5_type|}}}|, [[{{{p5_type|}}}]] {{LSL Param|{{{p5_name|}}}}}{{#if:{{{p6_name|}}}{{{p6_type|}}}|, [[{{{p6_type|}}}]] {{LSL Param|{{{p6_name|}}}}}{{#if:{{{p7_name|}}}{{{p7_type|}}}|, [[{{{p7_type|}}}]] {{LSL Param|{{{p7_name|}}}}}{{#if:{{{p8_name|}}}{{{p8_type|}}}|, [[{{{p8_type|}}}]] {{LSL Param|{{{p8_name|}}}}}{{#if:{{{p9_name|}}}{{{p9_type|}}}|, [[{{{p9_type|}}}]] {{LSL Param|{{{p9_name|}}}}}{{#if:{{{p10_name|}}}{{{p10_type|}}}|, [[{{{p10_type|}}}]] {{LSL Param|{{{p10_name|}}}}}{{#if:{{{p11_name|}}}{{{p11_type|}}}|, [[{{{p11_type|}}}]] {{LSL Param|{{{p11_name|}}}}}{{#if:{{{p12_name|}}}{{{p12_type|}}}|, [[{{{p12_type|}}}]] {{LSL Param|{{{p12_name|}}}}}}}}}}}}}}}}}}}}}}}}}}}}} )<nowiki>;</nowiki></h2>
{{!}} [[LSL Function ID|Function ID]]
<div style="padding: 0.5em"><div id="box" style="float:right;"><table class="collapsible"><tr style="font-size:75%;"><th colspan="2"></tr><tr>
{{!}}-
<td> {{HoverText|{{#var:func_id}}|The function index number.}}
{{!}} {{HoverText|{{{func_sleep|}}}|The number of seconds this script will sleep after executing this function.}}
<td> [[LSL Function ID|Function ID]]
{{!}} [[LSL Delay|Delay]]
</tr><tr>
{{!}}-
<td> {{HoverText|{{{func_sleep|}}}|The number of seconds this script will sleep after executing this function.}}
{{#if:{{{func_complexity|}}}|
<td> [[LSL Delay|Delay]]
{{!}} {{HoverText|{{{func_complexity|}}}|The complexity of the function based on the parameters.}}
</tr>{{#if:{{{func_complexity|}}}|<tr>
{{!}} [[LSL Complexity|Compl.]]
<td> {{HoverText|{{{func_complexity|}}}|The complexity of the function based on the parameters.}}
{{!}}-}}
<td> [[LSL Complexity|Compl.]]
{{!}} {{HoverText|{{{func_energy|}}}|The quantity of energy consumed by this function.}}
</tr>}}<tr>
{{!}} [[Energy|Energy]]
<td> {{HoverText|{{{func_energy|}}}|The quantity of energy consumed by this function.}}
{{!}}}</div>}}
<td> [[Energy|Energy]]
</tr></table></div>
{{#if:{{#var:header_desc}}|{{#var:header_desc}}<br/>{{#if:{{{return_type|}}}|<br/>}}}}{{#if:{{{return_type|}}}| Returns {{AAn|{{{return_type|}}}}} {{#if:{{#var:return_text}}| {{#var:return_text}} }}<br/>}}
{{#if:{{#var:header_desc}}|{{#var:header_desc}}<br/>{{#if:{{{return_type|}}}|<br/>}}}}{{#if:{{{return_type|}}}| Returns {{AAn|{{{return_type|}}}}} {{#if:{{#var:return_text}}| {{#var:return_text}} }}<br/>}}
{{#if:{{{p1_name|}}}{{{p1_type|}}}|{{{!}}
{{#if:{{{p1_name|}}}{{{p1_type|}}}|{{{!}}
Line 351: Line 106:
{{#if:{{#var:header_footnote}}|<br/>
{{#if:{{#var:header_footnote}}|<br/>
{{#var:header_footnote}}}}
{{#var:header_footnote}}}}
<div style="clear:right;" ></div>
<div style="clear:right;"></div>
</div></div>
</div></div>{{#if:{{#var:spec}}|<div id="box">
{{#if:{{#var:spec}}|{{!}}-
<h2>Specification</h2>
{{!}}<div id="box">
<h2>{{#if:{{#var:T_Specification}}|{{#var:T_Specification}}|Specification}}</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:spec}}
{{#var:spec}}
</div></div>}}
</div></div>}}{{#if:{{#var:constants_nb}}{{#var:constants}}{{{constants|}}}|
{{!}}-
{{#var:constants_nb}}
{{#if:{{#var:constants_nb}}{{#var:constants}}{{{constants|}}}|
{{{constants|}}}{{#if:{{#var:constants}}|  
{{!}}{{#var:constants_nb}}{{{constants|}}}{{#if:{{#var:constants}}|  
<div id="box">
<div id="box"><h2>{{#if:{{#var:T_Constants}}|{{#var:T_Constants}}|Constants}}</h2>
<h2>Constants</h2>
{{#var:constants}}
{{#var:constants}}
</div>}}}}
</div>}}}}{{#if:{{#var:caveats}}|<div id="box">
{{!}}-
<h2>Caveats</h2>
{{#if:{{#var:caveats}}|
{{!}}<div id="box"><h2>{{#if:{{#var:T_Caveats}}|{{#var:T_Caveats}}|Caveats}}</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:caveats}}
{{#var:caveats}}
</div></div>}}
</div></div>}}{{#if:{{#if:{{#var:deprecated}}||t}}{{#var:examples}}|<div id="box">
{{!}}-
<h2>Examples</h2>
{{#if:{{#if:{{#var:deprecated}}||t}}{{#var:examples}}|
{{!}}<div id="box"><h2>{{#if:{{#var:T_Examples}}|{{#var:T_Examples}}|Examples}}</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:examples}}
{{#var:examples}}
</div></div>}}
</div></div>}}{{#if:{{#var:helpers}}|<div id="box">
{{!}}-
<h2>Useful Snippets</h2>
{{#if:{{#var:helpers}}|
{{!}}<div id="box"><h2>{{#if:{{#var:T_Useful_Snippets}}|{{#var:T_Useful_Snippets}}|Useful Snippets}}</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:helpers}}
{{#var:helpers}}
</div></div>}}
</div></div>}}{{#if:{{#var:notes}}|<div id="box">
{{!}}-
<h2>Notes</h2>
{{#if:{{#var:notes}}|
{{!}}<div id="box"><h2>{{#if:{{#var:T_Notes}}|{{#var:T_Notes}}|Notes}}</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:notes}}
{{#var:notes}}
</div></div>}}
</div></div>}}{{#if:{{#var:also_footer}}{{#var:also_functions}}{{#var:also_events}}{{#var:also_articles}}{{#var:also_tests}}{{#var:also_header}}{{#var:also_library}}|<div id="box">
{{!}}-
<h2>See Also</h2>
{{#if:{{#var:also_footer}}{{#var:also_functions}}{{#var:also_events}}{{#var:also_articles}}{{#var:also_tests}}{{#var:also_header}}|
{{!}}<div id="box"><h2>{{#if:{{#var:T_See_Also}}|{{#var:T_See Also}}|See Also}}</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#if:{{#var:also_header}}|
{{#if:{{#var:also_header}}|
{{#var:also_header}}}}{{#if:{{#var:also_events}}|
{{#var:also_header}}}}{{#if:{{#var:also_events}}|
<h3>{{#if:{{#var:T_Also_Events}}|{{#var:T_Also_Events}}|Events}}</h3>
<h3>Events</h3>
{{{!}}
{{{!}}
{{#var:also_events}}
{{#var:also_events}}
{{!}}} }}{{#if:{{#var:also_functions}}|
{{!}}} }}{{#if:{{#var:also_functions}}|
<h3>{{#if:{{#var:T_Also_Functions}}|{{#var:T_Also_Functions}}|Functions}}</h3>
<h3>Functions</h3>
{{{!}}
{{{!}}
{{#var:also_functions}}
{{#var:also_functions}}
{{!}}} }}{{#if:{{#var:also_tests}}|
{{!}}} }}{{#if:{{#var:also_tests}}|
<h3>{{#if:{{#var:T_Also_Tests}}|{{#var:T_Also_Tests}}|Tests}}</h3>
<h3>Tests</h3>
{{{!}}
{{{!}}
{{#var:also_tests}}
{{#var:also_tests}}
{{!}}} }}{{#if:{{#var:also_articles}}|
{{!}}} }}{{#if:{{#var:also_articles}}|
<h3>{{#if:{{#var:T_Also_Articles}}|{{#var:T_Also_Articles}}|Articles}}</h3>
<h3>Articles</h3>
{{{!}}
{{{!}}
{{#var:also_articles}}
{{#var:also_articles}}
{{!}}} }}{{#if:{{#var:also_library}}|
<h3>Library and Examples</h3>
{{{!}}
{{#var:also_library}}
{{!}}} }}
{{!}}} }}
{{#if:{{#var:also_footer}}|<br/>{{#var:also_footer}}}}
{{#if:{{#var:also_footer}}|<br/>{{#var:also_footer}}}}
</div></div>}}
</div></div>}}{{#if:{{#var:location}}|<div id="box">
{{!}}-
<h2>Source Location</h2>
{{#if:{{#var:location}}|
{{!}}
<div id="box">
<h2>{{#if:{{#var:T_Source_Location}}|{{#var:T_Source_Location}}|Source Location}}</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:location}}
{{#var:location}}
</div></div>}}
</div></div>}}{{#if:{{{history|}}}{{{bugs|}}}|<div id="box">
{{!}}-
<h2>History</h2>
{{#if:{{#var:history}}|
<div style="padding: 0.5em">
{{!}}
{{#if:{{{bugs|}}}|<h3>Bugs</h3>
<div id="box">
{{{!}}
<h2>{{#if:{{#var:T_History}}|{{#var:T_History}}|History}}</h2>
{{{bugs}}}
{{!}}} }}
{{{history|}}}
</div></div>}}{{#if:{{{comments|}}}|<div id="box">
<h2>Comments</h2>
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:history}}
{{{comments|}}}
</div></div>}}
</div></div>}}
{{!}}}
{{#var:footer}} {{#if:{{#var:self}}|| {{#switch:{{#var:mode}}|request|user=| [[Category:LSL Functions]] {{#if:{{#var:examples}}||[[Category:LSL Needs Example]]}}}} {{#if:{{{cat1|}}}|[[Category:LSL {{{cat1}}}]]}} {{#if:{{{cat2|}}}|[[Category:LSL {{{cat2}}}]]}} {{#if:{{{cat3|}}}|[[Category:LSL {{{cat3}}}]]}} {{#if:{{{cat4|}}}|[[Category:LSL {{{cat4}}}]]}} {{#if:{{{cat5|}}}|[[Category:LSL {{{cat5}}}]]}} {{#if:{{{cat6|}}}|[[Category:LSL {{{cat6}}}]]}} {{#if:{{{cat7|}}}|[[Category:LSL {{{cat7}}}]]}} {{#if:{{{cat8|}}}|[[Category:LSL {{{cat8}}}]]}} }}</includeonly>
{{#var:footer}} {{#if:{{#var:self}}|| {{#ifeq:{{#var:mode}}|request|| [[Category:LSL Functions]] {{#if:{{#var:examples}}||[[Category:LSL Needs Example]]}}}} {{#if:{{{cat1|}}}|[[Category:LSL {{{cat1}}}]]}} {{#if:{{{cat2|}}}|[[Category:LSL {{{cat2}}}]]}} {{#if:{{{cat3|}}}|[[Category:LSL {{{cat3}}}]]}} {{#if:{{{cat4|}}}|[[Category:LSL {{{cat4}}}]]}} {{#if:{{{cat5|}}}|[[Category:LSL {{{cat5}}}]]}} {{#if:{{{cat6|}}}|[[Category:LSL {{{cat6}}}]]}} {{#if:{{{cat7|}}}|[[Category:LSL {{{cat7}}}]]}} {{#if:{{{cat8|}}}|[[Category:LSL {{{cat8}}}]]}} }}</includeonly>

Latest revision as of 15:38, 17 December 2010