From 78e95844dc27115b66b6e48ae22b451409847aad Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 15 Apr 2022 12:42:50 -0400 Subject: [PATCH] Fixed WorldLoadEvent being fired on startup --- core/src/mindustry/graphics/MenuRenderer.java | 7 +++++-- core/src/mindustry/ui/fragments/HudFragment.java | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/graphics/MenuRenderer.java b/core/src/mindustry/graphics/MenuRenderer.java index 207b38a57c..967f818f5f 100644 --- a/core/src/mindustry/graphics/MenuRenderer.java +++ b/core/src/mindustry/graphics/MenuRenderer.java @@ -39,7 +39,9 @@ public class MenuRenderer implements Disposable{ } private void generate(){ - world.beginMapLoad(); + //suppress tile change events. + world.setGenerating(true); + Tiles tiles = world.resize(width, height); //only uses base game ores now, mod ones usually contrast too much with the floor Seq ores = Seq.with(Blocks.oreCopper, Blocks.oreLead, Blocks.oreScrap, Blocks.oreCoal, Blocks.oreTitanium, Blocks.oreThorium); @@ -160,7 +162,8 @@ public class MenuRenderer implements Disposable{ } } - world.endMapLoad(); + //don't fire a world load event, it just causes lag and confusion + world.setGenerating(false); } private void cache(){ diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 97cf3e5056..b0093bc484 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -104,8 +104,10 @@ public class HudFragment{ t.add(new Minimap()).name("minimap"); t.row(); //position + // + (mobile ? "" : "\n[lightgray]" + World.toTile(Core.input.mouseWorldX()) + "," + World.toTile(Core.input.mouseWorldY())) t.label(() -> player.tileX() + "," + player.tileY()) .visible(() -> Core.settings.getBool("position")) + //.right().labelAlign(Align.right) .touchable(Touchable.disabled) .name("position"); t.top().right();