|
|
@ -17,9 +17,9 @@ std::ostream &operator<<(std::ostream &stream, DFHack::t_gamemodes funzies)
|
|
|
|
"Legends",
|
|
|
|
"Legends",
|
|
|
|
"Menus",
|
|
|
|
"Menus",
|
|
|
|
"Arena",
|
|
|
|
"Arena",
|
|
|
|
"Arena - Assumed",
|
|
|
|
"Arena - Assumed",
|
|
|
|
"Kittens!",
|
|
|
|
"Kittens!",
|
|
|
|
"Worldgen"
|
|
|
|
"Worldgen"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
char * cm[]=
|
|
|
|
char * cm[]=
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -48,15 +48,19 @@ int main (int argc, char** argv)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DFHack::Gui * Gui = 0;
|
|
|
|
DFHack::Gui * Gui = 0;
|
|
|
|
|
|
|
|
DFHack::Maps * Maps = 0;
|
|
|
|
DFHack::World * World = 0;
|
|
|
|
DFHack::World * World = 0;
|
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::Context * DF;
|
|
|
|
DFHack::Context * DF;
|
|
|
|
|
|
|
|
bool have_maps = false;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DF = DFMgr.getSingleContext();
|
|
|
|
DF = DFMgr.getSingleContext();
|
|
|
|
DF->Attach();
|
|
|
|
DF->Attach();
|
|
|
|
Gui = DF->getGui();
|
|
|
|
Gui = DF->getGui();
|
|
|
|
|
|
|
|
Maps = DF->getMaps();
|
|
|
|
World = DF->getWorld();
|
|
|
|
World = DF->getWorld();
|
|
|
|
|
|
|
|
have_maps = Maps->Start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (exception& e)
|
|
|
|
catch (exception& e)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -77,13 +81,29 @@ int main (int argc, char** argv)
|
|
|
|
<< " Tick: " << World->ReadCurrentTick() << endl;
|
|
|
|
<< " Tick: " << World->ReadCurrentTick() << endl;
|
|
|
|
if (Gui)
|
|
|
|
if (Gui)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int32_t x,y,z;
|
|
|
|
int32_t vx,vy,vz;
|
|
|
|
|
|
|
|
int32_t cx,cy,cz;
|
|
|
|
|
|
|
|
int32_t wx,wy,wz;
|
|
|
|
int32_t width,height;
|
|
|
|
int32_t width,height;
|
|
|
|
|
|
|
|
if(have_maps)
|
|
|
|
if(Gui->getViewCoords(x,y,z))
|
|
|
|
{
|
|
|
|
cout << "view coords: " << x << "/" << y << "/" << z << endl;
|
|
|
|
Maps->getPosition(wx,wy,wz);
|
|
|
|
if(Gui->getCursorCoords(x,y,z))
|
|
|
|
cout << "Map world offset: " << wx << "/" << wy << "/" << wz << " embark squares." << endl;
|
|
|
|
cout << "cursor coords: " << x << "/" << y << "/" << z << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool have_cursor = Gui->getCursorCoords(cx,cy,cz);
|
|
|
|
|
|
|
|
bool have_view = Gui->getViewCoords(vx,vy,vz);
|
|
|
|
|
|
|
|
if(have_view)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << "view coords: " << vx << "/" << vy << "/" << vz << endl;
|
|
|
|
|
|
|
|
if(have_maps)
|
|
|
|
|
|
|
|
cout << " world: " << vx+wx*48 << "/" << vy+wy*48 << "/" << vz+wz << endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(have_cursor)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << "cursor coords: " << cx << "/" << cy << "/" << cz << endl;
|
|
|
|
|
|
|
|
if(have_maps)
|
|
|
|
|
|
|
|
cout << " world: " << cx+wx*48 << "/" << cy+wy*48 << "/" << cz+wz << endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
if(Gui->getWindowSize(width,height))
|
|
|
|
if(Gui->getWindowSize(width,height))
|
|
|
|
cout << "window size : " << width << " " << height << endl;
|
|
|
|
cout << "window size : " << width << " " << height << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|