Bugfixes
This commit is contained in:
@@ -18,7 +18,7 @@ import java.util.*;
|
|||||||
import static io.anuke.mindustry.Vars.platform;
|
import static io.anuke.mindustry.Vars.platform;
|
||||||
|
|
||||||
public class FileChooser extends FloatingDialog{
|
public class FileChooser extends FloatingDialog{
|
||||||
private static final FileHandle homeDirectory = Core.files.absolute(OS.isMac ? OS.getProperty("user.home") + "/Downloads/" : Core.files.getExternalStoragePath());
|
private static final FileHandle homeDirectory = Core.files.absolute(Core.files.getExternalStoragePath());
|
||||||
private static FileHandle lastDirectory = homeDirectory;
|
private static FileHandle lastDirectory = homeDirectory;
|
||||||
|
|
||||||
private Table files;
|
private Table files;
|
||||||
@@ -98,10 +98,6 @@ public class FileChooser extends FloatingDialog{
|
|||||||
updateFiles(true);
|
updateFiles(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
//Macs are confined to the Downloads/ directory
|
|
||||||
if(OS.isMac){
|
|
||||||
up.setDisabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageButton back = new ImageButton(Icon.arrowLeft);
|
ImageButton back = new ImageButton(Icon.arrowLeft);
|
||||||
ImageButton forward = new ImageButton(Icon.arrowRight);
|
ImageButton forward = new ImageButton(Icon.arrowRight);
|
||||||
@@ -171,8 +167,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
|
|
||||||
private void updateFiles(boolean push){
|
private void updateFiles(boolean push){
|
||||||
if(push) stack.push(directory);
|
if(push) stack.push(directory);
|
||||||
//if is mac, don't display extra info since you can only ever go to downloads
|
navigation.setText(directory.toString());
|
||||||
navigation.setText(OS.isMac ? directory.name() : directory.toString());
|
|
||||||
|
|
||||||
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
||||||
|
|
||||||
@@ -190,23 +185,21 @@ public class FileChooser extends FloatingDialog{
|
|||||||
files.top().left();
|
files.top().left();
|
||||||
FileHandle[] names = getFileNames();
|
FileHandle[] names = getFileNames();
|
||||||
|
|
||||||
//macs are confined to the Downloads/ directory
|
Image upimage = new Image(Icon.folderParentSmall);
|
||||||
if(!OS.isMac){
|
TextButton upbutton = new TextButton(".." + directory.toString(), Styles.clearTogglet);
|
||||||
Image upimage = new Image(Icon.folderParentSmall);
|
upbutton.clicked(() -> {
|
||||||
TextButton upbutton = new TextButton(".." + directory.toString(), Styles.clearTogglet);
|
directory = directory.parent();
|
||||||
upbutton.clicked(() -> {
|
lastDirectory = directory;
|
||||||
directory = directory.parent();
|
updateFiles(true);
|
||||||
lastDirectory = directory;
|
});
|
||||||
updateFiles(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
upbutton.left().add(upimage).padRight(4f).padLeft(4);
|
upbutton.left().add(upimage).padRight(4f).padLeft(4);
|
||||||
upbutton.getLabel().setAlignment(Align.left);
|
upbutton.getLabel().setAlignment(Align.left);
|
||||||
upbutton.getCells().reverse();
|
upbutton.getCells().reverse();
|
||||||
|
|
||||||
|
files.add(upbutton).align(Align.topLeft).fillX().expandX().height(50).pad(2).colspan(2);
|
||||||
|
files.row();
|
||||||
|
|
||||||
files.add(upbutton).align(Align.topLeft).fillX().expandX().height(50).pad(2).colspan(2);
|
|
||||||
files.row();
|
|
||||||
}
|
|
||||||
|
|
||||||
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
||||||
group.setMinCheckCount(0);
|
group.setMinCheckCount(0);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class ModsDialog extends FloatingDialog{
|
|||||||
void modError(Throwable error){
|
void modError(Throwable error){
|
||||||
ui.loadfrag.hide();
|
ui.loadfrag.hide();
|
||||||
|
|
||||||
if(Strings.getCauses(error).contains(t -> t.getMessage() != null && t.getMessage().contains("SSL"))){
|
if(Strings.getCauses(error).contains(t -> t.getMessage() != null && (t.getMessage().contains("SSL") || t.getMessage().contains("protocol")))){
|
||||||
ui.showErrorMessage("$feature.unsupported");
|
ui.showErrorMessage("$feature.unsupported");
|
||||||
}else{
|
}else{
|
||||||
ui.showException(error);
|
ui.showException(error);
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ public class DesktopLauncher extends ClientLauncher{
|
|||||||
Cons<Runnable> dialog = Runnable::run;
|
Cons<Runnable> dialog = Runnable::run;
|
||||||
boolean badGPU = false;
|
boolean badGPU = false;
|
||||||
|
|
||||||
if(e.getMessage() != null && (e.getMessage().contains("Couldn't create window") || e.getMessage().contains("OpenGL 2.0 or higher"))){
|
if(e.getMessage() != null && (e.getMessage().contains("Couldn't create window") || e.getMessage().contains("OpenGL 2.0 or higher") || e.getMessage().toLowerCase().contains("pixel format"))){
|
||||||
|
|
||||||
dialog.get(() -> message(
|
dialog.get(() -> message(
|
||||||
e.getMessage().contains("Couldn't create window") ? "A graphics initialization error has occured! Try to update your graphics drivers:\n" + e.getMessage() :
|
e.getMessage().contains("Couldn't create window") ? "A graphics initialization error has occured! Try to update your graphics drivers:\n" + e.getMessage() :
|
||||||
|
|||||||
Reference in New Issue
Block a user