summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-02-13 18:41:31 +0000
committeralberth <alberth@openttd.org>2010-02-13 18:41:31 +0000
commit1737292d0710c7a61bb5a667395bc892c97414e1 (patch)
treeb997a9b3b4bac5c2da038720da5a61bffdeacacf
parentdf920582afd09f9bd61955232e7260d94b93b6de (diff)
downloadopenttd-1737292d0710c7a61bb5a667395bc892c97414e1.tar.xz
(svn r19122) -Codechange: Move cargo drawing to StationViewWindow::OnPaint().
-rw-r--r--src/station_gui.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index c95feadc2..a1201eda3 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -951,22 +951,19 @@ struct StationViewWindow : public Window {
this->DrawWidgets();
- if (!this->IsShaded()) {
- NWidgetBase *nwi = this->GetWidget<NWidgetBase>(SVW_WAITING);
- Rect waiting_rect = {nwi->pos_x, nwi->pos_y, nwi->pos_x + nwi->current_x - 1, nwi->pos_y + nwi->current_y - 1};
- this->DrawWaitingCargo(waiting_rect, cargolist, transfers);
- }
- }
-
- virtual void DrawWidget(const Rect &r, int widget) const
- {
- if (widget != SVW_ACCEPTLIST) return;
-
+ const NWidgetBase *wid = this->GetWidget<NWidgetBase>(SVW_ACCEPTLIST);
+ const Rect r = {wid->pos_x, wid->pos_y, wid->pos_x + wid->current_x - 1, wid->pos_y + wid->current_y - 1};
if (this->GetWidget<NWidgetCore>(SVW_ACCEPTS)->widget_data == STR_STATION_VIEW_RATINGS_BUTTON) {
this->DrawAcceptedCargo(r);
} else {
this->DrawCargoRatings(r);
}
+
+ if (!this->IsShaded()) {
+ NWidgetBase *nwi = this->GetWidget<NWidgetBase>(SVW_WAITING);
+ Rect waiting_rect = {nwi->pos_x, nwi->pos_y, nwi->pos_x + nwi->current_x - 1, nwi->pos_y + nwi->current_y - 1};
+ this->DrawWaitingCargo(waiting_rect, cargolist, transfers);
+ }
}
virtual void SetStringParameters(int widget) const