2010-02-18 07:27:22 -07:00
|
|
|
// Hotkey and Note Dump
|
2010-02-18 10:06:32 -07:00
|
|
|
// Or Hot Keynote Dump? :P
|
2010-02-18 07:27:22 -07:00
|
|
|
#include <iostream>
|
|
|
|
#include <climits>
|
|
|
|
#include <vector>
|
|
|
|
using namespace std;
|
2010-05-25 22:48:23 -06:00
|
|
|
#include <DFHack.h>
|
2010-02-18 07:27:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
int main (void)
|
|
|
|
{
|
2010-05-23 15:06:10 -06:00
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::Context * DF;
|
2010-03-26 06:01:46 -06:00
|
|
|
try
|
2010-02-18 07:27:22 -07:00
|
|
|
{
|
2010-05-23 15:06:10 -06:00
|
|
|
DF = DFMgr.getSingleContext();
|
|
|
|
DF->Attach();
|
2010-03-26 06:01:46 -06:00
|
|
|
}
|
|
|
|
catch (exception& e)
|
|
|
|
{
|
|
|
|
cerr << e.what() << endl;
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cin.ignore();
|
|
|
|
#endif
|
2010-02-18 07:27:22 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-08-20 06:10:05 -06:00
|
|
|
DFHack::VersionInfo * mem = DF->getMemoryInfo();
|
2011-03-18 04:38:37 -06:00
|
|
|
DFHack::Gui * Gui = DF->getGui();
|
2010-02-18 07:27:22 -07:00
|
|
|
// get stone matgloss mapping
|
2010-04-10 18:32:50 -06:00
|
|
|
/*
|
2010-02-18 10:06:32 -07:00
|
|
|
uint32_t numNotes;
|
|
|
|
if(!DF.InitReadNotes(numNotes))
|
|
|
|
{
|
|
|
|
cerr << "Can't get notes" << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
2010-04-10 18:32:50 -06:00
|
|
|
*/
|
|
|
|
/*
|
2010-02-18 10:06:32 -07:00
|
|
|
cout << "Notes" << endl;
|
2010-02-18 07:27:22 -07:00
|
|
|
for(uint32_t i = 0; i < numNotes; i++)
|
|
|
|
{
|
2010-02-18 10:06:32 -07:00
|
|
|
DFHack::t_note temp;
|
|
|
|
DF.ReadNote(i,temp);
|
|
|
|
cout << "x: " << temp.x << "\ty: " << temp.y << "\tz: " << temp.z <<
|
|
|
|
"\tsymbol: " << temp.symbol << "\tfg: " << temp.foreground << "\tbg: " << temp.background <<
|
|
|
|
"\ttext: " << temp.name << endl;
|
|
|
|
}
|
2010-04-10 18:32:50 -06:00
|
|
|
*/
|
2010-02-18 10:06:32 -07:00
|
|
|
cout << "Hotkeys" << endl;
|
|
|
|
DFHack::t_hotkey hotkeys[NUM_HOTKEYS];
|
2011-03-18 04:38:37 -06:00
|
|
|
Gui->ReadHotkeys(hotkeys);
|
2010-02-18 10:06:32 -07:00
|
|
|
for(uint32_t i =0;i< NUM_HOTKEYS;i++)
|
|
|
|
{
|
|
|
|
cout << "x: " << hotkeys[i].x << "\ty: " << hotkeys[i].y << "\tz: " << hotkeys[i].z <<
|
|
|
|
"\ttext: " << hotkeys[i].name << endl;
|
|
|
|
}
|
2010-04-10 18:32:50 -06:00
|
|
|
//DF.FinishReadNotes();
|
2010-05-23 15:06:10 -06:00
|
|
|
DF->Detach();
|
2010-02-18 07:27:22 -07:00
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
|
|
|
cin.ignore();
|
|
|
|
#endif
|
|
|
|
return 0;
|
2010-05-01 18:38:18 -06:00
|
|
|
}
|
|
|
|
|