(svn r12609) -Codechange: Remove wrong comments and give more comments on the drawing part of subsidies
authorbelugas
Mon, 07 Apr 2008 17:02:39 +0000
changeset 10077 c26e0a9c8ce9
parent 9347 e57f43150eaa
child 10078 98d24f8e8628
(svn r12609) -Codechange: Remove wrong comments and give more comments on the drawing part of subsidies
src/subsidy_gui.cpp
--- a/src/subsidy_gui.cpp	Mon Apr 07 15:04:00 2008 +0000
+++ b/src/subsidy_gui.cpp	Mon Apr 07 17:02:39 2008 +0000
@@ -95,6 +95,8 @@
 	int width = w->width - 13;  // scroll bar = 11 + pixel each side
 	y = 15;
 	x = 1;
+
+	/* Section for drawing the offered subisidies */
 	DrawStringTruncated(x, y, STR_2026_SUBSIDIES_ON_OFFER_FOR, TC_FROMSTRING, width);
 	y += 10;
 	num = 0;
@@ -103,9 +105,11 @@
 		if (s->cargo_type != CT_INVALID && s->age < 12) {
 			int x2;
 
+			/* Displays the two offered towns */
 			SetupSubsidyDecodeParam(s, 1);
 			x2 = DrawStringTruncated(x + 2, y, STR_2027_FROM_TO, TC_FROMSTRING, width);
 
+			/* Displays the deadline before voiding the proposal */
 			SetDParam(0, _date - ymd.day + 384 - s->age * 32);
 			DrawStringTruncated(x2, y, STR_2028_BY, TC_FROMSTRING, width - x2);
 			y += 10;
@@ -118,6 +122,7 @@
 		y += 10;
 	}
 
+	/* Section for drawing the already granted subisidies */
 	DrawStringTruncated(x, y + 1, STR_202B_SERVICES_ALREADY_SUBSIDISED, TC_FROMSTRING, width);
 	y += 10;
 	num = 0;
@@ -131,9 +136,11 @@
 			PlayerID player = GetStation(s->to)->owner;
 			SetDParam(3, player);
 
+			/* Displays the two connected stations */
 			xt = DrawStringTruncated(x + 2, y, STR_202C_FROM_TO, TC_FROMSTRING, width - 2);
 
-			if ((xt > 3) && (width - xt) > 9 ) { // do not draw if it will get on the scrollbar or if last drawing did nothing
+			/* Displays the date where the granted subsidy will end */
+			if ((xt > 3) && (width - xt) > 9 ) { // do not draw if previous drawing failed or if it will overlap on scrollbar
 				SetDParam(0, _date - ymd.day + 768 - s->age * 32);
 				DrawStringTruncated(xt, y, STR_202D_UNTIL, TC_FROMSTRING, width - xt);
 			}
@@ -165,8 +172,8 @@
 {    WWT_CAPTION, RESIZE_RIGHT,  13,  11, 307,   0,  13, STR_2025_SUBSIDIES, STR_018C_WINDOW_TITLE_DRAG_THIS},
 {  WWT_STICKYBOX, RESIZE_LR,     13, 308, 319,   0,  13, STR_NULL,           STR_STICKY_BUTTON},
 {      WWT_PANEL, RESIZE_RB,     13,   0, 307,  14, 126, 0x0,                STR_01FD_CLICK_ON_SERVICE_TO_CENTER},
-{  WWT_SCROLLBAR, RESIZE_LRB,    13, 308, 319,  14, 114, 0x0,                STR_0190_SCROLL_BAR_SCROLLS_LIST},  // IDW_SCROLLBAR
-{  WWT_RESIZEBOX, RESIZE_LRTB,   13, 308, 319, 115, 126, 0x0,                STR_RESIZE_BUTTON},                 // IDW_RESIZE
+{  WWT_SCROLLBAR, RESIZE_LRB,    13, 308, 319,  14, 114, 0x0,                STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{  WWT_RESIZEBOX, RESIZE_LRTB,   13, 308, 319, 115, 126, 0x0,                STR_RESIZE_BUTTON},
 
 {   WIDGETS_END},
 };