Better JSON null validation / Disable mods on startup crash
This commit is contained in:
@@ -34,6 +34,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
|
||||
@Override
|
||||
public void setup(){
|
||||
checkLaunch();
|
||||
loadLogger();
|
||||
|
||||
loader = new LoadRenderer();
|
||||
@@ -145,7 +146,12 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
finished = true;
|
||||
Events.fire(new ClientLoadEvent());
|
||||
super.resize(graphics.getWidth(), graphics.getHeight());
|
||||
app.post(() -> app.post(() -> app.post(() -> app.post(() -> super.resize(graphics.getWidth(), graphics.getHeight())))));
|
||||
app.post(() -> app.post(() -> app.post(() -> app.post(() -> {
|
||||
super.resize(graphics.getWidth(), graphics.getHeight());
|
||||
|
||||
//mark initialization as complete
|
||||
finishLaunch();
|
||||
}))));
|
||||
}
|
||||
}else{
|
||||
asyncCore.begin();
|
||||
@@ -168,6 +174,12 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
lastTime = Time.nanos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit(){
|
||||
//on graceful exit, finish the launch normally.
|
||||
Vars.finishLaunch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
setup();
|
||||
@@ -182,6 +194,11 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
|
||||
@Override
|
||||
public void pause(){
|
||||
//when the user tabs out on mobile, the exit() event doesn't fire reliably - in that case, just assume they're about to kill the app
|
||||
//this isn't 100% reliable but it should work for most cases
|
||||
if(mobile){
|
||||
Vars.finishLaunch();
|
||||
}
|
||||
if(finished){
|
||||
super.pause();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user