Add metatile label copy button
This commit is contained in:
parent
9963e4c8aa
commit
d1883720c9
3 changed files with 75 additions and 42 deletions
|
@ -198,19 +198,8 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="13" column="0" colspan="3">
|
<item row="1" column="2">
|
||||||
<widget class="QLabel" name="label_metatileLabel">
|
<widget class="QComboBox" name="comboBox_layerType"/>
|
||||||
<property name="text">
|
|
||||||
<string>Metatile Label (Optional)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLabel" name="label_layerType">
|
|
||||||
<property name="text">
|
|
||||||
<string>Layer Type</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="label_encounterType">
|
<widget class="QLabel" name="label_encounterType">
|
||||||
|
@ -219,12 +208,24 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QLabel" name="label_terrainType">
|
<widget class="QComboBox" name="comboBox_encounterType"/>
|
||||||
<property name="text">
|
</item>
|
||||||
<string>Terrain Type</string>
|
<item row="2" column="0">
|
||||||
|
<spacer name="verticalSpacer_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="0">
|
||||||
|
<widget class="QComboBox" name="comboBox_terrainType"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QGraphicsView" name="graphicsView_metatileLayers">
|
<widget class="QGraphicsView" name="graphicsView_metatileLayers">
|
||||||
|
@ -248,6 +249,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLabel" name="label_layerType">
|
||||||
|
<property name="text">
|
||||||
|
<string>Layer Type</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_BottomTop">
|
<widget class="QLabel" name="label_BottomTop">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -255,8 +263,22 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="13" column="0" colspan="3">
|
||||||
<widget class="QComboBox" name="comboBox_encounterType"/>
|
<widget class="QLabel" name="label_metatileLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Metatile Label (Optional)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0" colspan="3">
|
||||||
|
<widget class="NoScrollComboBox" name="comboBox_metatileBehaviors" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="0">
|
||||||
|
<widget class="QLabel" name="label_terrainType">
|
||||||
|
<property name="text">
|
||||||
|
<string>Terrain Type</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<spacer name="horizontalSpacer_5">
|
<spacer name="horizontalSpacer_5">
|
||||||
|
@ -271,19 +293,6 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="14" column="0" colspan="3">
|
|
||||||
<widget class="QLineEdit" name="lineEdit_metatileLabel">
|
|
||||||
<property name="clearButtonEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QComboBox" name="comboBox_layerType"/>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0" colspan="3">
|
|
||||||
<widget class="NoScrollComboBox" name="comboBox_metatileBehaviors" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="3">
|
<item row="3" column="0" colspan="3">
|
||||||
<widget class="QLabel" name="label_metatileBehavior">
|
<widget class="QLabel" name="label_metatileBehavior">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -291,22 +300,33 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="0">
|
<item row="1" column="3">
|
||||||
<widget class="QComboBox" name="comboBox_terrainType"/>
|
<spacer name="horizontalSpacer_6">
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<spacer name="verticalSpacer_5">
|
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>40</width>
|
||||||
<height>40</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="14" column="3">
|
||||||
|
<widget class="QToolButton" name="copyButton_metatileLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="14" column="0" colspan="3">
|
||||||
|
<widget class="QLineEdit" name="lineEdit_metatileLabel">
|
||||||
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -415,7 +435,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>384</width>
|
<width>384</width>
|
||||||
<height>265</height>
|
<height>262</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
|
|
@ -103,6 +103,8 @@ private slots:
|
||||||
|
|
||||||
void on_actionImport_Secondary_Metatiles_triggered();
|
void on_actionImport_Secondary_Metatiles_triggered();
|
||||||
|
|
||||||
|
void on_copyButton_metatileLabel_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initUi();
|
void initUi();
|
||||||
void setMetatileBehaviors();
|
void setMetatileBehaviors();
|
||||||
|
|
|
@ -1046,3 +1046,14 @@ 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->getSelectedMetatile(), this->primaryTileset, this->secondaryTileset);
|
||||||
|
if (tileset)
|
||||||
|
label.prepend("METATILE_" + QString(tileset->name).replace("gTileset_", "") + "_");
|
||||||
|
}
|
||||||
|
clipboard->setText(label);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue