Give metatile label copy feedback, skip empty labels
This commit is contained in:
parent
167710b4b2
commit
5b5d6ddf25
1 changed files with 6 additions and 7 deletions
|
@ -1074,12 +1074,11 @@ void TilesetEditor::countTileUsage() {
|
|||
}
|
||||
|
||||
void TilesetEditor::on_copyButton_metatileLabel_clicked() {
|
||||
QClipboard * clipboard = QGuiApplication::clipboard();
|
||||
QString label = this->ui->lineEdit_metatileLabel->text();
|
||||
if (!label.isEmpty()) {
|
||||
Tileset * tileset = Tileset::getMetatileTileset(this->getSelectedMetatileId(), this->primaryTileset, this->secondaryTileset);
|
||||
if (tileset)
|
||||
label.prepend("METATILE_" + QString(tileset->name).replace("gTileset_", "") + "_");
|
||||
}
|
||||
clipboard->setText(label);
|
||||
if (label.isEmpty()) return;
|
||||
Tileset * tileset = Tileset::getMetatileTileset(this->getSelectedMetatileId(), this->primaryTileset, this->secondaryTileset);
|
||||
if (tileset)
|
||||
label.prepend("METATILE_" + QString(tileset->name).replace("gTileset_", "") + "_");
|
||||
QGuiApplication::clipboard()->setText(label);
|
||||
QToolTip::showText(this->ui->copyButton_metatileLabel->mapToGlobal(QPoint(0, 0)), "Copied!");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue