This commit is contained in:
Anuken
2019-10-30 00:27:17 -04:00
parent 77dbeed890
commit fcbcdfc5d9
2 changed files with 47 additions and 44 deletions

View File

@ -98,7 +98,7 @@ public class ModsDialog extends FloatingDialog{
void setup(){
cont.clear();
cont.defaults().width(mobile ? 500 : 520f).pad(4);
cont.defaults().width(mobile ? 500 : 560f).pad(4);
cont.add("$mod.reloadrequired").visible(mods::requiresReload).center().get().setAlignment(Align.center);
cont.row();
if(!(mods.all().isEmpty() && mods.disabled().isEmpty())){

View File

@ -39,7 +39,7 @@ import static io.anuke.mindustry.Vars.*;
public class DesktopLauncher extends ClientLauncher{
public final static String discordID = "610508934456934412";
boolean useDiscord = OS.is64Bit, showConsole = OS.getPropertyNotNull("user.name").equals("anuke");
boolean useDiscord = OS.is64Bit, loadError = false;
static{
if(!Charset.forName("US-ASCII").newEncoder().canEncode(System.getProperty("user.name", ""))){
@ -91,7 +91,6 @@ public class DesktopLauncher extends ClientLauncher{
}
}
if(showConsole){
StringBuilder base = new StringBuilder();
Log.setLogger(new LogHandler(){
@Override
@ -109,7 +108,7 @@ public class DesktopLauncher extends ClientLauncher{
t.touchable(Touchable.disabled);
t.top().left();
t.update(() -> {
if(Core.input.keyTap(KeyCode.BACKTICK)){
if(Core.input.keyTap(KeyCode.BACKTICK) && (loadError || System.getProperty("user.name").equals("anuke"))){
visible[0] = !visible[0];
}
@ -136,22 +135,25 @@ public class DesktopLauncher extends ClientLauncher{
}
});
});
}
try{
try{
SteamAPI.loadLibraries();
}catch(Throwable t){
logSteamError(t);
fallbackSteam();
}
if(!SteamAPI.init()){
loadError = true;
Log.err("Steam client not running.");
}else{
initSteam(args);
Vars.steam = true;
}
if(SteamAPI.restartAppIfNecessary(SVars.steamID)){
System.exit(0);
}
}catch(Throwable e){
steam = false;
Log.err("Failed to load Steam native libraries.");
@ -161,6 +163,7 @@ public class DesktopLauncher extends ClientLauncher{
}
void logSteamError(Throwable e){
loadError = true;
Log.err(e);
try(OutputStream s = new FileOutputStream(new File("steam-error-log-" + System.nanoTime() + ".txt"))){
String log = Strings.parseException(e, true);