Set transparency on pokemon icons

This commit is contained in:
GriffinR 2023-01-19 15:09:27 -05:00
parent a2aa5c0129
commit 73d0cb8933
2 changed files with 4 additions and 1 deletions

View file

@ -18,6 +18,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
- Hovering on border metatiles with the mouse will now display their information in the bottom bar. - Hovering on border metatiles with the mouse will now display their information in the bottom bar.
- The last-used directory is now preserved in import/export file dialogs. - The last-used directory is now preserved in import/export file dialogs.
- Encounter editing has been slightly modified in favor of a more performant ui. - Encounter editing has been slightly modified in favor of a more performant ui.
- Pokémon icons in the encounter editor have their transparency set.
### Fixed ### Fixed
- Fix the Region Map Editor being opened by the Shortcuts Editor. - Fix the Region Map Editor being opened by the Shortcuts Editor.

View file

@ -16,7 +16,9 @@ void SpeciesComboDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
QPixmap pm; QPixmap pm;
if (!QPixmapCache::find(species, &pm)) { if (!QPixmapCache::find(species, &pm)) {
pm.load(this->project->speciesToIconPath.value(species)); QImage img(this->project->speciesToIconPath.value(species));
img.setColor(0, qRgba(0, 0, 0, 0));
pm = QPixmap::fromImage(img);
QPixmapCache::insert(species, pm); QPixmapCache::insert(species, pm);
} }
QPixmap monIcon = pm.copy(0, 0, 32, 32); QPixmap monIcon = pm.copy(0, 0, 32, 32);