Skip to content

Commit

Permalink
Fix industry/station/house tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
ldpl committed Feb 19, 2024
1 parent a853d1a commit 941bbdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/citymania/cm_tooltips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct LandTooltipsWindow : public Window
size->width = std::max(GetStringBoundingBox(CM_STR_LAND_TOOLTIPS_INDUSTRY_NAME).width, size->width);

for (auto &p : ind->produced) {
if (p.cargo == CT_INVALID) continue;
if (!IsValidCargoID(p.cargo)) continue;
const CargoSpec *cs = CargoSpec::Get(p.cargo);
if(cs == NULL) continue;
size->height += line_height;
Expand Down Expand Up @@ -165,7 +165,7 @@ struct LandTooltipsWindow : public Window
ir.top += text_height;

for (auto &p : ind->produced) {
if (p.cargo == CT_INVALID) continue;
if (!IsValidCargoID(p.cargo)) continue;
const CargoSpec *cs = CargoSpec::Get(p.cargo);
if(cs == NULL) continue;
SetDParam(0, cs->name);
Expand Down
7 changes: 7 additions & 0 deletions src/main_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,13 @@ struct MainWindow : Window
return this->viewport->overlay->ShowTooltip(pt, close_cond);
}

void OnMouseOver(Point pt, [[maybe_unused]] int widget) override
{
extern void GuiPrepareTooltipsExtra(Window *parent);
if (_game_mode != GM_MENU && pt.x != -1) GuiPrepareTooltipsExtra(this);
}


/**
* Some data on this window has become invalid.
* @param data Information about the changed data.
Expand Down

0 comments on commit 941bbdd

Please sign in to comment.