More mod content support

This commit is contained in:
Anuken
2019-10-04 19:14:45 -04:00
parent df3f23731b
commit edb0ece03b
18 changed files with 190 additions and 41 deletions

View File

@@ -149,6 +149,7 @@ public class DesktopLauncher extends ClientLauncher{
SVars.stats = new SStats();
SVars.workshop = new SWorkshop();
SVars.user = new SUser();
boolean[] isShutdown = {false};
Events.on(ClientLoadEvent.class, event -> {
player.name = SVars.net.friends.getPersonaName();
@@ -177,8 +178,18 @@ public class DesktopLauncher extends ClientLauncher{
}
});
});
Events.on(DisposeEvent.class, event -> {
SteamAPI.shutdown();
isShutdown[0] = true;
});
//steam shutdown hook
Runtime.getRuntime().addShutdownHook(new Thread(SteamAPI::shutdown));
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
if(!isShutdown[0]){
SteamAPI.shutdown();
}
}));
}
static void handleCrash(Throwable e){