From 311b6c8638be5614704280abc4caace304ac2792 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 30 Apr 2025 15:23:48 -0400 Subject: [PATCH 1/3] Add more player icons --- include/config.h | 5 +++ resources/icons/player/brendan_em.ico | Bin 0 -> 3638 bytes resources/icons/player/brendan_rs.ico | Bin 0 -> 3638 bytes resources/icons/player/green.ico | Bin 0 -> 3638 bytes resources/icons/player/may_em.ico | Bin 0 -> 3638 bytes resources/icons/player/may_rs.ico | Bin 0 -> 3638 bytes .../icons/{viewsprites.ico => player/red.ico} | Bin resources/images.qrc | 7 ++++- src/config.cpp | 29 ++++++++++++++++++ src/mainwindow.cpp | 17 +++++++++- 10 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 resources/icons/player/brendan_em.ico create mode 100644 resources/icons/player/brendan_rs.ico create mode 100644 resources/icons/player/green.ico create mode 100644 resources/icons/player/may_em.ico create mode 100644 resources/icons/player/may_rs.ico rename resources/icons/{viewsprites.ico => player/red.ico} (100%) diff --git a/include/config.h b/include/config.h index 26d2a353..285a86e1 100644 --- a/include/config.h +++ b/include/config.h @@ -335,6 +335,7 @@ public: this->filePaths.clear(); this->eventIconPaths.clear(); this->pokemonIconPaths.clear(); + this->eventTabIconPath = 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); @@ -355,6 +356,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); @@ -414,6 +418,7 @@ public: uint16_t unusedTileCovered; uint16_t unusedTileSplit; bool mapAllowFlagsEnabled; + QString eventTabIconPath; QString collisionSheetPath; QSize collisionSheetSize; QMargins playerViewDistance; diff --git a/resources/icons/player/brendan_em.ico b/resources/icons/player/brendan_em.ico new file mode 100644 index 0000000000000000000000000000000000000000..2c896c4494b7b0a951758d8ea1aae283294b6743 GIT binary patch literal 3638 zcmeHKF>V_%5S$~$GkFwXJwa9AFSv@`x=fieReF_f@`9w%Bl3VeK#fb6X`NIq4Fhgc z1h~wQM}w!tcWD#cKzrQXSuVvDv?~D(3^p5Z^?2`qR{*x#Y=8E^NBYj_V+iO@aa>-+ z`F4Zrt8-jlUQ=%HW`BjZ?|SU^ci7$Tu)pc?z_uM|(1otGx=f%-G)>SV*b^dg#R}osLozghuN-27?YbttsB&*WHvqB$JWR4`hcWb-!slJMaagL*HfcMTF4XGL4 z5s~9h^H4)icB#A8IUe8~P17_@RBH8Z>C?P1Iz5B)RwH*bRp)qBK)dta{5;Mu%_~EO z;-nqlV4%}Ef8tC0?>`X=lh-+3?_|8=*sA#hzc{r#0;iIn!0TFyzmAn&{AI28Naw$@ R(ajS_ZhX1P!`SmQF7sm7r6H;KoGYqUC+t*~m`M~&ENXPyH$PMD8Es zsw>L9&Dl9CeWPd|x1pc2ZQbd)z5}1R1CH~Rv({;}8j8YvHt4$flF)e6c(y9wjOLUM zW7KhSxAE$2%(6aPrL^Z=ykcFL{$T^uDcLg zuz7E|6HV+$>mp5prNo^fAIafx1yX=vg|jnoZSZjoyaBM;xcsdFzEF2g9Zf)Wvg2}) zE{6g4+by=+OANyf?>~*$eZ9bNeT$2$2i)J>;A%JG!^4R2@$q1s1z0MuRN$YhK+{;& z)s;1D9irG+XST8?CNaQjZB~Y$H3Wo)#KmQBA0u^+6OD-c(!%Y7B?`%&;o3e?>jAB8 zPZG6Muvzu(2|wx4Q$d;b>vgX+8BFd}NR-7yE|&2V4nN)|*me1N$0Ws{iO#X?zOxqM zr&C}Yz0YnK>>XMC_!upH_E>cmY^lKiUIFz@v#RR4x~?i?%gs&KZ$5{|DF2S_nGJd+ ze>U2Jj^paTW_9Z3a#DoU&!-6UxGX~I{>s!PJ)PL#XK-*<$S;yS&hzt+;eNJmEPp*c zhkX7VuKdC@jC>}zCi}aTr-jxM*WHZ6Do-1&99h3AIETA;9(H-;c?8cu(GTOsIVaS4 zzw3LSY_G#T|24_;mt6WE#$VokUx9u8(v?)+PZ3H?dp|qBfqDE-_0QffGyMH@*_Cfs l`@OI4=J4nCua%#G(~|G_WBnVPWBvf%mdw8<`g<~F`U&vfakT&d literal 0 HcmV?d00001 diff --git a/resources/icons/player/may_em.ico b/resources/icons/player/may_em.ico new file mode 100644 index 0000000000000000000000000000000000000000..ffa56bab11cba96ad61cf197a37bf13a688dbff8 GIT binary patch literal 3638 zcmeHKu}&L75Pcr6*SFrY%qO^tNExM~BG;y*Oi2~dQl^QNJ{2E8K|zs^po!AplGcip zAMght9dCBL+?^8NB_+{~ygNJdcIIG=-aCK^1V=}pFYs{&yaKRZTYOspUzs~*j#t2R zx<_}=s*~3^dGj7s^&Mv)KH>8G9A_6dSbwW<`DKHvn=Pt`3v4$VY_>J(x<1%z1jY%B z6L?V*h!Im7=#wp%m`tY=(3_PV$G{adw?|VLLQaUdB1lAe%jkGBv`;*u6+|3sND77M1LcH;x)GGk&fk`FYY^?K}DW>j%h##4)J(HlxQWiH;8^VEdPv%zBjWpNIbR(;AiT#rTG!kG?+WT=s1MSZp z4&&r+%0f|uKtZ92B+;R~JoEbiPEnz0rPb?6d*=FnoXSN>vRb`qJt$VsQy9X%4?#QR zUBohZctbegY5HtO(_Q0St$qmCs+iPN|59Sq9_{)eT&Sw5wbWnJWOiuR_v4BRrP(@A zv1gXa9sUNVs;3@SYf-zt4^Qs^{KlL6`u*ofy~a(Z8@2EK`*{bf+UpTG)x}o`eT}H^ cfw#KuNDqCh-9yj0&u{tF?(~t1|Enc?0&RwMrvLx| literal 0 HcmV?d00001 diff --git a/resources/icons/player/may_rs.ico b/resources/icons/player/may_rs.ico new file mode 100644 index 0000000000000000000000000000000000000000..7450d620ac4609a00441b9eb863875f1f0d5aefa GIT binary patch literal 3638 zcmeHKv2NQi5Pdq55@ij}CwL0lG3b;j^_nqb#!f-kj9m(3@6-?IkRhLurN|Qhf>EG9 z;139(zT<@vgT_)irqF{(-rc)9T9kb!0~G`Z2jCiU5r9JgtCi_D5%@;iJKE?1nv)-w zy;vW=$MMlA*6W`*JO6^S&(}Er)Z_AMgYVZ{Y&RQhwmtg3-s;k;0NL54bfpyt&QQi>3R=p__V z$`HJGUcpp&aW&!OaYw1^w(Huu)@!H=z74v=M(0V+Exz3KA&dkjx@V}oxOK2sk2rWmZ4|hGqcLeJU z%QFi!tCZA`@E@+^SZZ)#aSM+xKU=~doJ(!N literal 0 HcmV?d00001 diff --git a/resources/icons/viewsprites.ico b/resources/icons/player/red.ico similarity index 100% rename from resources/icons/viewsprites.ico rename to resources/icons/player/red.ico diff --git a/resources/images.qrc b/resources/images.qrc index 41789a6e..8d6af6fd 100644 --- a/resources/images.qrc +++ b/resources/images.qrc @@ -46,9 +46,14 @@ icons/sort_number.ico icons/tall_grass.ico icons/minimap.ico - icons/viewsprites.ico icons/application_form_edit.ico icons/connections.ico + icons/player/brendan_em.ico + icons/player/brendan_rs.ico + icons/player/green.ico + icons/player/may_em.ico + icons/player/may_rs.ico + icons/player/red.ico icons/ui/dark/checkbox_checked_disabled.png icons/ui/dark/checkbox_checked_disabled@2x.png icons/ui/dark/checkbox_checked.png diff --git a/src/config.cpp b/src/config.cpp index 0e22840e..6ecce6d4 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -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 == "event_tab_icon_path") { + this->eventTabIconPath = value; } else if (key == "collision_sheet_path") { this->collisionSheetPath = value; } else if (key == "collision_sheet_width") { @@ -985,6 +1013,7 @@ QMap 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("event_tab_icon_path", this->eventTabIconPath); 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())); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ac41f582..18fbe198 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -249,7 +249,7 @@ void MainWindow::initCustomUI() { static const QMap 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"))}, @@ -1255,6 +1255,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.eventTabIconPath.isEmpty()) { + eventTabIcon = QIcon(projectConfig.eventTabIconPath); + if (eventTabIcon.isNull()) { + logWarn(QString("Failed to load custom Events tab icon '%1'.").arg(projectConfig.eventTabIconPath)); + } + } + 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; } From 6d3fd5bc7e7f8c70d8e5d7474d7f8ebfea49b8c8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 30 Apr 2025 16:58:50 -0400 Subject: [PATCH 2/3] Add settings for events tab icon --- forms/projectsettingseditor.ui | 244 ++++++++++++++++++------------- include/config.h | 4 +- src/config.cpp | 6 +- src/mainwindow.cpp | 6 +- src/ui/projectsettingseditor.cpp | 34 +++++ 5 files changed, 186 insertions(+), 108 deletions(-) diff --git a/forms/projectsettingseditor.ui b/forms/projectsettingseditor.ui index 05598b8f..c840d331 100644 --- a/forms/projectsettingseditor.ui +++ b/forms/projectsettingseditor.ui @@ -39,7 +39,7 @@ 0 0 570 - 692 + 680 @@ -94,7 +94,7 @@ ... - + :/icons/folder.ico:/icons/folder.ico @@ -164,7 +164,7 @@ ... - + :/icons/folder.ico:/icons/folder.ico @@ -248,7 +248,7 @@ ... - + :/icons/folder.ico:/icons/folder.ico @@ -1197,23 +1197,62 @@ 0 0 570 - 840 + 927 + + + + Tab Icon + + + + + + false + + + ... + + + + :/icons/folder.ico:/icons/folder.ico + + + + + + + false + + + <html><head/><body><p>The image file path to use for the icon of the Events tab.</p></body></html> + + + true + + + + + + + <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> + + + false + + + + + + Default Icons - - - - Triggers - - - @@ -1221,23 +1260,31 @@ - - + + - <html><head/><body><p>The icon that will be used to represent Warp events</p></body></html> + <html><head/><body><p>The icon that will be used to represent BG events</p></body></html> true - - - - <html><head/><body><p>The icon that will be used to represent Heal Location events</p></body></html> + + + + ... - - true + + + :/icons/folder.ico:/icons/folder.ico + + + + + + + Objects @@ -1248,6 +1295,24 @@ + + + + Triggers + + + + + + + ... + + + + :/icons/folder.ico:/icons/folder.ico + + + @@ -1265,10 +1330,56 @@ - - + + + + <html><head/><body><p>The icon that will be used to represent Warp events</p></body></html> + + + true + + + + + - Objects + ... + + + + :/icons/folder.ico:/icons/folder.ico + + + + + + + <html><head/><body><p>The icon that will be used to represent Heal Location events</p></body></html> + + + true + + + + + + + ... + + + + :/icons/folder.ico:/icons/folder.ico + + + + + + + ... + + + + :/icons/folder.ico:/icons/folder.ico @@ -1282,71 +1393,6 @@ - - - - <html><head/><body><p>The icon that will be used to represent BG events</p></body></html> - - - true - - - - - - - ... - - - - :/icons/folder.ico:/icons/folder.ico - - - - - - - ... - - - - :/icons/folder.ico:/icons/folder.ico - - - - - - - ... - - - - :/icons/folder.ico:/icons/folder.ico - - - - - - - ... - - - - :/icons/folder.ico:/icons/folder.ico - - - - - - - ... - - - - :/icons/folder.ico:/icons/folder.ico - - - @@ -1365,7 +1411,7 @@ ... - + :/icons/delete.ico:/icons/delete.ico @@ -1418,7 +1464,7 @@ ... - + :/icons/add.ico:/icons/add.ico @@ -1628,7 +1674,7 @@ 0 0 544 - 338 + 341 @@ -1657,7 +1703,7 @@ Add Global Constants File... - + :/icons/add.ico:/icons/add.ico @@ -1668,7 +1714,7 @@ ... - + :/icons/help.ico:/icons/help.ico @@ -1708,7 +1754,7 @@ ... - + :/icons/help.ico:/icons/help.ico @@ -1745,7 +1791,7 @@ 0 0 544 - 421 + 425 @@ -1774,7 +1820,7 @@ Add Global Constant... - + :/icons/add.ico:/icons/add.ico @@ -1840,8 +1886,6 @@
uintspinbox.h
- - - + diff --git a/include/config.h b/include/config.h index 285a86e1..f2353ca4 100644 --- a/include/config.h +++ b/include/config.h @@ -335,7 +335,7 @@ public: this->filePaths.clear(); this->eventIconPaths.clear(); this->pokemonIconPaths.clear(); - this->eventTabIconPath = QString(); + 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); @@ -418,7 +418,7 @@ public: uint16_t unusedTileCovered; uint16_t unusedTileSplit; bool mapAllowFlagsEnabled; - QString eventTabIconPath; + QString eventsTabIconPath; QString collisionSheetPath; QSize collisionSheetSize; QMargins playerViewDistance; diff --git a/src/config.cpp b/src/config.cpp index 6ecce6d4..08e8ba8c 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -894,8 +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 == "event_tab_icon_path") { - this->eventTabIconPath = 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") { @@ -1013,7 +1013,7 @@ QMap 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("event_tab_icon_path", this->eventTabIconPath); + 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())); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 18fbe198..58ce61fe 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1257,10 +1257,10 @@ bool MainWindow::setProjectUI() { // Set a version dependent player icon (or user-chosen icon) for the Events tab. QIcon eventTabIcon; - if (!projectConfig.eventTabIconPath.isEmpty()) { - eventTabIcon = QIcon(projectConfig.eventTabIconPath); + 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.eventTabIconPath)); + logWarn(QString("Failed to load custom Events tab icon '%1'.").arg(projectConfig.eventsTabIconPath)); } } if (eventTabIcon.isNull()) { diff --git a/src/ui/projectsettingseditor.cpp b/src/ui/projectsettingseditor.cpp index 166874ee..de39c09b 100644 --- a/src/ui/projectsettingseditor.cpp +++ b/src/ui/projectsettingseditor.cpp @@ -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, &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()) { + eventsTabIconPath = data.toString(); + if (eventsTabIconPath == "Custom") { + eventsTabIconPath = ui->lineEdit_EventsTabIcon->text(); + } + } + projectConfig.eventsTabIconPath = eventsTabIconPath; + projectConfig.save(); userConfig.save(); porymapConfig.save(); From 91d89a742242a953aeba3d2a36312820ce75203a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 1 May 2025 00:29:08 -0400 Subject: [PATCH 3/3] Fix Qt5 build --- src/ui/projectsettingseditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/projectsettingseditor.cpp b/src/ui/projectsettingseditor.cpp index de39c09b..fa2d3ee2 100644 --- a/src/ui/projectsettingseditor.cpp +++ b/src/ui/projectsettingseditor.cpp @@ -122,7 +122,7 @@ void ProjectSettingsEditor::initUi() { 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, &NoScrollComboBox::currentIndexChanged, [this](int index) { + connect(ui->comboBox_EventsTabIcon, QOverload::of(&NoScrollComboBox::currentIndexChanged), [this](int index) { bool usingCustom = (index == ui->comboBox_EventsTabIcon->findText("Custom")); ui->lineEdit_EventsTabIcon->setVisible(usingCustom); ui->button_EventsTabIcon->setVisible(usingCustom);