Update StarInventory.cpp
This commit is contained in:
parent
d7065e7611
commit
76a00ac5c9
@ -238,7 +238,8 @@ PanePtr InventoryPane::createTooltip(Vec2I const& screenPosition) {
|
|||||||
if (auto techIcon = fetchChild<ImageWidget>(strf("tech{}", p.second))) {
|
if (auto techIcon = fetchChild<ImageWidget>(strf("tech{}", p.second))) {
|
||||||
if (techIcon->screenBoundRect().contains(screenPosition)) {
|
if (techIcon->screenBoundRect().contains(screenPosition)) {
|
||||||
if (auto techModule = m_player->techs()->equippedTechs().maybe(p.first))
|
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();
|
auto techDatabase = Root::singleton().techDatabase();
|
||||||
for (auto const& p : TechTypeNames) {
|
for (auto const& p : TechTypeNames) {
|
||||||
if (auto techIcon = fetchChild<ImageWidget>(strf("tech{}", p.second))) {
|
if (auto techIcon = fetchChild<ImageWidget>(strf("tech{}", p.second))) {
|
||||||
if (auto techModule = m_player->techs()->equippedTechs().maybe(p.first))
|
if (auto techModule = m_player->techs()->equippedTechs().maybe(p.first)) {
|
||||||
techIcon->setImage(techDatabase->tech(*techModule).icon);
|
if (techDatabase->contains(*techModule)) {
|
||||||
else
|
techIcon->setImage(techDatabase->tech(*techModule).icon);
|
||||||
techIcon->setImage("");
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
techIcon->setImage("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user