Deleting a block in the editor by right-clicking (#2021)

* Deleting a block in the editor by right-clicking

* Small fix

Co-authored-by: Anuken <arnukren@gmail.com>

Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
Summet
2020-05-10 17:44:54 +03:00
committed by GitHub
parent dabc891791
commit c62a87e81a

View File

@@ -72,9 +72,14 @@ public class MapView extends Element implements GestureListener{
return false;
}
if(!mobile && button != KeyCode.mouseLeft && button != KeyCode.mouseMiddle){
if(!mobile && button != KeyCode.mouseLeft && button != KeyCode.mouseMiddle && button != KeyCode.mouseRight){
return true;
}
if(button == KeyCode.mouseRight){
lastTool = tool;
tool = EditorTool.eraser;
}
if(button == KeyCode.mouseMiddle){
lastTool = tool;
@@ -102,7 +107,7 @@ public class MapView extends Element implements GestureListener{
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){
if(!mobile && button != KeyCode.mouseLeft && button != KeyCode.mouseMiddle){
if(!mobile && button != KeyCode.mouseLeft && button != KeyCode.mouseMiddle && button != KeyCode.mouseRight){
return;
}
@@ -117,7 +122,7 @@ public class MapView extends Element implements GestureListener{
editor.flushOp();
if(button == KeyCode.mouseMiddle && lastTool != null){
if((button == KeyCode.mouseMiddle || button == KeyCode.mouseRight) && lastTool != null){
tool = lastTool;
lastTool = null;
}