|
|
@ -87,6 +87,10 @@ public:
|
|
|
|
uint32_t note_background_offset;
|
|
|
|
uint32_t note_background_offset;
|
|
|
|
uint32_t note_name_offset;
|
|
|
|
uint32_t note_name_offset;
|
|
|
|
uint32_t note_xyz_offset;
|
|
|
|
uint32_t note_xyz_offset;
|
|
|
|
|
|
|
|
uint32_t hotkey_start;
|
|
|
|
|
|
|
|
uint32_t hotkey_mode_offset;
|
|
|
|
|
|
|
|
uint32_t hotkey_xyz_offset;
|
|
|
|
|
|
|
|
uint32_t hotkey_size;
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t dwarf_lang_table_offset;
|
|
|
|
uint32_t dwarf_lang_table_offset;
|
|
|
|
|
|
|
|
|
|
|
@ -104,6 +108,7 @@ public:
|
|
|
|
bool viewSizeInited;
|
|
|
|
bool viewSizeInited;
|
|
|
|
bool itemsInited;
|
|
|
|
bool itemsInited;
|
|
|
|
bool notesInited;
|
|
|
|
bool notesInited;
|
|
|
|
|
|
|
|
bool hotkeyInited;
|
|
|
|
|
|
|
|
|
|
|
|
bool nameTablesInited;
|
|
|
|
bool nameTablesInited;
|
|
|
|
|
|
|
|
|
|
|
@ -130,6 +135,7 @@ API::API (const string path_to_xml)
|
|
|
|
d->viewSizeInited = false;
|
|
|
|
d->viewSizeInited = false;
|
|
|
|
d->itemsInited = false;
|
|
|
|
d->itemsInited = false;
|
|
|
|
d->notesInited = false;
|
|
|
|
d->notesInited = false;
|
|
|
|
|
|
|
|
d->hotkeyInited = false;
|
|
|
|
d->pm = NULL;
|
|
|
|
d->pm = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -902,6 +908,38 @@ bool API::ReadNote (const int32_t &index, t_note & note)
|
|
|
|
g_pProcess->read (temp + d->note_xyz_offset, 3*sizeof (uint16_t), (uint8_t *) ¬e.x);
|
|
|
|
g_pProcess->read (temp + d->note_xyz_offset, 3*sizeof (uint16_t), (uint8_t *) ¬e.x);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool API::InitReadHotkeys( )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
memory_info * minfo = d->offset_descriptor;
|
|
|
|
|
|
|
|
d->hotkey_start = minfo->getAddress("hotkey_start");
|
|
|
|
|
|
|
|
d->hotkey_mode_offset = minfo->getOffset ("hotkey_mode");
|
|
|
|
|
|
|
|
d->hotkey_xyz_offset = minfo->getOffset("hotkey_xyz");
|
|
|
|
|
|
|
|
d->hotkey_size = minfo->getHexValue("hotkey_size");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (d->hotkey_start && d->hotkey_mode_offset && d->hotkey_size)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
d->hotkeyInited = true;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
d->hotkeyInited = false;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bool API::ReadHotkeys(t_hotkey hotkeys[])
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
assert (d->hotkeyInited);
|
|
|
|
|
|
|
|
uint32_t currHotkey = d->hotkey_start;
|
|
|
|
|
|
|
|
for(uint32_t i = 0 ; i < NUM_HOTKEYS ;i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
d->p->readSTLString(currHotkey,hotkeys[i].name,10);
|
|
|
|
|
|
|
|
hotkeys[i].mode = g_pProcess->readWord(currHotkey+d->hotkey_mode_offset);
|
|
|
|
|
|
|
|
g_pProcess->read (currHotkey + d->hotkey_xyz_offset, 3*sizeof (int32_t), (uint8_t *) &hotkeys[i].x);
|
|
|
|
|
|
|
|
currHotkey+=d->hotkey_size;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
// returns index of creature actually read or -1 if no creature can be found
|
|
|
|
// returns index of creature actually read or -1 if no creature can be found
|
|
|
|
int32_t API::ReadCreatureInBox (int32_t index, t_creature & furball,
|
|
|
|
int32_t API::ReadCreatureInBox (int32_t index, t_creature & furball,
|
|
|
|
const uint16_t &x1, const uint16_t &y1, const uint16_t &z1,
|
|
|
|
const uint16_t &x1, const uint16_t &y1, const uint16_t &z1,
|
|
|
|