From 45459f91f3a49a89433a308770c941476488634d Mon Sep 17 00:00:00 2001 From: Craig Forbes Date: Tue, 2 Oct 2018 12:14:37 -0500 Subject: [PATCH] Restore location on reload Add Y coordinate to the tooltip. --- mapview.cpp | 5 +++-- minutor.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mapview.cpp b/mapview.cpp index f3f2874b..5547d59a 100644 --- a/mapview.cpp +++ b/mapview.cpp @@ -616,6 +616,7 @@ void MapView::getToolTip(int x, int z) { Chunk *chunk = cache.fetch(cx, cz); int offset = (x & 0xf) + (z & 0xf) * 16; int id = 0, bd = 0; + int y = 0; QString name = "Unknown"; QString biome = "Unknown Biome"; @@ -623,7 +624,6 @@ void MapView::getToolTip(int x, int z) { if (chunk) { int top = qMin(depth, chunk->highest); - int y = 0; for (y = top; y >= 0; y--) { int sec = y >> 4; ChunkSection *section = chunk->sections[sec]; @@ -663,8 +663,9 @@ void MapView::getToolTip(int x, int z) { entityStr = entities.join(", "); } - emit hoverTextChanged(tr("X:%1 Z:%2 - %3 - %4 (%5:%6) %7") + emit hoverTextChanged(tr("X:%1 Y:%2 Z:%3 - %4 - %5 (%6:%7) %8") .arg(x) + .arg(y) .arg(z) .arg(biome) .arg(name) diff --git a/minutor.cpp b/minutor.cpp index 84b40be9..36a8ed4e 100644 --- a/minutor.cpp +++ b/minutor.cpp @@ -123,7 +123,10 @@ void Minutor::open() { } void Minutor::reload() { + auto loc = *(mapview->getLocation()); + loadWorld(currentWorld); + mapview->setLocation(loc.x, loc.y, loc.z, false, true); } void Minutor::save() {