# HG changeset patch # User adf88@interia.pl # Date 1499796264 -7200 # Tue Jul 11 20:04:24 2017 +0200 # Branch trunk # Node ID 8ca4ed947e1b47c1f819a3016ee734c3553481d3 # Parent 0d78b96563c56d72f798bf6767cf6ca5a2ac00c1 Break "link" between industry chain and smallmap windows only when needed. diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1275,6 +1275,8 @@ this->SetupWidgetData(); if (map_type == SMT_LINKSTATS) this->overlay->RebuildCache(); + + this->SetDirty(); } @@ -1380,9 +1382,6 @@ /* virtual */ void SmallMapWindow::OnClick(Point pt, int widget, int click_count) { - /* User clicked something, notify the industry chain window to stop sending newly selected industries. */ - InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES); - switch (widget) { case WID_SM_MAP: { // Map window /* @@ -1423,6 +1422,7 @@ case WID_SM_OWNERS: // Show land owners this->SwitchMapType((SmallMapType)(widget - WID_SM_CONTOUR)); if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); + if (widget != WID_SM_INDUSTRIES) InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES); // Notify the industry chain window to stop sending newly selected industries. break; case WID_SM_CENTERMAP: // Center the smallmap again @@ -1449,6 +1449,7 @@ /* If click on industries label, find right industry type and enable/disable it. */ if (click_pos < _smallmap_industry_count) { this->SelectLegendItem(click_pos, _legend_from_industries, _smallmap_industry_count); + InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES); // Notify the industry chain window to stop sending newly selected industries. } } else if (this->map_type == SMT_LINKSTATS) { if (click_pos < _smallmap_cargo_count) { @@ -1471,6 +1472,7 @@ switch (this->map_type) { case SMT_INDUSTRY: tbl = _legend_from_industries; + InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES); // Notify the industry chain window to stop sending newly selected industries. break; case SMT_OWNER: tbl = &(_legend_land_owners[NUM_NO_COMPANY_ENTRIES]);