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 <integers.h>
|
|
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include <DFTypes.h>
|
|
|
|
#include <DFHackAPI.h>
|
|
|
|
#include <DFMemInfo.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main (void)
|
|
|
|
{
|
|
|
|
vector<DFHack::t_matgloss> creaturestypes;
|
|
|
|
DFHack::API DF("Memory.xml");
|
|
|
|
if(!DF.Attach())
|
|
|
|
{
|
|
|
|
cerr << "DF not found" << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-02-18 10:06:32 -07:00
|
|
|
DFHack::memory_info mem = DF.getMemoryInfo();
|
2010-02-18 07:27:22 -07:00
|
|
|
// get stone matgloss mapping
|
2010-02-18 10:06:32 -07:00
|
|
|
uint32_t numNotes;
|
|
|
|
if(!DF.InitReadNotes(numNotes))
|
|
|
|
{
|
|
|
|
cerr << "Can't get notes" << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if(!DF.InitReadHotkeys())
|
|
|
|
{
|
|
|
|
cerr << "Can't get hotkeys" << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
cout << "Hotkeys" << endl;
|
|
|
|
DFHack::t_hotkey hotkeys[NUM_HOTKEYS];
|
|
|
|
DF.ReadHotkeys(hotkeys);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
DF.FinishReadNotes();
|
|
|
|
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;
|
|
|
|
}
|