Close book with inventory key

This commit is contained in:
Ellpeck 2016-03-18 15:55:55 +01:00
parent 1d27f6e52d
commit 92172c0fdc

View file

@ -162,7 +162,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
@Override @Override
public void keyTyped(char theChar, int key){ public void keyTyped(char theChar, int key){
if(key == Keyboard.KEY_ESCAPE){ if(key == Keyboard.KEY_ESCAPE || (key == this.mc.gameSettings.keyBindInventory.getKeyCode() && this.hisNameIsAt <= 0 && !this.searchField.isFocused())){
if(this.parentScreen != null){ if(this.parentScreen != null){
this.mc.displayGuiScreen(this.parentScreen); this.mc.displayGuiScreen(this.parentScreen);
} }
@ -238,11 +238,11 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
} }
//Handles config //Handles config
else if(button == this.buttonConfig){ else if(button == this.buttonConfig){
mc.displayGuiScreen(new GuiConfiguration(this)); this.mc.displayGuiScreen(new GuiConfiguration(this));
} }
//Handles achievements //Handles achievements
else if(button == this.buttonAchievements){ else if(button == this.buttonAchievements){
mc.displayGuiScreen(new GuiAAAchievements(this, mc.thePlayer.getStatFileWriter())); this.mc.displayGuiScreen(new GuiAAAchievements(this, this.mc.thePlayer.getStatFileWriter()));
} }
else if(button == this.buttonForward){ else if(button == this.buttonForward){
BookletUtils.handleNextPage(this); BookletUtils.handleNextPage(this);