This commit is contained in:
Anuken
2018-11-06 12:55:13 -05:00
parent ffa1aae27c
commit 04b4321ea1
8 changed files with 52 additions and 23 deletions

View File

@@ -21,13 +21,17 @@ import java.time.format.DateTimeFormatter;
public class CrashHandler{
public static void handle(Throwable e){
try{
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
}catch(Throwable ignored){}
e.printStackTrace();
if(!OS.isMac){
try{
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
}catch(Throwable ignored){}
}
boolean badGPU = false;
if(e.getMessage() != null && (e.getMessage().contains("Couldn't create window") || e.getMessage().contains("OpenGL 2.0 or higher"))){
if(!OS.isMac && e.getMessage() != null && (e.getMessage().contains("Couldn't create window") || e.getMessage().contains("OpenGL 2.0 or higher"))){
try{
javax.swing.JOptionPane.showMessageDialog(null, "Your graphics card does not support OpenGL 2.0!\n" +
"Try to update your graphics drivers.\n\n" +
@@ -37,8 +41,6 @@ public class CrashHandler{
}catch(Throwable ignored){}
}
e.printStackTrace();
//don't create crash logs for me (anuke), as it's expected
//also don't create logs for custom builds
if(System.getProperty("user.name").equals("anuke") || Version.build == -1) return;