Merge pull request #724 from GriffinRichards/player-icons
Add new player icons for the Events tab
@@ -39,7 +39,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>570</width>
|
||||
<height>692</height>
|
||||
<height>680</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
@@ -94,7 +94,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -164,7 +164,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -248,7 +248,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -1197,23 +1197,62 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>570</width>
|
||||
<height>840</height>
|
||||
<height>927</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_EventsTabIcon">
|
||||
<property name="title">
|
||||
<string>Tab Icon</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<item row="1" column="1">
|
||||
<widget class="QToolButton" name="button_EventsTabIcon">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="lineEdit_EventsTabIcon">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The image file path to use for the icon of the Events tab.</p></body></html></string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="NoScrollComboBox" name="comboBox_EventsTabIcon">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The icon that will be displayed for the Events tab in the editor. If 'Automatic' is chosen, the icon will be a random player character from the project's base game version. If 'Custom' is chosen an image file path may be specified.</p></body></html></string>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_DefaultIcons">
|
||||
<property name="title">
|
||||
<string>Default Icons</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_TriggersIcon">
|
||||
<property name="text">
|
||||
<string>Triggers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_WarpsIcon">
|
||||
<property name="text">
|
||||
@@ -1221,23 +1260,31 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_WarpsIcon">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_BGsIcon">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The icon that will be used to represent Warp events</p></body></html></string>
|
||||
<string><html><head/><body><p>The icon that will be used to represent BG events</p></body></html></string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_HealLocationsIcon">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The icon that will be used to represent Heal Location events</p></body></html></string>
|
||||
<item row="4" column="2">
|
||||
<widget class="QToolButton" name="button_HealLocationsIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_ObjectsIcon">
|
||||
<property name="text">
|
||||
<string>Objects</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1248,6 +1295,24 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_TriggersIcon">
|
||||
<property name="text">
|
||||
<string>Triggers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="button_WarpsIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_HealLocationsIcon">
|
||||
<property name="text">
|
||||
@@ -1265,10 +1330,56 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_ObjectsIcon">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_WarpsIcon">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The icon that will be used to represent Warp events</p></body></html></string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QToolButton" name="button_BGsIcon">
|
||||
<property name="text">
|
||||
<string>Objects</string>
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_HealLocationsIcon">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The icon that will be used to represent Heal Location events</p></body></html></string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QToolButton" name="button_TriggersIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="button_ObjectsIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1282,71 +1393,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_BGsIcon">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The icon that will be used to represent BG events</p></body></html></string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="button_ObjectsIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="button_WarpsIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QToolButton" name="button_TriggersIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QToolButton" name="button_BGsIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QToolButton" name="button_HealLocationsIcon">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/folder.ico</normaloff>:/icons/folder.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1365,7 +1411,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/delete.ico</normaloff>:/icons/delete.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -1418,7 +1464,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/add.ico</normaloff>:/icons/add.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -1628,7 +1674,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>544</width>
|
||||
<height>338</height>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="layout_ProjectPaths">
|
||||
@@ -1657,7 +1703,7 @@
|
||||
<string>Add Global Constants File...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/add.ico</normaloff>:/icons/add.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -1668,7 +1714,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/help.ico</normaloff>:/icons/help.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -1708,7 +1754,7 @@
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/help.ico</normaloff>:/icons/help.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -1745,7 +1791,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>544</width>
|
||||
<height>421</height>
|
||||
<height>425</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="layout_Identifiers">
|
||||
@@ -1774,7 +1820,7 @@
|
||||
<string>Add Global Constant...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/icons/add.ico</normaloff>:/icons/add.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -1840,8 +1886,6 @@
|
||||
<header location="global">uintspinbox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../resources/images.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -335,6 +335,7 @@ public:
|
||||
this->filePaths.clear();
|
||||
this->eventIconPaths.clear();
|
||||
this->pokemonIconPaths.clear();
|
||||
this->eventsTabIconPath = QString();
|
||||
this->collisionSheetPath = QString();
|
||||
this->collisionSheetSize = QSize(2, 16);
|
||||
this->playerViewDistance = QMargins(GBA_H_DIST_TO_CENTER, GBA_V_DIST_TO_CENTER, GBA_H_DIST_TO_CENTER, GBA_V_DIST_TO_CENTER);
|
||||
@@ -356,6 +357,9 @@ public:
|
||||
static const QStringList versionStrings;
|
||||
static BaseGameVersion stringToBaseGameVersion(const QString &string);
|
||||
|
||||
static QString getPlayerIconPath(BaseGameVersion baseGameVersion, int character);
|
||||
static QIcon getPlayerIcon(BaseGameVersion baseGameVersion, int character);
|
||||
|
||||
void reset(BaseGameVersion baseGameVersion);
|
||||
void setFilePath(ProjectFilePath pathId, const QString &path);
|
||||
void setFilePath(const QString &pathId, const QString &path);
|
||||
@@ -415,6 +419,7 @@ public:
|
||||
uint16_t unusedTileCovered;
|
||||
uint16_t unusedTileSplit;
|
||||
bool mapAllowFlagsEnabled;
|
||||
QString eventsTabIconPath;
|
||||
QString collisionSheetPath;
|
||||
QSize collisionSheetSize;
|
||||
QMargins playerViewDistance;
|
||||
|
||||
BIN
resources/icons/player/brendan_em.ico
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
resources/icons/player/brendan_rs.ico
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
resources/icons/player/green.ico
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
resources/icons/player/may_em.ico
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
resources/icons/player/may_rs.ico
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
@@ -46,9 +46,14 @@
|
||||
<file>icons/sort_number.ico</file>
|
||||
<file>icons/tall_grass.ico</file>
|
||||
<file>icons/minimap.ico</file>
|
||||
<file>icons/viewsprites.ico</file>
|
||||
<file>icons/application_form_edit.ico</file>
|
||||
<file>icons/connections.ico</file>
|
||||
<file>icons/player/brendan_em.ico</file>
|
||||
<file>icons/player/brendan_rs.ico</file>
|
||||
<file>icons/player/green.ico</file>
|
||||
<file>icons/player/may_em.ico</file>
|
||||
<file>icons/player/may_rs.ico</file>
|
||||
<file>icons/player/red.ico</file>
|
||||
<file>icons/ui/dark/checkbox_checked_disabled.png</file>
|
||||
<file>icons/ui/dark/checkbox_checked_disabled@2x.png</file>
|
||||
<file>icons/ui/dark/checkbox_checked.png</file>
|
||||
|
||||
@@ -731,6 +731,32 @@ BaseGameVersion ProjectConfig::stringToBaseGameVersion(const QString &string) {
|
||||
return version;
|
||||
}
|
||||
|
||||
QString ProjectConfig::getPlayerIconPath(BaseGameVersion baseGameVersion, int character) {
|
||||
switch (baseGameVersion) {
|
||||
case BaseGameVersion::pokeemerald: {
|
||||
static const QStringList paths = { QStringLiteral(":/icons/player/brendan_em.ico"),
|
||||
QStringLiteral(":/icons/player/may_em.ico"), };
|
||||
return paths.value(character);
|
||||
}
|
||||
case BaseGameVersion::pokefirered: {
|
||||
static const QStringList paths = { QStringLiteral(":/icons/player/red.ico"),
|
||||
QStringLiteral(":/icons/player/green.ico"), };
|
||||
return paths.value(character);
|
||||
}
|
||||
case BaseGameVersion::pokeruby: {
|
||||
static const QStringList paths = { QStringLiteral(":/icons/player/brendan_rs.ico"),
|
||||
QStringLiteral(":/icons/player/may_rs.ico"), };
|
||||
return paths.value(character);
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
QIcon ProjectConfig::getPlayerIcon(BaseGameVersion baseGameVersion, int character) {
|
||||
return QIcon(getPlayerIconPath(baseGameVersion, character));
|
||||
}
|
||||
|
||||
ProjectConfig projectConfig;
|
||||
|
||||
QString ProjectConfig::getConfigFilepath() {
|
||||
@@ -868,6 +894,8 @@ void ProjectConfig::parseConfigKeyValue(QString key, QString value) {
|
||||
this->eventIconPaths[Event::Group::Heal] = value;
|
||||
} else if (key.startsWith("pokemon_icon_path/")) {
|
||||
this->pokemonIconPaths.insert(key.mid(QStringLiteral("pokemon_icon_path/").length()), value);
|
||||
} else if (key == "events_tab_icon_path") {
|
||||
this->eventsTabIconPath = value;
|
||||
} else if (key == "collision_sheet_path") {
|
||||
this->collisionSheetPath = value;
|
||||
} else if (key == "collision_sheet_width") {
|
||||
@@ -987,6 +1015,7 @@ QMap<QString, QString> ProjectConfig::getKeyValueMap() {
|
||||
for (auto it = this->identifiers.constBegin(); it != this->identifiers.constEnd(); it++) {
|
||||
map.insert("ident/"+defaultIdentifiers.value(it.key()).first, it.value());
|
||||
}
|
||||
map.insert("events_tab_icon_path", this->eventsTabIconPath);
|
||||
map.insert("collision_sheet_path", this->collisionSheetPath);
|
||||
map.insert("collision_sheet_width", QString::number(this->collisionSheetSize.width()));
|
||||
map.insert("collision_sheet_height", QString::number(this->collisionSheetSize.height()));
|
||||
|
||||
@@ -249,7 +249,7 @@ void MainWindow::initCustomUI() {
|
||||
|
||||
static const QMap<int, QIcon> mainTabIcons = {
|
||||
{MainTab::Map, QIcon(QStringLiteral(":/icons/minimap.ico"))},
|
||||
{MainTab::Events, QIcon(QStringLiteral(":/icons/viewsprites.ico"))},
|
||||
{MainTab::Events, ProjectConfig::getPlayerIcon(BaseGameVersion::pokefirered, 0)}, // Arbitrary default
|
||||
{MainTab::Header, QIcon(QStringLiteral(":/icons/application_form_edit.ico"))},
|
||||
{MainTab::Connections, QIcon(QStringLiteral(":/icons/connections.ico"))},
|
||||
{MainTab::WildPokemon, QIcon(QStringLiteral(":/icons/tall_grass.ico"))},
|
||||
@@ -1305,6 +1305,21 @@ bool MainWindow::setProjectUI() {
|
||||
|
||||
ui->mapCustomAttributesFrame->table()->setRestrictedKeys(project->getTopLevelMapFields());
|
||||
|
||||
// Set a version dependent player icon (or user-chosen icon) for the Events tab.
|
||||
QIcon eventTabIcon;
|
||||
if (!projectConfig.eventsTabIconPath.isEmpty()) {
|
||||
eventTabIcon = QIcon(project->getExistingFilepath(projectConfig.eventsTabIconPath));
|
||||
if (eventTabIcon.isNull()) {
|
||||
logWarn(QString("Failed to load custom Events tab icon '%1'.").arg(projectConfig.eventsTabIconPath));
|
||||
}
|
||||
}
|
||||
if (eventTabIcon.isNull()) {
|
||||
// We randomly choose between the available characters for ~flavor~.
|
||||
// For now, this correctly assumes all versions have 2 icons.
|
||||
eventTabIcon = ProjectConfig::getPlayerIcon(projectConfig.baseGameVersion, QRandomGenerator::global()->bounded(0, 2));
|
||||
}
|
||||
ui->mainTabBar->setTabIcon(MainTab::Events, eventTabIcon);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ void ProjectSettingsEditor::connectSignals() {
|
||||
connect(ui->button_BGsIcon, &QAbstractButton::clicked, [this](bool) { this->chooseImageFile(ui->lineEdit_BGsIcon); });
|
||||
connect(ui->button_HealLocationsIcon, &QAbstractButton::clicked, [this](bool) { this->chooseImageFile(ui->lineEdit_HealLocationsIcon); });
|
||||
connect(ui->button_PokemonIcon, &QAbstractButton::clicked, [this](bool) { this->chooseImageFile(ui->lineEdit_PokemonIcon); });
|
||||
connect(ui->button_EventsTabIcon, &QAbstractButton::clicked, [this](bool) { this->chooseImageFile(ui->lineEdit_EventsTabIcon); });
|
||||
|
||||
|
||||
// Display a warning if a mask value overlaps with another mask in its group.
|
||||
@@ -113,6 +114,20 @@ void ProjectSettingsEditor::initUi() {
|
||||
ui->comboBox_BaseGameVersion->addItems(ProjectConfig::versionStrings);
|
||||
ui->comboBox_AttributesSize->addItems({"1", "2", "4"});
|
||||
|
||||
ui->comboBox_EventsTabIcon->addItem("Automatic", "");
|
||||
ui->comboBox_EventsTabIcon->addItem("Brendan (Emerald)", ProjectConfig::getPlayerIconPath(BaseGameVersion::pokeemerald, 0));
|
||||
ui->comboBox_EventsTabIcon->addItem("Brendan (R/S)", ProjectConfig::getPlayerIconPath(BaseGameVersion::pokeruby, 0));
|
||||
ui->comboBox_EventsTabIcon->addItem("May (Emerald)", ProjectConfig::getPlayerIconPath(BaseGameVersion::pokeemerald, 1));
|
||||
ui->comboBox_EventsTabIcon->addItem("May (R/S)", ProjectConfig::getPlayerIconPath(BaseGameVersion::pokeruby, 1));
|
||||
ui->comboBox_EventsTabIcon->addItem("Red", ProjectConfig::getPlayerIconPath(BaseGameVersion::pokefirered, 0));
|
||||
ui->comboBox_EventsTabIcon->addItem("Green", ProjectConfig::getPlayerIconPath(BaseGameVersion::pokefirered, 1));
|
||||
ui->comboBox_EventsTabIcon->addItem("Custom", "Custom");
|
||||
connect(ui->comboBox_EventsTabIcon, QOverload<int>::of(&NoScrollComboBox::currentIndexChanged), [this](int index) {
|
||||
bool usingCustom = (index == ui->comboBox_EventsTabIcon->findText("Custom"));
|
||||
ui->lineEdit_EventsTabIcon->setVisible(usingCustom);
|
||||
ui->button_EventsTabIcon->setVisible(usingCustom);
|
||||
});
|
||||
|
||||
// Validate that the border metatiles text is a comma-separated list of metatile values
|
||||
static const QString regex_Hex = "(0[xX])?[A-Fa-f0-9]+";
|
||||
static const QRegularExpression expression_HexList(QString("^(%1,)*%1$").arg(regex_Hex)); // Comma-separated list of hex values
|
||||
@@ -520,6 +535,15 @@ void ProjectSettingsEditor::refresh() {
|
||||
}
|
||||
this->setWarpBehaviorsList(behaviorNames);
|
||||
|
||||
int index = ui->comboBox_EventsTabIcon->findData(projectConfig.eventsTabIconPath);
|
||||
if (index < 0) {
|
||||
index = ui->comboBox_EventsTabIcon->findData("Custom");
|
||||
ui->lineEdit_EventsTabIcon->setText(projectConfig.eventsTabIconPath);
|
||||
} else {
|
||||
ui->lineEdit_EventsTabIcon->setText("");
|
||||
}
|
||||
ui->comboBox_EventsTabIcon->setCurrentIndex(index);
|
||||
|
||||
this->refreshing = false; // Allow signals
|
||||
}
|
||||
|
||||
@@ -608,6 +632,16 @@ void ProjectSettingsEditor::save() {
|
||||
for (auto i = this->editedPokemonIconPaths.cbegin(), end = this->editedPokemonIconPaths.cend(); i != end; i++)
|
||||
projectConfig.setPokemonIconPath(i.key(), i.value());
|
||||
|
||||
QString eventsTabIconPath;
|
||||
QVariant data = ui->comboBox_EventsTabIcon->currentData();
|
||||
if (data.isValid() && data.canConvert<QString>()) {
|
||||
eventsTabIconPath = data.toString();
|
||||
if (eventsTabIconPath == "Custom") {
|
||||
eventsTabIconPath = ui->lineEdit_EventsTabIcon->text();
|
||||
}
|
||||
}
|
||||
projectConfig.eventsTabIconPath = eventsTabIconPath;
|
||||
|
||||
projectConfig.save();
|
||||
userConfig.save();
|
||||
porymapConfig.save();
|
||||
|
||||