Skip to content

Commit

Permalink
added copy region context entry (Cubitect#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cubitect authored and SunnySlopes committed Mar 1, 2023
1 parent d76975a commit 3465090
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/mapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,14 @@ void MapView::showContextMenu(const QPoint &pos)
QString tp = QString::asprintf("/tp @p %d ~ %d", p.x, p.z);
QString coords = QString::asprintf("%d %d", p.x, p.z);
QString chunk = QString::asprintf("%d %d", p.x >> 4, p.z >> 4);

menu.addAction(tr("复制种子: ")+seed, this, &MapView::copySeed, QKeySequence::Copy);
menu.addAction(tr("复制tp指令: ")+tp, [=](){ this->copyText(tp); });
menu.addAction(tr("复制方块位置:")+coords, [=](){ this->copyText(coords); });
menu.addAction(tr("复制坐标位置:")+chunk, [=](){ this->copyText(chunk); });
menu.addAction(tr("前往坐标: "), this, &MapView::onGoto, QKeySequence(Qt::CTRL + Qt::Key_G));
QString region = QString::asprintf("%d %d", p.x >> 9, p.z >> 9);

menu.addAction(tr("前往坐标: "), this, &MapView::onGoto, QKeySequence(Qt::CTRL + Qt::Key_G));
menu.addAction(tr("复制种子: ")+seed, this, &MapView::copySeed, QKeySequence::Copy);
menu.addAction(tr("复制tp指令: ")+tp, [=](){ this->copyText(tp); });
menu.addAction(tr("复制方块位置: ")+coords, [=](){ this->copyText(coords); });
menu.addAction(tr("复制区块位置: ")+chunk, [=](){ this->copyText(chunk); });
menu.addAction(tr("复制区域位置: ")+region, [=](){ this->copyText(region); });
// menu.addAction(tr("动画: "), this, &MapView::runAni);
menu.exec(mapToGlobal(pos));
}
Expand Down

0 comments on commit 3465090

Please sign in to comment.