Skip to content

Commit

Permalink
Merge pull request mrkite#142 from cpforbes/cpf-recenter
Browse files Browse the repository at this point in the history
Restore location on reload & Add y coordinate to status bar
  • Loading branch information
mrkite authored Oct 9, 2018
2 parents ddcc266 + 45459f9 commit cee1468
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,14 +616,14 @@ 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";
QMap<QString, int> entityIds;

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];
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions minutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit cee1468

Please sign in to comment.