diff options
author | alberth <alberth@openttd.org> | 2010-02-14 15:35:44 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-02-14 15:35:44 +0000 |
commit | 8641f08df3335d11513fa0363e752d79adfad50c (patch) | |
tree | 4d8e2d76d2db9d3c51d86d82731fd143103ab8c7 /src | |
parent | e8d40d6a1987220137e386b1f505947de8d8b514 (diff) | |
download | openttd-8641f08df3335d11513fa0363e752d79adfad50c.tar.xz |
(svn r19129) -Fix [FS#3623] (r19122): Don't draw cargo ratings/acceptance when the window is shaded.
Diffstat (limited to 'src')
-rw-r--r-- | src/station_gui.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
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<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) { - 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<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) { + 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<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); |