Fixes #108 "Right click in grid search field should clear contents of field"
This commit is contained in:
@@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
### 0.7.11
|
### 0.7.11
|
||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
- Fixed crash using wireless grid
|
- Fixed crash with wireless grid
|
||||||
|
|
||||||
|
**Features**
|
||||||
|
- Right click on grid search bar clears the search query
|
||||||
|
|
||||||
### 0.7.10
|
### 0.7.10
|
||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
|
@@ -316,6 +316,13 @@ public class GuiGrid extends GuiBase {
|
|||||||
|
|
||||||
searchField.mouseClicked(mouseX, mouseY, clickedButton);
|
searchField.mouseClicked(mouseX, mouseY, clickedButton);
|
||||||
|
|
||||||
|
if (clickedButton == 1 && inBounds(79, 5, 90, 12, mouseX - guiLeft, mouseY - guiTop)) {
|
||||||
|
searchField.setText("");
|
||||||
|
searchField.setFocused(true);
|
||||||
|
|
||||||
|
updateJEI();
|
||||||
|
}
|
||||||
|
|
||||||
boolean clickedClear = clickedButton == 0 && isHoveringOverClear(mouseX - guiLeft, mouseY - guiTop);
|
boolean clickedClear = clickedButton == 0 && isHoveringOverClear(mouseX - guiLeft, mouseY - guiTop);
|
||||||
boolean clickedCreatePattern = clickedButton == 0 && isHoveringOverCreatePattern(mouseX - guiLeft, mouseY - guiTop);
|
boolean clickedCreatePattern = clickedButton == 0 && isHoveringOverCreatePattern(mouseX - guiLeft, mouseY - guiTop);
|
||||||
|
|
||||||
@@ -377,14 +384,18 @@ public class GuiGrid extends GuiBase {
|
|||||||
@Override
|
@Override
|
||||||
protected void keyTyped(char character, int keyCode) throws IOException {
|
protected void keyTyped(char character, int keyCode) throws IOException {
|
||||||
if (!checkHotbarKeys(keyCode) && searchField.textboxKeyTyped(character, keyCode)) {
|
if (!checkHotbarKeys(keyCode) && searchField.textboxKeyTyped(character, keyCode)) {
|
||||||
if (RefinedStorage.hasJei() && (grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED || grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED)) {
|
updateJEI();
|
||||||
RefinedStorageJEIPlugin.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
super.keyTyped(character, keyCode);
|
super.keyTyped(character, keyCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateJEI() {
|
||||||
|
if (RefinedStorage.hasJei() && (grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED || grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED)) {
|
||||||
|
RefinedStorageJEIPlugin.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getVisibleRows() {
|
public int getVisibleRows() {
|
||||||
return (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 4 : 5;
|
return (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 4 : 5;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user