summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-04-07 15:20:24 +0000
committerrubidium <rubidium@openttd.org>2010-04-07 15:20:24 +0000
commitbcce2cabef793ca83dd8d2d3a425b8308be030bf (patch)
tree1f0c0d928b693feaa402d2b4e79e9775a84896e0
parent869fac9964de697eeb41761c3e047eea858023f5 (diff)
downloadopenttd-bcce2cabef793ca83dd8d2d3a425b8308be030bf.tar.xz
(svn r19574) -Fix: graphs were not properly updated when going toggling keys (i.e. companies)
-rw-r--r--src/graph_gui.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp
index 186b3bf8a..7023bc95d 100644
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -88,11 +88,11 @@ struct GraphLegendWindow : Window {
ToggleBit(_legend_excluded_companies, widget - GLW_FIRST_COMPANY);
this->ToggleWidgetLoweredState(widget);
this->SetDirty();
- SetWindowDirty(WC_INCOME_GRAPH, 0);
- SetWindowDirty(WC_OPERATING_PROFIT, 0);
- SetWindowDirty(WC_DELIVERED_CARGO, 0);
- SetWindowDirty(WC_PERFORMANCE_HISTORY, 0);
- SetWindowDirty(WC_COMPANY_VALUE, 0);
+ InvalidateWindowData(WC_INCOME_GRAPH, 0);
+ InvalidateWindowData(WC_OPERATING_PROFIT, 0);
+ InvalidateWindowData(WC_DELIVERED_CARGO, 0);
+ InvalidateWindowData(WC_PERFORMANCE_HISTORY, 0);
+ InvalidateWindowData(WC_COMPANY_VALUE, 0);
}
virtual void OnInvalidateData(int data)
@@ -526,6 +526,11 @@ public:
this->UpdateStatistics(false);
}
+ virtual void OnInvalidateData(int data)
+ {
+ this->OnTick();
+ }
+
/**
* Update the statistics.
* @param initialize Initialize the data structure.
@@ -956,6 +961,11 @@ struct PaymentRatesGraphWindow : BaseGraphWindow {
/* Override default OnTick */
}
+ virtual void OnInvalidateData(int data)
+ {
+ this->OnHundredthTick();
+ }
+
virtual void OnHundredthTick()
{
this->UpdateExcludedData();