mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Fixed a bug where Items would be deleted when exiting the booklet
Fixes https://github.com/Ellpeck/ActuallyAdditions/issues/21
This commit is contained in:
parent
5344daae1e
commit
33a5480e27
3 changed files with 6 additions and 14 deletions
|
@ -324,7 +324,6 @@ public class BookletUtils{
|
||||||
booklet.buttonForward.visible = getNextPage(chapter, booklet.currentPage) != null;
|
booklet.buttonForward.visible = getNextPage(chapter, booklet.currentPage) != null;
|
||||||
booklet.buttonBackward.visible = getPrevPage(chapter, booklet.currentPage) != null;
|
booklet.buttonBackward.visible = getPrevPage(chapter, booklet.currentPage) != null;
|
||||||
booklet.buttonPreviousScreen.visible = true;
|
booklet.buttonPreviousScreen.visible = true;
|
||||||
booklet.buttonPreviouslyOpenedGui.visible = booklet.parentScreen != null;
|
|
||||||
|
|
||||||
for(GuiButton chapterButton : booklet.chapterButtons){
|
for(GuiButton chapterButton : booklet.chapterButtons){
|
||||||
chapterButton.visible = false;
|
chapterButton.visible = false;
|
||||||
|
@ -368,7 +367,6 @@ public class BookletUtils{
|
||||||
booklet.buttonPreviousScreen.visible = entry != null;
|
booklet.buttonPreviousScreen.visible = entry != null;
|
||||||
booklet.buttonForward.visible = booklet.pageOpenInIndex < booklet.indexPageAmount;
|
booklet.buttonForward.visible = booklet.pageOpenInIndex < booklet.indexPageAmount;
|
||||||
booklet.buttonBackward.visible = booklet.pageOpenInIndex > 1;
|
booklet.buttonBackward.visible = booklet.pageOpenInIndex > 1;
|
||||||
booklet.buttonPreviouslyOpenedGui.visible = booklet.parentScreen != null;
|
|
||||||
|
|
||||||
for(int i = 0; i < booklet.chapterButtons.length; i++){
|
for(int i = 0; i < booklet.chapterButtons.length; i++){
|
||||||
IndexButton button = (IndexButton)booklet.chapterButtons[i];
|
IndexButton button = (IndexButton)booklet.chapterButtons[i];
|
||||||
|
|
|
@ -26,6 +26,7 @@ import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -56,7 +57,6 @@ public class GuiBooklet extends GuiScreen{
|
||||||
public GuiButton buttonForward;
|
public GuiButton buttonForward;
|
||||||
public GuiButton buttonBackward;
|
public GuiButton buttonBackward;
|
||||||
public GuiButton buttonPreviousScreen;
|
public GuiButton buttonPreviousScreen;
|
||||||
public GuiButton buttonPreviouslyOpenedGui;
|
|
||||||
public GuiButton buttonUpdate;
|
public GuiButton buttonUpdate;
|
||||||
public GuiButton buttonTwitter;
|
public GuiButton buttonTwitter;
|
||||||
public GuiButton buttonForum;
|
public GuiButton buttonForum;
|
||||||
|
@ -143,7 +143,10 @@ public class GuiBooklet extends GuiScreen{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void keyTyped(char theChar, int key){
|
public void keyTyped(char theChar, int key){
|
||||||
if(key != 1 && this.searchField.isFocused()){
|
if(key == Keyboard.KEY_ESCAPE && this.parentScreen != null){
|
||||||
|
this.mc.displayGuiScreen(this.parentScreen);
|
||||||
|
}
|
||||||
|
else if(this.searchField.isFocused()){
|
||||||
this.searchField.textboxKeyTyped(theChar, key);
|
this.searchField.textboxKeyTyped(theChar, key);
|
||||||
BookletUtils.updateSearchBar(this);
|
BookletUtils.updateSearchBar(this);
|
||||||
}
|
}
|
||||||
|
@ -164,14 +167,8 @@ public class GuiBooklet extends GuiScreen{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button){
|
public void actionPerformed(GuiButton button){
|
||||||
//Handles going to the parent GUI
|
|
||||||
if(button == this.buttonPreviouslyOpenedGui){
|
|
||||||
if(this.parentScreen != null){
|
|
||||||
mc.displayGuiScreen(this.parentScreen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Handles update
|
//Handles update
|
||||||
else if(button == this.buttonUpdate){
|
if(button == this.buttonUpdate){
|
||||||
if(UpdateChecker.needsUpdateNotify){
|
if(UpdateChecker.needsUpdateNotify){
|
||||||
BookletUtils.openBrowser(UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK);
|
BookletUtils.openBrowser(UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK);
|
||||||
}
|
}
|
||||||
|
@ -231,9 +228,6 @@ public class GuiBooklet extends GuiScreen{
|
||||||
this.buttonPreviousScreen = new BookletUtils.TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+1, 182, 0, 15, 10);
|
this.buttonPreviousScreen = new BookletUtils.TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+1, 182, 0, 15, 10);
|
||||||
this.buttonList.add(this.buttonPreviousScreen);
|
this.buttonList.add(this.buttonPreviousScreen);
|
||||||
|
|
||||||
this.buttonPreviouslyOpenedGui = new BookletUtils.TexturedButton(3, this.guiLeft-4, this.guiTop+this.ySize+15, 245, 44, 11, 15);
|
|
||||||
this.buttonList.add(this.buttonPreviouslyOpenedGui);
|
|
||||||
|
|
||||||
this.buttonUpdate = new BookletUtils.TexturedButton(4, this.guiLeft-11, this.guiTop-11, 245, 0, 11, 11);
|
this.buttonUpdate = new BookletUtils.TexturedButton(4, this.guiLeft-11, this.guiTop-11, 245, 0, 11, 11);
|
||||||
this.buttonUpdate.visible = UpdateChecker.needsUpdateNotify;
|
this.buttonUpdate.visible = UpdateChecker.needsUpdateNotify;
|
||||||
this.buttonList.add(this.buttonUpdate);
|
this.buttonList.add(this.buttonUpdate);
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Loading…
Reference in a new issue