Added force pause tool, forum posted linux 31.16 offsets (not complete).

develop
Petr Mrázek 2010-11-07 09:49:33 +01:00
parent 457b331be7
commit 8a675364e5
3 changed files with 54 additions and 1 deletions

@ -2226,8 +2226,17 @@
</Offsets> </Offsets>
</Version> </Version>
<Version name="v0.31.16 linux" os="linux" base="DF2010"> <Version name="v0.31.16 linux" os="linux" base="v0.31.14 linux" rebase="0x1b40">
<MD5 value="9cca2fa5da509e2f9a1042ddd1f9669c" /> <MD5 value="9cca2fa5da509e2f9a1042ddd1f9669c" />
<Offsets>
<Group name="Position">
<Address name="cursor_xyz" value="0x8b33550 0x8b311f8" />
<Address name="screen_tiles_pointer" invalid = "true" />
</Group>
<Group name="GUI">
<Address name="pause_state" value="0x92e5cb0"/>
</Group>
</Offsets>
</Version> </Version>
</DFHack> </DFHack>

@ -9,6 +9,10 @@ ENDIF(UNIX)
ADD_EXECUTABLE(dfreveal reveal.cpp) ADD_EXECUTABLE(dfreveal reveal.cpp)
TARGET_LINK_LIBRARIES(dfreveal dfhack) 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 # prospector - produces a list of available materials and their quantities
ADD_EXECUTABLE(dfprospector prospector.cpp) ADD_EXECUTABLE(dfprospector prospector.cpp)
TARGET_LINK_LIBRARIES(dfprospector dfhack) TARGET_LINK_LIBRARIES(dfprospector dfhack)
@ -113,6 +117,7 @@ dfvdig
dfcleanmap dfcleanmap
dfunstuck dfunstuck
dfprobe dfprobe
dfpause
dfdoffsets dfdoffsets
dfattachtest dfattachtest
dfcleartask dfcleartask

@ -0,0 +1,39 @@
// This forces the game to pause.
#include <iostream>
#include <vector>
#include <map>
using namespace std;
#include <DFHack.h>
#include <dfhack/modules/Gui.h>
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;
}