collinhover / impactplusplus

Impact++ is a collection of additions to ImpactJS with full featured physics, dynamic lighting, UI, abilities, and more.
http://collinhover.github.com/impactplusplus
MIT License
276 stars 59 forks source link

EntityConversation.complete() runs at init? #96

Closed arakash92 closed 11 years ago

arakash92 commented 11 years ago

I have an EntityConversation with a few messages and I'd like to run some code after all messages have been displayed.

However, the complete method runs both at init and when it's actually complete.

What's going on?

collinhover commented 11 years ago

The complete method is called by any trigger immediately after it has triggered. In the case of a conversation, it blocks the parent call in the complete until it is actually completed. This is something that should be changed, because it is confusing, but until then take a look at the conversation source code and do the same check it does in its complete method.

collinhover commented 11 years ago

FYI in the next push this will change to where anything that descends from ig.EntityTrigger can set autoComplete: false to avoid double calling the complete method. When setting autoComplete: false, it just means that the complete method will be called manually later in the trigger's process. For example, ig.EntityConversation will do this, and only call complete once the conversation is finished.

arakash92 commented 11 years ago

I see. Well thanks!