Display steam load error message

This commit is contained in:
Anuken
2019-11-02 14:16:26 -04:00
parent 19796092e5
commit a72d95e6d7
2 changed files with 9 additions and 0 deletions

View File

@@ -275,6 +275,7 @@ missing = This item has been deleted or moved.\n[lightgray]The workshop listing
publishing = [accent]Publishing...
publish.confirm = Are you sure you want to publish this?\n\n[lightgray]Make sure you agree to the Workshop EULA first, or your items will not show up!
publish.error = Error publishing item: {0}
steam.error = Failed to initialize Steam services.\nError: {0}
editor.brush = Brush
editor.openin = Open In Editor

View File

@@ -40,6 +40,7 @@ public class DesktopLauncher extends ClientLauncher{
public final static String discordID = "610508934456934412";
boolean useDiscord = OS.is64Bit, loadError = false;
Throwable steamError;
static{
if(!Charset.forName("US-ASCII").newEncoder().canEncode(System.getProperty("user.name", ""))){
@@ -134,6 +135,12 @@ public class DesktopLauncher extends ClientLauncher{
label[0].invalidateHierarchy();
}
});
if(steamError != null){
Core.app.post(() -> Core.app.post(() -> Core.app.post(() -> {
ui.showErrorMessage(Core.bundle.format("steam.error", (steamError.getMessage() == null) ? steamError.getClass().getSimpleName() : steamError.getClass().getSimpleName() + ": " + steamError.getMessage()));
})));
}
});
try{
@@ -159,6 +166,7 @@ public class DesktopLauncher extends ClientLauncher{
}
void logSteamError(Throwable e){
steamError = e;
loadError = true;
Log.err(e);
try(OutputStream s = new FileOutputStream(new File("steam-error-log-" + System.nanoTime() + ".txt"))){