11 comments
Comment actions Permalink

Cute...

I think it should be paused when the panel is hidden.

Amnon
"Scott Sirovy" <ssirovy@deephavenfunds.com> wrote in message
news:6552073.1036530459691.JavaMail.jrun@is.intellij.net...

http://www.intellij.org/twiki/bin/view/Main/TetrisPlugin

>

Initial release -- Comments welcome.



0
Comment actions Permalink

Very nice! :)

Is it possible to change to speed?
Also it would be be nice to pause the game.

With best wishes,
Vladimir Kondratyev
_____________________
JetBrains

Scott Sirovy wrote:

http://www.intellij.org/twiki/bin/view/Main/TetrisPlugin

Initial release -- Comments welcome.


0
Comment actions Permalink

It's great, but it would be also very good to be able to change the
direction of the figure rotation.

Sergey.


0
Comment actions Permalink

Cute...

I think it should be paused when the panel is hidden.


Yes, I tried to do that. However, I couldn't find anything in the OpenAPI that would let me listen for toolWindow-is-now-hidden/unfocused/inactive events.

I also tried to check the toolWindow.isActive() and .isVisible() methods in the game thread but they didn't return true when the window was hidden. Is that a bug? (This is my first plugin so perhaps I am doing something wrong.)

I'd appreciate any insight you (or anyone) can offer!

-sms

0
Comment actions Permalink

Very nice! :)


Thanks! It was fun writing it.

Is it possible to change to speed?


Not currently, but that is an interesting option. I assume you mean that you'd like to be able to start a new game at a certain level? Another option I've seen in other implementations is to start with a user-defined number of lines clogging up the alley. Both are things I've added to the TODO list.

Also it would be be nice to pause the game.


You can hit the 'P' key to pause the game (and un-pause later). However, I am unable to programatically pause the game when the toolwindow is hidden, as I mentioned in my post to Amnon. Perhaps you have some insight?

-sms

0
Comment actions Permalink

it would be also very good to be able to change the direction of the figure rotation.


Good point. I'll add it to the TODO list.

-sms

0
Comment actions Permalink

hi,

"Scott Sirovy" <ssirovy@deephavenfunds.com> schrieb im Newsbeitrag

I think it should be paused when the panel is hidden.

>

Yes, I tried to do that. However, I couldn't find anything in the OpenAPI that would let me listen for

toolWindow-is-now-hidden/unfocused/inactive events.
>


You can add an AncestorListener to your toolWindowContentPanel:

toolWindowContentPanel.addAncestorListener(new AncestorListener()
{
public void ancestorAdded(AncestorEvent event){}

public void ancestorRemoved(AncestorEvent event)
{
//tetris.pause();
}

public void ancestorMoved(AncestorEvent event){}
});


HTH
Martin

0
Comment actions Permalink

You can add an AncestorListener to your toolWindowContentPanel:


Excellent! That did the trick. I'll post an updated version shortly.

Thanks for the tip,

-sms

0
Comment actions Permalink

I assume we need a way for some tool windows not to show the side buttons so
you will be able to press Escape and hide the window when the boss is
coming.

Eugene

"Scott Sirovy" <ssirovy@deephavenfunds.com> wrote in message
news:6552073.1036530459691.JavaMail.jrun@is.intellij.net...

http://www.intellij.org/twiki/bin/view/Main/TetrisPlugin

>

Initial release -- Comments welcome.



0
Comment actions Permalink

Scott,

in next release we will open API to listen events from
ToolWindowManager. So it'll be possible to track visibility of tool
window. As ugly and temporary workaround I can suggest you to track
visibility by:
-tracking of addNotify/removeNotify
-tracking visibility of all parent components

Best regards,
Vladimir Kondratyev
-


JetBrains


However, I am unable to programatically pause the game when the toolwindow is hidden, as I mentioned in my post to Amnon. Perhaps you have some insight?

-sms


0
Comment actions Permalink

Version 0.2 is great!

Pacman, anyone? :)
"Scott Sirovy" <ssirovy@deephavenfunds.com> wrote in message
news:6552073.1036530459691.JavaMail.jrun@is.intellij.net...

http://www.intellij.org/twiki/bin/view/Main/TetrisPlugin

>

Initial release -- Comments welcome.



0

Please sign in to leave a comment.