Fixes mouse handling for right-clicks to clear the search box and middle-click for crafting. (#4505)

This commit is contained in:
shartte
2020-07-26 16:30:53 +02:00
committed by GitHub
parent 774f88ee90
commit 59e40ccbd9
4 changed files with 21 additions and 28 deletions
@@ -266,12 +266,15 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
@Override
public boolean mouseClicked(final double xCoord, final double yCoord, final int btn) {
if (this.searchField.mouseClicked(xCoord, yCoord, btn)) {
if (btn == 1 && this.searchField.isMouseOver(xCoord, yCoord)) {
this.searchField.setText("");
this.repo.setSearchString("");
this.repo.updateView();
this.setScrollBar();
}
return true;
}
// Right-clicking on the search field should clear it
if (this.searchField.isMouseOver(xCoord, yCoord) && btn == 1) {
this.searchField.setText("");
this.repo.setSearchString("");
this.repo.updateView();
this.setScrollBar();
return true;
}
@@ -332,4 +335,5 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
protected String getBackground() {
return "guis/terminal.png";
}
}