From 8641f08df3335d11513fa0363e752d79adfad50c Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 14 Feb 2010 15:35:44 +0000 Subject: (svn r19129) -Fix [FS#3623] (r19122): Don't draw cargo ratings/acceptance when the window is shaded. --- src/station_gui.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'src/station_gui.cpp') diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 14961b110..6efb569f2 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -951,25 +951,27 @@ struct StationViewWindow : public Window { this->DrawWidgets(); - 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) { - int lines = this->DrawAcceptedCargo(r); - if (lines > this->accepts_lines) { // Resize the widget, and perform re-initialization of the window. - this->accepts_lines = lines; - this->ReInit(); - return; - } - } else { - int lines = this->DrawCargoRatings(r); - if (lines > this->rating_lines) { // Resize the widget, and perform re-initialization of the window. - this->rating_lines = lines; - this->ReInit(); - return; + if (!this->IsShaded()) { + /* Draw 'accepted cargo' or 'cargo ratings'. */ + 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) { + int lines = this->DrawAcceptedCargo(r); + if (lines > this->accepts_lines) { // Resize the widget, and perform re-initialization of the window. + this->accepts_lines = lines; + this->ReInit(); + return; + } + } else { + int lines = this->DrawCargoRatings(r); + if (lines > this->rating_lines) { // Resize the widget, and perform re-initialization of the window. + this->rating_lines = lines; + this->ReInit(); + return; + } } - } - if (!this->IsShaded()) { + /* Draw waiting cargo. */ 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); -- cgit v1.2.3-54-g00ecf