Fixed WorldLoadEvent being fired on startup

This commit is contained in:
Anuken
2022-04-15 12:42:50 -04:00
parent 193ec10c56
commit 78e95844dc
2 changed files with 7 additions and 2 deletions

View File

@@ -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<Block> 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(){

View File

@@ -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();