[messages] [Developers] Re: [Developers] Re: [Developers] Re: question ab

Michael Kiefte mkiefte at dal.ca
Thu Jul 29 14:49:14 MST 2010


>
> What do you mean by a "Trigger does all the inner traits first"?  Do you
> mean that if a keystroke is hit that a Trigger is listening to, then the
> trigger first sends that keystroke to all inner traits, then processes
> the keystroke itself, and then the keystroke is sent to traits below the
> Trigger?  If that is what you mean, then that would seem to contradict
> the fact that triggers "always go last".  So I guess that probably means
> that I don't understand what you mean by "does all the inner traits
> first"...
>

I think I see where you misunderstand.

If a trigger is listening for a keystroke, it will let all the inner (i.e.,
higher) traits respond to the key first.  It will then do the keystrokes
it's asked to do afterwards.  That is what I mean by triggers always go
last.

For example, a trigger is asked to respond to SHIFT-A and, in response, it
sends SHIFT-B.  When it receives SHIFT-A, all the the inner traits respond
to it before the trigger does SHIFT-B.


>
> Case 1) keystroke came from outside the piece.
> In this case, all traits listening for the keystroke execute in order,
> starting with the bottom of the trait list working backwards up to the
> top, with the exception being trigger actions which are always executed
> last (in presumably the same order--i.e. bottom to top).
>

Correct, except for the trigger part.  Triggered keystrokes are done from
top downwards -- the opposite of the usual.


>
> Case 2) keystroke came from a trait within the piece.
> Case 2a) keystroke came from a trigger
> In this case, all traits listening for the keystroke execute in order,
> starting from the one above the trigger working backwards to the top,
>

Trigger properties are activated from the top down -- i.e., after all the
non-trigger traits have done their thing, the triggers then respond to the
event one at a time from the top downward.  When they fire their keystrokes,
they affect the game piece in exactly the same way as if you had done it
externally.



> then the trigger sends its keystrokes and those are resolved, and then
> all traits below the trigger are executed working backwards from the
> bottom up to 1 below the trigger.
> Case 2b) keystroke came from another trait, not a trigger (e.g. an
> action button)
> In this case, the traits are executed in the same order as Case 1.
>

That sounds right.

P.S.  If you reply by clicking on the little icon on the top-right
> corner of a post, your replies will be half the size.


I'm not even using the forum.

- M.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vassalengine.org/pipermail/messages/attachments/20100729/ddea3ace/attachment.html>


More information about the messages mailing list