From 8a675364e5d545ce5d04ee16ae0a1ce7fcb4d3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 7 Nov 2010 09:49:33 +0100 Subject: [PATCH] Added force pause tool, forum posted linux 31.16 offsets (not complete). --- data/Memory-ng.xml | 11 +++++++++- tools/supported/CMakeLists.txt | 5 +++++ tools/supported/forcepause.cpp | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tools/supported/forcepause.cpp diff --git a/data/Memory-ng.xml b/data/Memory-ng.xml index a8576e88f..3cf4be3e7 100644 --- a/data/Memory-ng.xml +++ b/data/Memory-ng.xml @@ -2226,8 +2226,17 @@ - + + + +
+
+ + +
+ + diff --git a/tools/supported/CMakeLists.txt b/tools/supported/CMakeLists.txt index 22482f5ea..bc080448a 100644 --- a/tools/supported/CMakeLists.txt +++ b/tools/supported/CMakeLists.txt @@ -9,6 +9,10 @@ ENDIF(UNIX) ADD_EXECUTABLE(dfreveal reveal.cpp) TARGET_LINK_LIBRARIES(dfreveal dfhack) +# force pause! +ADD_EXECUTABLE(dfpause forcepause.cpp) +TARGET_LINK_LIBRARIES(dfpause dfhack) + # prospector - produces a list of available materials and their quantities ADD_EXECUTABLE(dfprospector prospector.cpp) TARGET_LINK_LIBRARIES(dfprospector dfhack) @@ -113,6 +117,7 @@ dfvdig dfcleanmap dfunstuck dfprobe +dfpause dfdoffsets dfattachtest dfcleartask diff --git a/tools/supported/forcepause.cpp b/tools/supported/forcepause.cpp new file mode 100644 index 000000000..521859078 --- /dev/null +++ b/tools/supported/forcepause.cpp @@ -0,0 +1,39 @@ +// This forces the game to pause. + +#include +#include +#include +using namespace std; + +#include +#include + +int main (void) +{ + DFHack::ContextManager DFMgr("Memory.xml"); + DFHack::Context *DF; + try + { + DF = DFMgr.getSingleContext(); + DF->Attach(); + } + catch (exception& e) + { + cerr << e.what() << endl; + #ifndef LINUX_BUILD + cin.ignore(); + #endif + return 1; + } + + DFHack::Gui *Gui =DF->getGui(); + cout << "Pausing..." << endl; + + Gui->SetPauseState(true); + DF->Resume(); + #ifndef LINUX_BUILD + cout << "Done. The current game frame will have to finish first. This can take some time on bugged maps." << endl; + cin.ignore(); + #endif + return 0; +}