Template:LuaCallin: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
m flerp
Flozi (talk | contribs)
tweak to new API named params
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{API|{{{addon}}}|{{{:}}}|{{{name}}}|{{{params}}}|{{{return: }}}|{{{return}}}|{{{description}}}}}</includeonly><noinclude>'''Lua Callin example:''' <pre>{{luacallin|wudget|name|param_list|return_list|description}}</pre>
<includeonly>{{API
|prefix = addon.
|name = {{{name}}}
|args = {{{args|}}}
|return = {{{return|}}}
|info = {{{info}}}}}</includeonly><noinclude>==Lua Callin usage example==


<span style="color:#cccccc;text-shadow: #111 2px 2px 2px;">gadget:'''AllowUnitCreation'''</span>  
<pre>
 
{{LuaCallin
<span style="color:#00ff88"><pre>( number unitDefID, number builderID, number builderTeam,  
|name = AllowUnitTransfer
number x, number y, number z,
|args = unitID, unitDefID, oldTeam, newTeam, capture
number facing )</pre></span>
|return = {{type|bool}} allow  
 
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
<span style="color:#ffff88">return: bool allow</span>
}}</pre>
 
Called just before unit is created, the boolean return value determines whether or not the creation is permitted.
<hr/>


{{LuaCallin
{{LuaCallin
|addon = gadget
|name = AllowUnitTransfer
|name = AllowUnitCreation
|args = unitID, unitDefID, oldTeam, newTeam, capture
|params = number unitDefID, number builderID, number builderTeam,
|return = {{type|bool}} allow  
number x, number y, number z,  
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
number facing
}}</noinclude>
|return = bool allow
|description = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.}}
</noinclude>

Latest revision as of 14:42, 18 June 2016

Lua Callin usage example

{{LuaCallin
|name = AllowUnitTransfer
|args = unitID, unitDefID, oldTeam, newTeam, capture
|return = {{type|bool}} allow 
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
}}

addon.AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture)
return: bool allow

Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.