Fixes mouse handling for right-clicks to clear the search box and middle-click for crafting. (#4505)
This commit is contained in:
@@ -295,12 +295,15 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
|||||||
@Override
|
@Override
|
||||||
public boolean mouseClicked(final double xCoord, final double yCoord, final int btn) {
|
public boolean mouseClicked(final double xCoord, final double yCoord, final int btn) {
|
||||||
if (this.searchField.mouseClicked(xCoord, yCoord, btn)) {
|
if (this.searchField.mouseClicked(xCoord, yCoord, btn)) {
|
||||||
if (btn == 1 && this.searchField.isMouseOver(xCoord, yCoord)) {
|
return true;
|
||||||
this.searchField.setText("");
|
}
|
||||||
this.repo.setSearchString("");
|
|
||||||
this.repo.updateView();
|
// Right-clicking on the search field should clear it
|
||||||
this.setScrollBar();
|
if (this.searchField.isMouseOver(xCoord, yCoord) && btn == 1) {
|
||||||
}
|
this.searchField.setText("");
|
||||||
|
this.repo.setSearchString("");
|
||||||
|
this.repo.updateView();
|
||||||
|
this.setScrollBar();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,22 +58,6 @@ public class AETextField extends TextFieldWidget {
|
|||||||
this._fontPad = (int) fontRenderer.getCharWidth('_');
|
this._fontPad = (int) fontRenderer.getCharWidth('_');
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean mouseClicked(final double xPos, final double yPos, final int button) {
|
|
||||||
// super will always return false, if button is != 0, however super should still
|
|
||||||
// be called.
|
|
||||||
if (!super.mouseClicked(xPos, yPos, button) && button == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final boolean requiresFocus = this.isMouseOver(xPos, yPos);
|
|
||||||
if (!this.isFocused()) {
|
|
||||||
this.setFocused2(requiresFocus);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void selectAll() {
|
public void selectAll() {
|
||||||
this.setCursorPosition(0);
|
this.setCursorPosition(0);
|
||||||
this.setSelectionPos(this.getMaxStringLength());
|
this.setSelectionPos(this.getMaxStringLength());
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ public class ChunkLoaderTileEntity extends AEBaseTileEntity implements ITickable
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
|
super.remove();
|
||||||
|
|
||||||
World world = getWorld();
|
World world = getWorld();
|
||||||
if (world instanceof ServerWorld) {
|
if (world instanceof ServerWorld) {
|
||||||
ChunkPos chunkPos = new ChunkPos(getPos());
|
ChunkPos chunkPos = new ChunkPos(getPos());
|
||||||
|
|||||||
@@ -266,12 +266,15 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
|
|||||||
@Override
|
@Override
|
||||||
public boolean mouseClicked(final double xCoord, final double yCoord, final int btn) {
|
public boolean mouseClicked(final double xCoord, final double yCoord, final int btn) {
|
||||||
if (this.searchField.mouseClicked(xCoord, yCoord, btn)) {
|
if (this.searchField.mouseClicked(xCoord, yCoord, btn)) {
|
||||||
if (btn == 1 && this.searchField.isMouseOver(xCoord, yCoord)) {
|
return true;
|
||||||
this.searchField.setText("");
|
}
|
||||||
this.repo.setSearchString("");
|
|
||||||
this.repo.updateView();
|
// Right-clicking on the search field should clear it
|
||||||
this.setScrollBar();
|
if (this.searchField.isMouseOver(xCoord, yCoord) && btn == 1) {
|
||||||
}
|
this.searchField.setText("");
|
||||||
|
this.repo.setSearchString("");
|
||||||
|
this.repo.updateView();
|
||||||
|
this.setScrollBar();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,4 +335,5 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
|
|||||||
protected String getBackground() {
|
protected String getBackground() {
|
||||||
return "guis/terminal.png";
|
return "guis/terminal.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user