mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-26 05:28:33 +01:00
Merge pull request #93 from dannydjdk/main
Item Terminal Tab Order and Right Clicking
This commit is contained in:
commit
f8b618a1d2
1 changed files with 12 additions and 5 deletions
|
@ -59,6 +59,13 @@ public class ItemTerminalGui extends ContainerScreen<ItemTerminalContainer> {
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
|
this.search = this.addButton(new TextFieldWidget(this.font, this.guiLeft + this.getXOffset() + 97, this.guiTop + 6, 86, 8, new StringTextComponent("")));
|
||||||
|
this.search.setEnableBackgroundDrawing(false);
|
||||||
|
this.lastSearchText = "";
|
||||||
|
if (this.items != null)
|
||||||
|
this.updateWidgets();
|
||||||
|
|
||||||
this.plusButton = this.addButton(new Button(this.guiLeft + this.getXOffset() + 95 - 7 + 12, this.guiTop + 103, 12, 12, new StringTextComponent("+"), button -> {
|
this.plusButton = this.addButton(new Button(this.guiLeft + this.getXOffset() + 95 - 7 + 12, this.guiTop + 103, 12, 12, new StringTextComponent("+"), button -> {
|
||||||
int modifier = requestModifier();
|
int modifier = requestModifier();
|
||||||
if (modifier > 1 && this.requestAmount == 1) {
|
if (modifier > 1 && this.requestAmount == 1) {
|
||||||
|
@ -109,11 +116,6 @@ public class ItemTerminalGui extends ContainerScreen<ItemTerminalContainer> {
|
||||||
for (int x = 0; x < 9; x++)
|
for (int x = 0; x < 9; x++)
|
||||||
this.addButton(new ItemTerminalWidget(this.guiLeft + this.getXOffset() + 8 + x * 18, this.guiTop + 18 + y * 18, x, y, this));
|
this.addButton(new ItemTerminalWidget(this.guiLeft + this.getXOffset() + 8 + x * 18, this.guiTop + 18 + y * 18, x, y, this));
|
||||||
}
|
}
|
||||||
this.search = this.addButton(new TextFieldWidget(this.font, this.guiLeft + this.getXOffset() + 97, this.guiTop + 6, 86, 8, new StringTextComponent("")));
|
|
||||||
this.search.setEnableBackgroundDrawing(false);
|
|
||||||
this.lastSearchText = "";
|
|
||||||
if (this.items != null)
|
|
||||||
this.updateWidgets();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getXOffset() {
|
protected int getXOffset() {
|
||||||
|
@ -159,6 +161,11 @@ public class ItemTerminalGui extends ContainerScreen<ItemTerminalContainer> {
|
||||||
}
|
}
|
||||||
if (button == 0)
|
if (button == 0)
|
||||||
this.isScrolling = false;
|
this.isScrolling = false;
|
||||||
|
else if (button == 1 && mouseX >= this.search.x && mouseX <= this.search.x + this.search.getWidth() && mouseY >= this.search.y && mouseY <= this.search.y + 8) {
|
||||||
|
//clear text from search field when letting go of right mouse button within search field
|
||||||
|
this.search.setText("");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return super.mouseReleased(mouseX, mouseY, button);
|
return super.mouseReleased(mouseX, mouseY, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue