Mass driver power fix / Bugfixes

This commit is contained in:
Anuken
2019-05-31 09:10:37 -04:00
parent 72cad1409f
commit 581782af28
4 changed files with 14 additions and 13 deletions

View File

@@ -29,12 +29,21 @@ public class FileChooser extends FloatingDialog{
private Predicate<FileHandle> filter;
private Consumer<FileHandle> selectListener;
private boolean open;
private int lastWidth = Core.graphics.getWidth(), lastHeight = Core.graphics.getHeight();
public FileChooser(String title, Predicate<FileHandle> filter, boolean open, Consumer<FileHandle> result){
super(title);
this.open = open;
this.filter = filter;
this.selectListener = result;
update(() -> {
if(Core.graphics.getWidth() != lastWidth || Core.graphics.getHeight() != lastHeight){
updateFiles(false);
lastHeight = Core.graphics.getHeight();
lastWidth = Core.graphics.getWidth();
}
});
}
private void setupWidgets(){
@@ -268,14 +277,6 @@ public class FileChooser extends FloatingDialog{
return this;
}
public void fileSelected(Consumer<FileHandle> listener){
this.selectListener = listener;
}
public interface FileHandleFilter{
boolean accept(FileHandle file);
}
public class FileHistory{
private Array<FileHandle> history = new Array<>();
private int index;