Skip to content

Commit

Permalink
Fix unnamed tooltip section not properly updating
Browse files Browse the repository at this point in the history
  • Loading branch information
black-sliver committed Feb 21, 2024
1 parent d24c70b commit 156e5e7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/ui/maptooltip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,19 @@ void MapTooltip::update(Tracker* tracker, std::function<void(Item*, const BaseIt
Widget::Color c = getSectionColor(reachable, cleared);
lbl->setTextColor(c);
// NOTE: currently there will always be only one _sectionLocation since compact is always true
bool compact = true;
if (!_sectionLocations[i].empty()) {
int itemcount = sec.getItemCount() ;
int looted = sec.getItemCleared();
bool opened = compact ? looted>=itemcount : i<=looted;
Item* w = _sectionLocations[i].front();
if (itemcount!=1 && itemcount>looted) {
w->setOverlay(std::to_string(itemcount - looted));
} else {
w->setOverlay("");
}
w->setStage(opened?1:0,0);
}
bool compact = true;
if (!_sectionLocations[i].empty()) {
int itemcount = sec.getItemCount() ;
int looted = sec.getItemCleared();
bool opened = compact ? looted>=itemcount : i<=looted;
Item* w = _sectionLocations[i].front();
if (itemcount!=1 && itemcount>looted) {
w->setOverlay(std::to_string(itemcount - looted));
} else {
w->setOverlay("");
}
w->setStage(opened?1:0,0);
}
i++;
}
Expand Down

0 comments on commit 156e5e7

Please sign in to comment.