(svn r2613) - Truncate savegames, and vehicle-texts in their window.
authorDarkvater
Sun, 17 Jul 2005 17:15:33 +0000
changeset 2103 a2b3106d33d5
parent 2102 f70ff7bbc69c
child 2104 eddbaa3137b6
(svn r2613) - Truncate savegames, and vehicle-texts in their window.
- Hardcoded width 5 for saves-path...oops :O
aircraft_gui.c
misc_gui.c
roadveh_gui.c
ship_gui.c
train_gui.c
--- a/aircraft_gui.c	Sun Jul 17 16:22:27 2005 +0000
+++ b/aircraft_gui.c	Sun Jul 17 17:15:33 2005 +0000
@@ -523,10 +523,6 @@
 		SetDParam(1, v->unitnumber);
 		DrawWindowWidgets(w);
 
-		/* draw the flag */
-		DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2,
-			w->widget[5].top + 1);
-
 		if (v->vehstatus & VS_CRASHED) {
 			str = STR_8863_CRASHED;
 		} else if (v->vehstatus & VS_STOPPED) {
@@ -559,8 +555,11 @@
 			}
 		}
 
-		DrawStringCentered((w->widget[5].right - w->widget[5].left) / 2,
-			w->widget[5].top + 1, str, 0);
+		/* draw the flag plus orders */
+		{	int w_width = w->widget[5].right - w->widget[5].left;
+			DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
+			DrawStringCenteredTruncated(w_width / 2 + 6, w->widget[5].top + 1, str, 0, w_width - 8);
+		}
 		DrawWindowViewport(w);
 	} break;
 
--- a/misc_gui.c	Sun Jul 17 16:22:27 2005 +0000
+++ b/misc_gui.c	Sun Jul 17 17:15:33 2005 +0000
@@ -1176,7 +1176,7 @@
 
 	if (str != STR_4006_UNABLE_TO_READ_DRIVE) SetDParam(0, tot);
 	DrawString(2, 37, str, 0);
-	DoDrawStringTruncated(path, 2, 27, 16, 5);
+	DoDrawStringTruncated(path, 2, 27, 16, maxw);
 }
 
 static void MakeSortedSaveGameList(void)
@@ -1245,7 +1245,7 @@
 		pos = w->vscroll.pos;
 		while (pos < _fios_num) {
 			item = _fios_list + pos;
-			DoDrawString(item->title, 4, y, _fios_colors[item->type]);
+			DoDrawStringTruncated(item->title, 4, y, _fios_colors[item->type], w->width - 18);
 			pos++;
 			y+=10;
 			if (y >= w->vscroll.cap*10+w->widget[6].top+1)
--- a/roadveh_gui.c	Sun Jul 17 16:22:27 2005 +0000
+++ b/roadveh_gui.c	Sun Jul 17 17:15:33 2005 +0000
@@ -240,10 +240,6 @@
 		SetDParam(1, v->unitnumber);
 		DrawWindowWidgets(w);
 
-		/* draw the flag */
-		DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2,
-			w->widget[5].top + 1);
-
 		if (v->u.road.crashed_ctr != 0) {
 			str = STR_8863_CRASHED;
 		} else if (v->breakdown_ctr == 1) {
@@ -280,8 +276,11 @@
 			}
 		}
 
-		DrawStringCentered((w->widget[5].right - w->widget[5].left) / 2,
-			w->widget[5].top + 1, str, 0);
+		/* draw the flag plus orders */
+		{	int w_width = w->widget[5].right - w->widget[5].left;
+			DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
+			DrawStringCenteredTruncated(w_width / 2 + 6, w->widget[5].top + 1, str, 0, w_width - 8);
+		}
 		DrawWindowViewport(w);
 	} break;
 
--- a/ship_gui.c	Sun Jul 17 16:22:27 2005 +0000
+++ b/ship_gui.c	Sun Jul 17 17:15:33 2005 +0000
@@ -481,10 +481,6 @@
 		SetDParam(1, v->unitnumber);
 		DrawWindowWidgets(w);
 
-		/* draw the flag */
-		DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2,
-			w->widget[5].top + 1);
-
 		if (v->breakdown_ctr == 1) {
 			str = STR_885C_BROKEN_DOWN;
 		} else if (v->vehstatus & VS_STOPPED) {
@@ -519,8 +515,11 @@
 			}
 		}
 
-		DrawStringCentered((w->widget[5].right - w->widget[5].left) / 2,
-			w->widget[5].top + 1, str, 0);
+		/* draw the flag plus orders */
+		{	int w_width = w->widget[5].right - w->widget[5].left;
+			DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
+			DrawStringCenteredTruncated(w_width / 2 + 6, w->widget[5].top + 1, str, 0, w_width - 8);
+		}
 		DrawWindowViewport(w);
 	} break;
 
--- a/train_gui.c	Sun Jul 17 16:22:27 2005 +0000
+++ b/train_gui.c	Sun Jul 17 17:15:33 2005 +0000
@@ -834,10 +834,6 @@
 		SetDParam(1, v->unitnumber);
 		DrawWindowWidgets(w);
 
-		/* draw the flag */
-		DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2,
-			w->widget[5].top + 1);
-
 		if (v->u.rail.crash_anim_pos != 0) {
 			str = STR_8863_CRASHED;
 		} else if (v->breakdown_ctr == 1) {
@@ -886,8 +882,11 @@
 			}
 		}
 
-		DrawStringCentered((w->widget[5].right - w->widget[5].left) / 2,
-			w->widget[5].top + 1, str, 0);
+		/* draw the flag plus orders */
+		{	int w_width = w->widget[5].right - w->widget[5].left;
+			DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
+			DrawStringCenteredTruncated(w_width / 2 + 6, w->widget[5].top + 1, str, 0, w_width - 8);
+		}
 		DrawWindowViewport(w);
 	}	break;