summaryrefslogtreecommitdiff
path: root/src/smallmap_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-08-08 11:17:14 +0000
committeralberth <alberth@openttd.org>2010-08-08 11:17:14 +0000
commit2fa665114e5cd9136b80e8a5e91a3418986a41d0 (patch)
treedfc951787aa83c8fcf64d34a078d500ea5755030 /src/smallmap_gui.cpp
parent7362ff44095c1d7362c12cdc0590ad1a38817d86 (diff)
downloadopenttd-2fa665114e5cd9136b80e8a5e91a3418986a41d0.tar.xz
(svn r20414) -Feature: Enable industries in the smallmap displayed in the industry chain window.
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r--src/smallmap_gui.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index af2cc1e6a..e73401c32 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1278,6 +1278,21 @@ public:
}
}
+ /**
+ * Notifications for the smallmap window.
+ * - data = 0: Displayed industries at the industry chain window have changed.
+ */
+ virtual void OnInvalidateData(int data)
+ {
+ extern uint64 _displayed_industries;
+ if (this->map_type != SMT_INDUSTRY) this->SwitchMapType(SMT_INDUSTRY);
+
+ for (int i = 0; i != _smallmap_industry_count; i++) {
+ _legend_from_industries[i].show_on_map = HasBit(_displayed_industries, _legend_from_industries[i].u.type);
+ }
+ this->SetDirty();
+ }
+
virtual bool OnRightClick(Point pt, int widget)
{
if (widget != SM_WIDGET_MAP || _scrolling_viewport) return false;