# HG changeset patch # User alberth # Date 2010-08-08 11:21:24 # Node ID dbce3ee1f4e5aa7ad3ceea7adc70b876d579a792 # Parent acc9b17c80d0db497d896206f2597d10e379eec7 (svn r20415) -Add: Clicking at the smallmap disables updates from the industry chain window. diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2281,11 +2281,21 @@ struct IndustryCargoesWindow : public Wi } /** - * Notify the window to display another industry type. - * @param data The new industry type to display. + * Notify the window about external events. + * - data = 0 .. NUM_INDUSTRYTYPES - 1: Display the chain around the given industry. + * - data = NUM_INDUSTRYTYPES: Stop sending updates to the smallmap window. + * @param data The event. */ virtual void OnInvalidateData(int data) { + if (data == NUM_INDUSTRYTYPES) { + if (this->IsWidgetLowered(ICW_NOTIFY)) { + this->RaiseWidget(ICW_NOTIFY); + this->SetWidgetDirty(ICW_NOTIFY); + } + return; + } + assert(data >= 0 && data < NUM_INDUSTRYTYPES); this->ComputeIndustryDisplay(data); } diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1154,6 +1154,9 @@ public: virtual void 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 SM_WIDGET_MAP: { // Map window /*