diff options
author | peter1138 <peter1138@openttd.org> | 2008-01-01 22:34:00 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-01-01 22:34:00 +0000 |
commit | 890296c125e11438c82371405744b51a2d58eb06 (patch) | |
tree | 0457000dece8ef1a1e93d2d81127d4772fae6376 /src | |
parent | 5c237780650517d674739f7b4eecaaed1f085109 (diff) | |
download | openttd-890296c125e11438c82371405744b51a2d58eb06.tar.xz |
(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.
Diffstat (limited to 'src')
-rw-r--r-- | src/graph_gui.cpp | 2 | ||||
-rw-r--r-- | src/group_gui.cpp | 3 | ||||
-rw-r--r-- | src/industry_gui.cpp | 1 | ||||
-rw-r--r-- | src/openttd.cpp | 5 | ||||
-rw-r--r-- | src/station_gui.cpp | 1 | ||||
-rw-r--r-- | src/vehicle_gui.cpp | 1 |
6 files changed, 11 insertions, 2 deletions
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 96aa63b90..eb94a8325 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1102,6 +1102,8 @@ static void PerformanceRatingDetailWndProc(Window *w, WindowEvent *e) } 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; diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 5bcb554a2..e7368312c 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -752,6 +752,7 @@ static void GroupWndProc(Window *w, WindowEvent *e) 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 @@ static void GroupWndProc(Window *w, WindowEvent *e) SetWindowDirty(w); } break; - } + } } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index f90c8e6a1..a6eeb2e38 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -297,6 +297,7 @@ static void BuildDynamicIndustryWndProc(Window *w, WindowEvent *e) } 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. diff --git a/src/openttd.cpp b/src/openttd.cpp index 8fbdd0b11..b4f64e10c 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -962,7 +962,10 @@ void StateGameLoop() 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) { diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 0da9f32e7..cf19c1969 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -544,6 +544,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e) 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; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index bfdcd8baf..fb30a8618 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1157,6 +1157,7 @@ void PlayerVehWndProc(Window *w, WindowEvent *e) 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; |