avoid piece to be placed when right clicking
This commit is contained in:
parent
cb54e753d7
commit
201eb3ec10
@ -54,6 +54,8 @@ public class GameUI extends Group{
|
|||||||
_piece.setLayoutY(event.getSceneY() - piece_pos_click.y);
|
_piece.setLayoutY(event.getSceneY() - piece_pos_click.y);
|
||||||
});
|
});
|
||||||
_piece.setOnMouseReleased(event -> {
|
_piece.setOnMouseReleased(event -> {
|
||||||
|
if(event.getButton() != MouseButton.PRIMARY)
|
||||||
|
return;
|
||||||
if(event.getSceneX() > grid.getLayoutX() && event.getSceneX() < grid.getLayoutX() + grid.boundary_size.x
|
if(event.getSceneX() > grid.getLayoutX() && event.getSceneX() < grid.getLayoutX() + grid.boundary_size.x
|
||||||
&& event.getSceneY() > grid.getLayoutY() && event.getSceneY() < grid.getLayoutY() + grid.boundary_size.y )
|
&& event.getSceneY() > grid.getLayoutY() && event.getSceneY() < grid.getLayoutY() + grid.boundary_size.y )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user