From 1737292d0710c7a61bb5a667395bc892c97414e1 Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 13 Feb 2010 18:41:31 +0000 Subject: (svn r19122) -Codechange: Move cargo drawing to StationViewWindow::OnPaint(). --- src/station_gui.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src') 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(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(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(SVW_ACCEPTS)->widget_data == STR_STATION_VIEW_RATINGS_BUTTON) { this->DrawAcceptedCargo(r); } else { this->DrawCargoRatings(r); } + + if (!this->IsShaded()) { + NWidgetBase *nwi = this->GetWidget(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 -- cgit v1.2.3-54-g00ecf