v1.2.0: adjusted default functionality for right and middle clicks

This commit is contained in:
Evan Debenham
2022-02-17 11:46:34 -05:00
parent 36987fbdc9
commit aa43adf833
2 changed files with 7 additions and 15 deletions

View File

@@ -144,12 +144,8 @@ public class Button extends Component {
protected void onPointerDown() {}
protected void onPointerUp() {}
protected void onClick() {} //left click, default key type
protected void onRightClick() {
onClick();
}
protected void onMiddleClick() {
onClick();
}
protected void onRightClick() {}
protected void onMiddleClick() {}
protected boolean onLongClick() {
return false;
}

View File

@@ -498,9 +498,8 @@ public class InventoryPane extends Component {
if (targeting){
if (targetingSlot == this){
onClick();
} else{
cancelTargeting();
}
return;
}
if (selector == null && item.defaultAction != null){
@@ -510,7 +509,7 @@ public class InventoryPane extends Component {
InventoryPane.useTargeting();
}
} else {
super.onMiddleClick();
onClick();
}
}
@@ -522,11 +521,8 @@ public class InventoryPane extends Component {
}
if (targeting){
if (targetingSlot == this){
onClick();
} else{
cancelTargeting();
}
//do nothing
return;
}
if (selector == null){
@@ -537,7 +533,7 @@ public class InventoryPane extends Component {
mousePos = camera.screenToCamera((int)mousePos.x, (int)mousePos.y);
r.setPos(mousePos.x-3, mousePos.y-3);
} else {
super.onRightClick();
//do nothing
}
}
}