misc_gui.c
changeset 998 c90459c24842
parent 980 6b3163c417ab
child 1009 75140dc68759
equal deleted inserted replaced
997:fa7a654d23ca 998:c90459c24842
   205 
   205 
   206 static void AboutWindowProc(Window *w, WindowEvent *e)
   206 static void AboutWindowProc(Window *w, WindowEvent *e)
   207 {
   207 {
   208 	switch(e->event) {
   208 	switch(e->event) {
   209 	case WE_CREATE: /* Set up window counter and start position of scroller */
   209 	case WE_CREATE: /* Set up window counter and start position of scroller */
   210 		WP(w, general_d).i = 0;
   210 		WP(w, scroller_d).counter = 0;
   211 		WP(w, general_d).j = w->height - 40;
   211 		WP(w, scroller_d).height = w->height - 40;
   212 		break;
   212 		break;
   213 	case WE_PAINT: {
   213 	case WE_PAINT: {
   214 		const char *str;
   214 		const char *str;
   215 		char buffer[100];
   215 		char buffer[100];
   216 		uint i;
   216 		uint i;
   217 		int y = WP(w, general_d).j;
   217 		int y = WP(w, scroller_d).height;
   218 		DrawWindowWidgets(w);
   218 		DrawWindowWidgets(w);
   219 
   219 
   220 		// Show original copyright and revision version
   220 		// Show original copyright and revision version
   221 		DrawStringCentered(200, 17, STR_00B6_ORIGINAL_COPYRIGHT, 0);
   221 		DrawStringCentered(200, 17, STR_00B6_ORIGINAL_COPYRIGHT, 0);
   222 		DrawStringCentered(200, 17 + 10, STR_00B7_VERSION, 0);
   222 		DrawStringCentered(200, 17 + 10, STR_00B7_VERSION, 0);
   237 			}
   237 			}
   238 			y += 10;
   238 			y += 10;
   239 		}
   239 		}
   240 
   240 
   241 		// If the last text has scrolled start anew from the start
   241 		// If the last text has scrolled start anew from the start
   242 		if (y < 50) WP(w, general_d).j = w->height - 40;
   242 		if (y < 50) WP(w, scroller_d).height = w->height - 40;
   243 
   243 
   244 		DrawStringMultiCenter(200, w->height - 15, STR_00BA_COPYRIGHT_OPENTTD, 398);
   244 		DrawStringMultiCenter(200, w->height - 15, STR_00BA_COPYRIGHT_OPENTTD, 398);
   245 	}	break;
   245 	}	break;
   246 	case WE_MOUSELOOP: /* Timer to scroll the text and adjust the new top */
   246 	case WE_MOUSELOOP: /* Timer to scroll the text and adjust the new top */
   247 		if (WP(w, general_d).i++ % 3 == 0) {
   247 		if (WP(w, scroller_d).counter++ % 3 == 0) {
   248 			WP(w, general_d).j--;
   248 			WP(w, scroller_d).height--;
   249 			SetWindowDirty(w);
   249 			SetWindowDirty(w);
   250 		}
   250 		}
   251 		break;
   251 		break;
   252 	}
   252 	}
   253 }
   253 }