world gui, ...
This commit is contained in:
parent
517e7d74f9
commit
6a6a820963
7 changed files with 87 additions and 29 deletions
|
@ -426,6 +426,7 @@ public class Game implements IThreadListener {
|
|||
private boolean cfgDirty;
|
||||
private String buffer = "";
|
||||
private boolean crashed;
|
||||
private boolean waitingForFile;
|
||||
|
||||
private final int[] tickTimes = new int[240];
|
||||
private final long[] frames = new long[240];
|
||||
|
@ -1151,6 +1152,7 @@ public class Game implements IThreadListener {
|
|||
|
||||
public void displayGuiScreen(Gui gui)
|
||||
{
|
||||
this.waitingForFile = false;
|
||||
if(this.thePlayer != null)
|
||||
this.thePlayer.setScreenClosed();
|
||||
if (this.open != null)
|
||||
|
@ -1867,8 +1869,11 @@ public class Game implements IThreadListener {
|
|||
GL11.glViewport(0, 0, x, y);
|
||||
fb_x = x;
|
||||
fb_y = y;
|
||||
if(this.open != null)
|
||||
if(this.open != null) {
|
||||
boolean flag = this.waitingForFile;
|
||||
this.displayGuiScreen(this.open);
|
||||
this.waitingForFile = flag;
|
||||
}
|
||||
if(!fullscreen) {
|
||||
xsize = x;
|
||||
ysize = y;
|
||||
|
@ -1970,8 +1975,11 @@ public class Game implements IThreadListener {
|
|||
}
|
||||
|
||||
private void redraw() {
|
||||
if(this.open != null)
|
||||
if(this.open != null) {
|
||||
boolean flag = this.waitingForFile;
|
||||
this.displayGuiScreen(this.open);
|
||||
this.waitingForFile = flag;
|
||||
}
|
||||
}
|
||||
|
||||
private void closed() {
|
||||
|
@ -3324,6 +3332,9 @@ public class Game implements IThreadListener {
|
|||
}
|
||||
|
||||
public void showDirDialog(final FileMode mode, final String title, final File def, final FileCallback callback) {
|
||||
if(this.waitingForFile)
|
||||
return;
|
||||
this.waitingForFile = true;
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
String output;
|
||||
|
@ -3375,9 +3386,12 @@ public class Game implements IThreadListener {
|
|||
return;
|
||||
Game.this.schedule(new Runnable() {
|
||||
public void run() {
|
||||
for(File file : files) {
|
||||
callback.selected(file);
|
||||
if(Game.this.waitingForFile) {
|
||||
for(File file : files) {
|
||||
callback.selected(file);
|
||||
}
|
||||
}
|
||||
Game.this.waitingForFile = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -3403,7 +3417,9 @@ public class Game implements IThreadListener {
|
|||
}
|
||||
Game.this.schedule(new Runnable() {
|
||||
public void run() {
|
||||
callback.selected(file);
|
||||
if(Game.this.waitingForFile)
|
||||
callback.selected(file);
|
||||
Game.this.waitingForFile = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue