changeset 8179:a0879dc1b54d draft

(svn r11742) -Codechange [FS#1319]: Run window tick events when paused, so that news pop-ups and the about window still progress. For other windows the events are ignored when paused.
author peter1138 <peter1138@openttd.org>
date Tue, 01 Jan 2008 22:34:00 +0000
parents 682fb03eb247
children 911146378e00
files src/graph_gui.cpp src/group_gui.cpp src/industry_gui.cpp src/openttd.cpp src/station_gui.cpp src/vehicle_gui.cpp
diffstat 6 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -1102,6 +1102,8 @@
 		}
 
 		case WE_TICK:
+			if (_pause_game != 0) break;
+
 			/* Update the player score every 5 days */
 			if (--w->custom[0] == 0) {
 				w->custom[0] = DAY_TICKS;
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -752,6 +752,7 @@
 
 
 		case WE_TICK: // resort the lists every 20 seconds orso (10 days)
+			if (_pause_game != 0) break;
 			if (--gv->l.resort_timer == 0) {
 				gv->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
 				gv->l.flags |= VL_RESORT;
@@ -763,7 +764,7 @@
 				SetWindowDirty(w);
 			}
 			break;
-		}
+	}
 }
 
 
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -297,6 +297,7 @@
 		} break;
 
 		case WE_TICK:
+			if (_pause_game != 0) break;
 			if (!WP(w, fnd_d).timer_enabled) break;
 			if (--WP(w, fnd_d).callback_timer == 0) {
 				/* We have just passed another day.
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -962,7 +962,10 @@
 	ClearStorageChanges(false);
 
 	/* dont execute the state loop during pause */
-	if (_pause_game) return;
+	if (_pause_game) {
+		CallWindowTickEvent();
+		return;
+	}
 	if (IsGeneratingWorld()) return;
 
 	if (_game_mode == GM_EDITOR) {
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -544,6 +544,7 @@
 			break;
 
 		case WE_TICK:
+			if (_pause_game != 0) break;
 			if (--sl->resort_timer == 0) {
 				DEBUG(misc, 3, "Periodic rebuild station list player %d", owner);
 				sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1157,6 +1157,7 @@
 			break;
 
 		case WE_TICK: /* resort the list every 20 seconds orso (10 days) */
+			if (_pause_game != 0) break;
 			if (--vl->l.resort_timer == 0) {
 				StationID station = ((w->window_number & VLW_MASK) == VLW_STATION_LIST) ? GB(w->window_number, 16, 16) : INVALID_STATION;
 				PlayerID owner = (PlayerID)w->caption_color;