changeset 14551:dbe661cf8f1a draft

(svn r19122) -Codechange: Move cargo drawing to StationViewWindow::OnPaint().
author alberth <alberth@openttd.org>
date Sat, 13 Feb 2010 18:41:31 +0000
parents 4af05493a954
children f9f42b8a5a4d
files src/station_gui.cpp
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -951,6 +951,14 @@
 
 		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) {
+			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};
@@ -958,17 +966,6 @@
 		}
 	}
 
-	virtual void DrawWidget(const Rect &r, int widget) const
-	{
-		if (widget != SVW_ACCEPTLIST) return;
-
-		if (this->GetWidget<NWidgetCore>(SVW_ACCEPTS)->widget_data == STR_STATION_VIEW_RATINGS_BUTTON) {
-			this->DrawAcceptedCargo(r);
-		} else {
-			this->DrawCargoRatings(r);
-		}
-	}
-
 	virtual void SetStringParameters(int widget) const
 	{
 		if (widget == SVW_CAPTION) {