Allow* callin order

Allow* callin order

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Allow* callin order

Post by Beherith »

What happens if there are multiple Allow[Command,Buildstep,etc] callins in different gadgets? Are they all called and if any one returns false then the the action is canceled? What order are they called in (layer = N)?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Allow* callin order

Post by jK »

open gadgets.lua and read
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Allow* callin order

Post by Beherith »

Found it!

The gadgets are called in the order of lowers layer number first. On the first false return, no more are called, and the command returns false.
Post Reply

Return to “Lua Scripts”