From 4c0607aba8fb94725b5a7a4216fa99ae57c0219f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 9 Nov 2019 17:19:29 -0500 Subject: [PATCH] Bugfixes --- .../mindustry/ui/dialogs/FileChooser.java | 37 ++++++++----------- .../mindustry/ui/dialogs/ModsDialog.java | 2 +- .../mindustry/desktop/DesktopLauncher.java | 2 +- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java b/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java index 17f6e0b851..c726778b5a 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java @@ -18,7 +18,7 @@ import java.util.*; import static io.anuke.mindustry.Vars.platform; 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 Table files; @@ -98,10 +98,6 @@ public class FileChooser extends FloatingDialog{ updateFiles(true); }); - //Macs are confined to the Downloads/ directory - if(OS.isMac){ - up.setDisabled(true); - } ImageButton back = new ImageButton(Icon.arrowLeft); ImageButton forward = new ImageButton(Icon.arrowRight); @@ -171,8 +167,7 @@ public class FileChooser extends FloatingDialog{ private void updateFiles(boolean push){ if(push) stack.push(directory); - //if is mac, don't display extra info since you can only ever go to downloads - navigation.setText(OS.isMac ? directory.name() : directory.toString()); + navigation.setText(directory.toString()); GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new); @@ -190,23 +185,21 @@ public class FileChooser extends FloatingDialog{ files.top().left(); FileHandle[] names = getFileNames(); - //macs are confined to the Downloads/ directory - if(!OS.isMac){ - Image upimage = new Image(Icon.folderParentSmall); - TextButton upbutton = new TextButton(".." + directory.toString(), Styles.clearTogglet); - upbutton.clicked(() -> { - directory = directory.parent(); - lastDirectory = directory; - updateFiles(true); - }); + Image upimage = new Image(Icon.folderParentSmall); + TextButton upbutton = new TextButton(".." + directory.toString(), Styles.clearTogglet); + upbutton.clicked(() -> { + directory = directory.parent(); + lastDirectory = directory; + updateFiles(true); + }); - upbutton.left().add(upimage).padRight(4f).padLeft(4); - upbutton.getLabel().setAlignment(Align.left); - upbutton.getCells().reverse(); + upbutton.left().add(upimage).padRight(4f).padLeft(4); + upbutton.getLabel().setAlignment(Align.left); + 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 group = new ButtonGroup<>(); group.setMinCheckCount(0); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java index 8c9ab59ae7..50164a7dff 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ModsDialog.java @@ -95,7 +95,7 @@ public class ModsDialog extends FloatingDialog{ void modError(Throwable error){ 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"); }else{ ui.showException(error); diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index cc5fcb89a2..1ce411d804 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -242,7 +242,7 @@ public class DesktopLauncher extends ClientLauncher{ Cons dialog = Runnable::run; 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( e.getMessage().contains("Couldn't create window") ? "A graphics initialization error has occured! Try to update your graphics drivers:\n" + e.getMessage() :