Scripting order question


We’ve stumbled across a set of bugs in our code that I believe may be rooted to a fundamental misunderstanding on our part of Panda’s messenger. Let me give a scenario and see if anyone can help clarify what to expect from the engine. We would test it ourselves, but I’m afraid we don’t currently have the resources to do so.

Say that I create, for example, a drag operation state machine that lets me pick something up and then put it down. So it responds to mouse1 and mouse1-up. Now for reasons I won’t go into right this second (trust me, long story)… I used self.accept(“mouse1-up”) instead of self.acceptOnce(“mouse1-up”). But in the handler code for the message, I do self.ignore(“mouse1-up”).

My question is this: Say the user’s computer drops several seconds of frames, long enough for them to get a double-click in on essentially one frame. So the mouse event queue now contains mouse1-up, mouse1, mouse1-up to be processed this frame. The mouse1-up is processed, which triggers our code that releases the dragged object and then does self.ignore(“mouse1-up”). Then the mouse1 runs, then the second mouse1-up runs. Now at this point, we’ve requested the engine ignore mouse1-up. Will our mouse1-up handler get run anyway (i.e. does the ignore call go into effect on the next frame)? Or should we expect our mouse1-up code to get called twice in this frame, even though we asked that the message be ignored after the first call?

In completely unrelated news, I’m giving a short instructional talk to some high-school students at a video game design camp in a few weeks. Given the success we’ve had with this engine, I’m going to make sure to point them towards the website, so hopefully we’ll see some new faces next month!

Thank you very much for your help!

Take care,

When you ignore mouse1-up, the ignore operation takes place immediately. So you will not receive the second mouse1-up event.