Skip to content

Commit

Permalink
Fixed visual glitch when deleting world
Browse files Browse the repository at this point in the history
  • Loading branch information
byteduck committed Feb 18, 2017
1 parent 382abbb commit 676746e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/main/java/net/codepixl/GLCraft/GUI/GUIDeleteWorld.java
Expand Up @@ -11,14 +11,16 @@
import java.util.concurrent.Callable;

public class GUIDeleteWorld extends GUIScreen{


private final GUISinglePlayer gui;
private Save save;
private GUILabel warning;
private GUIButton yes, no;

public GUIDeleteWorld(Save save){
public GUIDeleteWorld(Save save, GUISinglePlayer s){
super();
this.save = save;
this.gui = s;
}

public void makeElements(){
Expand Down Expand Up @@ -58,6 +60,7 @@ private void delete() {
e.printStackTrace();
}
}
gui.onOpen();
GUIManager.getMainManager().closeGUI(true);
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/codepixl/GLCraft/GUI/GUISinglePlayer.java
Expand Up @@ -83,12 +83,13 @@ public Void call() throws Exception {
}
});
loadWorld.setEnabled(false);


final GUISinglePlayer sthis = this;
deleteWorld = new GUIButton("Delete World", DELETEWORLDX, DELETEWORLDY, new Callable<Void>() {
@Override
public Void call() throws Exception {
if(selectedSave != null)
GUIManager.getMainManager().showGUI(new GUIDeleteWorld(selectedSave.save));
GUIManager.getMainManager().showGUI(new GUIDeleteWorld(selectedSave.save, sthis));
return null;
}
});
Expand Down

0 comments on commit 676746e

Please sign in to comment.