mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
Made Booklet closable with Inventory key
This commit is contained in:
parent
32a42643c9
commit
d574ce7fd4
1 changed files with 9 additions and 4 deletions
|
@ -168,10 +168,16 @@ public class GuiBooklet extends GuiScreen{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void keyTyped(char theChar, int key){
|
public void keyTyped(char theChar, int key){
|
||||||
if(key == Keyboard.KEY_ESCAPE && this.parentScreen != null){
|
if(key == Keyboard.KEY_ESCAPE || key == Minecraft.getMinecraft().gameSettings.keyBindInventory.getKeyCode()){
|
||||||
|
if(this.parentScreen != null){
|
||||||
this.mc.displayGuiScreen(this.parentScreen);
|
this.mc.displayGuiScreen(this.parentScreen);
|
||||||
}
|
}
|
||||||
else if(this.searchField.isFocused() && key != Keyboard.KEY_ESCAPE){
|
else{
|
||||||
|
this.mc.displayGuiScreen(null);
|
||||||
|
this.mc.setIngameFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(this.searchField.isFocused()){
|
||||||
this.searchField.textboxKeyTyped(theChar, key);
|
this.searchField.textboxKeyTyped(theChar, key);
|
||||||
BookletUtils.updateSearchBar(this);
|
BookletUtils.updateSearchBar(this);
|
||||||
}
|
}
|
||||||
|
@ -188,7 +194,6 @@ public class GuiBooklet extends GuiScreen{
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.hisNameIsAt = 0;
|
this.hisNameIsAt = 0;
|
||||||
super.keyTyped(theChar, key);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue