diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-08-18 14:15:07 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-08-18 14:15:07 +1000 |
commit | 76a00ac5c957620756f00f7e0ff48ace7a0cf98d (patch) | |
tree | 461cb20ba55df3c5b5292452e6b5eb40fdf22a2b /source/frontend/StarInventory.cpp | |
parent | d7065e7611b4c00e4f33c62f4da2bb9cff7170bd (diff) |
Update StarInventory.cpp
Diffstat (limited to 'source/frontend/StarInventory.cpp')
-rw-r--r-- | source/frontend/StarInventory.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp index 55f99d6..3730c9b 100644 --- a/source/frontend/StarInventory.cpp +++ b/source/frontend/StarInventory.cpp @@ -238,7 +238,8 @@ PanePtr InventoryPane::createTooltip(Vec2I const& screenPosition) { if (auto techIcon = fetchChild<ImageWidget>(strf("tech{}", p.second))) { if (techIcon->screenBoundRect().contains(screenPosition)) { if (auto techModule = m_player->techs()->equippedTechs().maybe(p.first)) - return SimpleTooltipBuilder::buildTooltip(techDatabase->tech(*techModule).description); + if (techDatabase->contains(*techModule)) + return SimpleTooltipBuilder::buildTooltip(techDatabase->tech(*techModule).description); } } } @@ -325,10 +326,13 @@ void InventoryPane::update(float dt) { auto techDatabase = Root::singleton().techDatabase(); for (auto const& p : TechTypeNames) { if (auto techIcon = fetchChild<ImageWidget>(strf("tech{}", p.second))) { - if (auto techModule = m_player->techs()->equippedTechs().maybe(p.first)) - techIcon->setImage(techDatabase->tech(*techModule).icon); - else - techIcon->setImage(""); + if (auto techModule = m_player->techs()->equippedTechs().maybe(p.first)) { + if (techDatabase->contains(*techModule)) { + techIcon->setImage(techDatabase->tech(*techModule).icon); + continue; + } + } + techIcon->setImage(""); } } |