diff options
| author | jj | 2012-07-05 18:03:02 +0200 |
|---|---|---|
| committer | jj | 2012-07-05 18:03:02 +0200 |
| commit | 8e17ebbefc5da79b34219b87b310038af1077871 (patch) | |
| tree | 67d844e935af4f21a5da87964fba156657b163cf /library/Core.cpp | |
| parent | 70740481463bbde3f078b612e529e6c7a3b6704d (diff) | |
| download | dfhack-8e17ebbefc5da79b34219b87b310038af1077871.tar.gz dfhack-8e17ebbefc5da79b34219b87b310038af1077871.tar.bz2 dfhack-8e17ebbefc5da79b34219b87b310038af1077871.tar.xz | |
add SC_PAUSED / SC_UNPAUSED onStateChange events
Diffstat (limited to 'library/Core.cpp')
| -rw-r--r-- | library/Core.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/library/Core.cpp b/library/Core.cpp index 59334906..826576b7 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -752,6 +752,7 @@ Core::Core() misc_data_mutex=0; last_world_data_ptr = NULL; last_local_map_ptr = NULL; + last_pause_state = false; top_viewscreen = NULL; screen_window = NULL; server = NULL; @@ -1116,6 +1117,15 @@ int Core::Update() } } + if (df::global::pause_state) + { + if (*df::global::pause_state != last_pause_state) + { + onStateChange(out, last_pause_state ? SC_UNPAUSED : SC_PAUSED); + last_pause_state = *df::global::pause_state; + } + } + // Execute per-frame handlers onUpdate(out); |
