From 8e95be0ac23b88d273ef7b329c0c0cadf329e19f Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 19 Jun 2019 21:41:49 -0400 Subject: [PATCH] Crash fix + drill balance --- core/assets/bundles/bundle.properties | 2 +- .../io/anuke/mindustry/content/Blocks.java | 8 +++---- .../io/anuke/mindustry/net/CrashSender.java | 22 +++++++++---------- .../mindustry/ui/fragments/HudFragment.java | 6 +++-- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index b0713ed049..fce61dbc44 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -331,7 +331,7 @@ zone.resources = Resources Detected: add = Add... boss.health = Boss Health -connectfail = [crimson]Failed to connect to server:\n\n[accent]{0} +connectfail = [crimson]Connection error:\n\n[accent]{0} error.unreachable = Server unreachable.\nIs the address spelled correctly? error.invalidaddress = Invalid address. error.timedout = Timed out!\nMake sure the host has port forwarding set up, and that the address is correct! diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index c4baff95cd..98938213f9 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -1125,7 +1125,7 @@ public class Blocks implements ContentList{ }}; pneumaticDrill = new Drill("pneumatic-drill"){{ - requirements(Category.production, ItemStack.with(Items.copper, 60, Items.graphite, 50)); + requirements(Category.production, ItemStack.with(Items.copper, 35, Items.graphite, 15)); tier = 3; drillTime = 480; size = 2; @@ -1134,7 +1134,7 @@ public class Blocks implements ContentList{ }}; laserDrill = new Drill("laser-drill"){{ - requirements(Category.production, ItemStack.with(Items.copper, 70, Items.graphite, 90, Items.silicon, 60, Items.titanium, 50)); + requirements(Category.production, ItemStack.with(Items.copper, 70, Items.graphite, 60, Items.silicon, 60, Items.titanium, 40)); drillTime = 280; size = 3; hasPower = true; @@ -1147,8 +1147,8 @@ public class Blocks implements ContentList{ }}; blastDrill = new Drill("blast-drill"){{ - requirements(Category.production, ItemStack.with(Items.copper, 130, Items.silicon, 120, Items.titanium, 100, Items.thorium, 100)); - drillTime = 200; + requirements(Category.production, ItemStack.with(Items.copper, 130, Items.silicon, 120, Items.titanium, 100, Items.thorium, 150)); + drillTime = 220; size = 4; drawRim = true; hasPower = true; diff --git a/core/src/io/anuke/mindustry/net/CrashSender.java b/core/src/io/anuke/mindustry/net/CrashSender.java index c551cf8828..21d197866c 100644 --- a/core/src/io/anuke/mindustry/net/CrashSender.java +++ b/core/src/io/anuke/mindustry/net/CrashSender.java @@ -50,6 +50,17 @@ public class CrashSender{ } } + try{ + File file = new File(OS.getAppDataDirectoryString(Vars.appName), "crashes/crash-report-" + DateTimeFormatter.ofPattern("MM_dd_yyyy_HH_mm_ss").format(LocalDateTime.now()) + ".txt"); + new File(OS.getAppDataDirectoryString(Vars.appName)).mkdir(); + new BufferedOutputStream(new FileOutputStream(file), Streams.DEFAULT_BUFFER_SIZE).write(parseException(exception).getBytes()); + Files.createDirectories(Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes")); + + writeListener.accept(file); + }catch(Throwable ignored){ + Log.err("Failed to save local crash report."); + } + try{ //check crash report setting if(!Core.settings.getBool("crashreport", true)){ @@ -64,17 +75,6 @@ public class CrashSender{ return; } - try{ - File file = new File(OS.getAppDataDirectoryString(Vars.appName), "crashes/crash-report-" + DateTimeFormatter.ofPattern("MM_dd_yyyy_HH_mm_ss").format(LocalDateTime.now()) + ".txt"); - new File(OS.getAppDataDirectoryString(Vars.appName)).mkdir(); - new BufferedOutputStream(new FileOutputStream(file), Streams.DEFAULT_BUFFER_SIZE).write(parseException(exception).getBytes()); - Files.createDirectories(Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes")); - - writeListener.accept(file); - }catch(Throwable ignored){ - Log.err("Failed to save local crash report."); - } - boolean netActive = false, netServer = false; //attempt to close connections, if applicable diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index 3a10063236..41f0728ca1 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -385,7 +385,7 @@ public class HudFragment extends Fragment{ //paused table parent.fill(t -> { - t.top().visible(() -> state.is(State.paused) && !Net.active()); + t.top().visible(() -> state.isPaused()); t.table("button", top -> top.add("$paused").pad(6f)); }); @@ -551,7 +551,9 @@ public class HudFragment extends Fragment{ } shown = !shown; - flip.getParent().act(Core.graphics.getDeltaTime()); + if(flip != null){ + flip.getParent().act(Core.graphics.getDeltaTime()); + } } private void addWaveTable(TextButton table){