And we need a new section of the readme.txt detailing these...
New forum for UIs: http://macroquest2.com/phpBB2/viewforum.php?f=27
UI file usage: If you don't know how to create a Label, learn or ask someone that does.. Current EQType's are in source or at http://macroquest2.com/phpBB2/viewtopic.php?t=3879
Offset (load from INI):
DWORD EQADDR_EQLABELS
GetLabelFromEQ=004F903B
Function below, add HookLabels(TRUE) with the rest of the HookXXX(TRUE); do the same for FALSE.
Code: Select all
// ***************************************************************************
// Function: GetLabelFromEQ_Detour
// Description: Our UI label Hook
// ***************************************************************************
struct _ID_PMP
{ DWORD ID;PCHAR PMP; }
Id_PMP[] = {
// 1000-1999: $char()
{1000, "$char(mana,cur)"},
{1001, "$char(mana,max)"},
{1002, "$char(state)"},
{1003, "$char(speed)"},
{1004, "$char(heading)"},
{1005, "$char(x)"},
{1006, "$char(y)"},
{1007, "$char(z)"},
{1008, "$char(dar)"},
{1009, "$char(cash)"},
{1010, "$char(cash,bank)"},
{1011, "$char(plat,bank)"},
{1012, "$char(plat,shared)"},
{1013, "$char(gold,bank)"},
{1014, "$char(silver,bank)"},
{1015, "$char(copper,bank)"},
// 2000-2999: $target()
{2000, "$target(level)"},
{2001, "$target(class)"},
{2002, "$target(race)"},
{2003, "$target(distance)"},
{2004, "$target(lastattacked)"},
{2005, "$target(state)"},
{2006, "$target(x)"},
{2007, "$target(y)"},
{2008, "$target(z)"},
{2009, "$target(heading)"},
{2010, "$target(speed)"},
// 3000-3999: misc
{3000, "$zone()"},
{3001, "$zone(zem)"},
{3002, "$zone(bound)"},
{3003, "$time()"},
{3004, "$time(h)"},
{3005, "$time(m)"},
{3006, "$time(s)"},
{3007, "$date()"},
{3008, "$date(y)"},
{3009, "$date(m)"},
{3010, "$date(d)"},
{3011, "$gm"},
{3012, "$freeinv(space)"},
// 9999: custom (ToolTipReference)
{9999, "BrokenParser" },
{-1,NULL}
};
class CLabel {
public:
VOID Draw_Trampoline(VOID);
VOID Draw_Detour(VOID)
{
PCSIDLWND pThisLabel = NULL;
__asm mov [pThisLabel], ecx;
Draw_Trampoline();
CHAR Buffer[MAX_STRING] = {0};
BOOL Found=FALSE;
DWORD index;
if (pThisLabel->SlotID==9999) {
if (!pThisLabel->XMLToolTip) {
strcpy(Buffer,"BadCustom");
Found=TRUE;
} else {
strcpy(Buffer,&pThisLabel->XMLToolTip->Text[0]);
ParseMacroParameter((*EQADDR_CHAR_INFO)->pSpawn,Buffer);
Found=TRUE;
}
} else if (pThisLabel->SlotID>114) {
for (index=0;Id_PMP[index].ID>0 && !Found;index++) {
if (Id_PMP[index].ID==pThisLabel->SlotID) {
strcpy(Buffer,Id_PMP[index].PMP);
ParseMacroParameter((*EQADDR_CHAR_INFO)->pSpawn,Buffer);
Found=TRUE;
}
}
}
if (Found) SetCXStr(&(pThisLabel->WindowText),Buffer);
}
};
...
// ***************************************************************************
// Function: HookLabels
// Description: Hook UI labels
// ***************************************************************************
DETOUR_TRAMPOLINE_EMPTY(VOID CLabel::Draw_Trampoline(VOID));
VOID HookLabels(BOOL Patch)
{
FunctionEntry("HookLabels()");
void (CLabel::*pfDetour)(VOID) = CLabel::Draw_Detour;
void (CLabel::*pfTrampoline)(VOID) = CLabel::Draw_Trampoline;
DebugSpewAlways("HookLabels - %satching",(Patch)?"P":"Unp");
if (Patch) {
AddOurDetour(EQADDR_EQLABELS);
DetourFunctionWithEmptyTrampoline(*(PBYTE*)&pfTrampoline,
(PBYTE)EQADDR_EQLABELS,
*(PBYTE*)&pfDetour);
} else {
DetourRemove(*(PBYTE*)&pfTrampoline,
*(PBYTE*)&pfDetour);
}
FunctionExit("HookLabels()");
}

