void SaveChatToXML(PCSIDLWND pWindow) { char szTemp[MAX_STRING] = {0}; GetCXStr(pWindow->WindowText, szTemp); pISInterface->SetSetting(XMLFileName, szChatXMLSection, "Title", szTemp); if (pWindow->Minimized) { pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Top", pWindow->OldLocation.top); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Bottom", pWindow->OldLocation.bottom); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Left", pWindow->OldLocation.left); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Right", pWindow->OldLocation.right); } else { pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Top", pWindow->Location.top); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Bottom", pWindow->Location.bottom); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Left", pWindow->Location.left); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Right", pWindow->Location.right); } pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Locked", pWindow->Locked); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Fades", pWindow->Fades); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Delay", pWindow->TimeMouseOver); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Duration", pWindow->FadeDuration); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "Alpha", pWindow->Alpha); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "FadeToAlpha", pWindow->FadeToAlpha); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "BGType", pWindow->BGType); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "BGTint.red", pWindow->BGColor.R); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "BGTint.green", pWindow->BGColor.G); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "BGTint.blue", pWindow->BGColor.B); pISInterface->SetSettingi(XMLFileName, szChatXMLSection, "FontSize", MQChatWnd->FontSize); pISInterface->SaveSettings(XMLFileName); }
DWORD __stdcall openpickzonewnd(PVOID pData) { if(!cmdPickZone) return 0; lockit lk(ghLockPickZone); int nInst = (int)pData; CHAR szInst[32] = { 0 }; itoa(nInst, szInst, 10); if (PCHARINFO pCharInfo = GetCharInfo()) { cmdPickZone(pCharInfo->pSpawn, NULL); Sleep(2000);//i need to make this hardcoded wait dynamic but im in a hurry ill do it later -eqmule if (CXWnd *krwnd = FindMQ2Window("MIZoneSelectWnd")) { if (krwnd->dShow) { if (CListWnd *clist = (CListWnd*)krwnd->GetChildItem("MIZ_ZoneList")) { if (DWORD numitems = ((CSidlScreenWnd*)clist)->Items) { if (CButtonWnd *cbutt = (CButtonWnd*)krwnd->GetChildItem("MIZ_SelectButton")) { CHAR szOut[255] = { 0 }; CXStr Str; std::string s; bool itsmain = false; bool clickit = false; for (DWORD i = 0; i<numitems; i++) { clist->GetItemText(&Str, i, 0); GetCXStr(Str.Ptr, szOut, 254); if (szOut[0] != '\0') { s = szOut; if (std::string::npos == s.find_first_of("123456789")) { itsmain = true; } if (itsmain && nInst == 0) { clickit = true; } else if (nInst >= 1) { if (std::string::npos != s.find_first_of(szInst)) { clickit = true; } } if (clickit) { SendListSelect("MIZoneSelectWnd", "MIZ_ZoneList", i); Sleep(500); SendWndClick2((CXWnd*)cbutt, "leftmouseup"); WriteChatf("%s selected.", szOut); return 0; } } } WriteChatf("%s instance %d NOT found in list", GetFullZone(pCharInfo->zoneId), nInst); } } } } } } return 0; }
void DoRace(PCHAR szArg) { if (szArg[0] == 0) { MacroError("Bad race name."); return; } int index = -1; CHAR szRace[255] = { 0 }; if (isdigit(szArg[0])) { index = atoi(szArg); if (index == 0) { strcpy_s(szRace, "Any Race"); } else { for (int i = 0; i < sizeof(races) / sizeof(races[0]); i++) { if (races[i].race==index) { strcpy_s(szRace, races[i].name); break; } } } } else { for (int i = 0; i < sizeof(races) / sizeof(races[0]); i++) { if (!_stricmp(szArg, races[i].name)) { strcpy_s(szRace, szArg); break; } } } if (szRace[0] == '\0') { MacroError("Bad race name."); return; } if (!_stricmp(szArg, "any")) { strcpy_s(szRace, "Any Race"); } if (CComboWnd *pCombo = (CComboWnd *)pBazaarSearchWnd->GetChildItem("BZR_RaceSlotCombobox")) { if (CListWnd*pListWnd = (CListWnd*)pCombo->Items) { CXStr Str; CHAR szOut[255] = { 0 }; DWORD itemcnt = pCombo->GetItemCount(); for (DWORD i = 0; i < itemcnt; i++) { pListWnd->GetItemText(&Str, i, 0); GetCXStr(Str.Ptr, szOut, 254); if (szOut[0] != '\0') { if (!_stricmp(szRace, szOut)) { SetComboSelection((CSidlScreenWnd*)pCombo, i); break; } } } } } }
void DoClass(PCHAR szArg) { if (szArg[0] == 0) { MacroError("Bad class name."); return; } int index = -1; CHAR szClass[255] = { 0 }; if (isdigit(szArg[0])) { index = atoi(szArg); if (index == 0) { strcpy_s(szClass, "Any Class"); } else { for (int i = 0; i < sizeof(classes) / sizeof(classes[0]); i++) { if (classes[i].classn==index) { strcpy_s(szClass, classes[i].name); break; } } } } else { for (int i = 0; i < sizeof(classes) / sizeof(classes[0]); i++) { if (!_stricmp(szArg, classes[i].name)) { strcpy_s(szClass, szArg); break; } } } if (szClass[0] == '\0') { MacroError("Bad class name."); return; } if (!_stricmp(szArg, "any")) { strcpy_s(szClass, "Any Class"); } if (CComboWnd *pCombo = (CComboWnd *)pBazaarSearchWnd->GetChildItem("BZR_ClassSlotCombobox")) { if (CListWnd*pListWnd = pCombo->pListWnd) { CXStr Str; CHAR szOut[MAX_STRING] = { 0 }; DWORD itemcnt = pCombo->GetItemCount(); for (DWORD i = 0; i < itemcnt; i++) { pListWnd->GetItemText(&Str, i, 0); GetCXStr(Str.Ptr, szOut, MAX_STRING); if (szOut[0] != '\0') { if (!_stricmp(szClass, szOut)) { SetComboSelection(pCombo, i); break; } } } } } }
// This is called every time WriteChatColor is called by MQ2Main or any plugin, // IGNORING FILTERS, IF YOU NEED THEM MAKE SURE TO IMPLEMENT THEM. IF YOU DONT // CALL CEverQuest::dsp_chat MAKE SURE TO IMPLEMENT EVENTS HERE PLUGIN_API DWORD OnWriteChatColor(PCHAR Line, DWORD Color, DWORD Filter) { //DebugSpewAlways("MQ2ChatWnd::OnWriteChatColor(%s)",Line); if (!MQChatWnd) { if (gGameState==GAMESTATE_INGAME) { SetGameState(gGameState); } if (!MQChatWnd) { return 0; } } MQChatWnd->dShow=1; PFILTER pFilter=gpFilters; while (pFilter) { if (!pFilter->pEnabled || (*pFilter->pEnabled)) { if (!_strnicmp(Line,pFilter->FilterText,pFilter->Length)) { return 0; } } pFilter = pFilter->pNext; } Color=pChatManager->GetRGBAFromIndex(Color); CHAR szProcessed[MAX_STRING]; pPlugins; MQToSTML(Line,szProcessed,MAX_STRING,Color); pPlugins; strcat_s(szProcessed,"<br>"); CXStr NewText(szProcessed); DebugTry(ConvertItemTags(NewText,FALSE)); ChatBuffer *pNewBuffer = new ChatBuffer; GetCXStr(NewText.Ptr,pNewBuffer->Text,MAX_STRING); pNewBuffer->pPrev=pPendingChatTail; pNewBuffer->pNext=0; if (pPendingChatTail) { pPendingChatTail->pNext=pNewBuffer; } else { pPendingChat=pNewBuffer; } pPendingChatTail=pNewBuffer; PendingChatLines++; return 0; }
VOID Draw_Detour(VOID) { CLabel* pThisLabel = (CLabel*)this; CHAR Buffer[MAX_STRING] = {0}; BOOL Found=FALSE; DWORD index; if (gAnonymize) { if (!bTrimnames) { EzDetourwName(CEverQuest__trimName, &CLabelHook::CEverQuest__trimName_Detour, &CLabelHook::CEverQuest__trimName_Trampoline,"CEverQuest__trimName"); EzDetourwName(__GetGaugeValueFromEQ, GetGaugeValueFromEQ_Detour, GetGaugeValueFromEQ_Trampoline,"__GetGaugeValueFromEQ"); EzDetourwName(__GetLabelFromEQ, GetLabelFromEQ_Detour, GetLabelFromEQ_Trampoline,"__GetLabelFromEQ"); bTrimnames = 1; } if (pThisLabel && pThisLabel->WindowText) { GetCXStr(pThisLabel->WindowText, Buffer); Anonymize(Buffer); } } else { if (bTrimnames) { bTrimnames = 0; RemoveDetour(CEverQuest__trimName); RemoveDetour(__GetGaugeValueFromEQ); RemoveDetour(__GetLabelFromEQ); } } Draw_Trampoline(); if ((DWORD)pThisLabel->EQType==9999) { if (!pThisLabel->XMLToolTip) { strcpy_s(Buffer,"BadCustom"); Found=TRUE; } else { //strcpy_s(Buffer,&pThisLabel->XMLToolTip->Text[0]); STMLToPlainText(&pThisLabel->XMLToolTip->Text[0],Buffer); ParseMacroParameter(((PCHARINFO)pCharData)->pSpawn,Buffer); if (!strcmp(Buffer,"NULL")) Buffer[0]=0; Found=TRUE; } } else if (pThisLabel->EQType==1000) { for (index=0;Id_PMP[index].ID>0 && !Found;index++) { if (Id_PMP[index].ID==(DWORD)pThisLabel->EQType) { strcpy_s(Buffer,Id_PMP[index].PMP); ParseMacroParameter(((PCHARINFO)pCharData)->pSpawn,Buffer); if (!strcmp(Buffer,"NULL")) Buffer[0]=0; Found=TRUE; } } } if (Found) SetCXStr(&(pThisLabel->WindowText),Buffer); }
int __cdecl GetLabelFromEQ_Detour(int EQType, class CXStr *out, bool *arg3, unsigned long *colorout) { int ret = GetLabelFromEQ_Trampoline(EQType,out,arg3,colorout); if (gAnonymize) { if (out && out->Ptr) { CHAR szOut[MAX_STRING] = { 0 }; GetCXStr(out->Ptr, szOut); if (Anonymize(szOut)) { SetCXStr(&out->Ptr, szOut); } } } return ret; }
int WndNotification(CXWnd *pWnd, unsigned int Message, void *unknown) { if (pWnd == (CXWnd*)InputBox) { if (Message == XWM_HITENTER) { char szBuffer[2048]; GetCXStr((PCXSTR)InputBox->InputText, szBuffer, 2047); if (szBuffer[0]) { OutputBox->AppendSTML(szBuffer); SetCXStr(&InputBox->InputText, ""); pISInterface->ExecuteCommand(szBuffer); } ((CXWnd*)InputBox)->ClrFocus(); } else { DebugSpew("InputBox message %Xh, value: %Xh",Message,unknown); } } else if (pWnd == (CXWnd*)OutputBox) { if (Message == XWM_NEWVALUE) { SaveChatToXML((PCSIDLWND)MQChatWnd); } else { DebugSpew("OutputBox message %Xh, value: %Xh", Message, unknown); } } else if (pWnd == 0) { if (Message == XWM_CLOSE) { dShow = 1; return 1; } } else if (Message == XWM_LINK) { class CChatWindow *p = (class CChatWindow *)this; if (OutputBox != (CStmlWnd *)pWnd) { CStmlWnd *tmp; int ret; DebugSpew("MQ2ChatWnd: 0x%X, Msg: 0x%X, value: %Xh", pWnd, Message, unknown); DebugSpew("MQ2ChatWnd: pWnd 0x%x != OutputBox 0x%x\n", pWnd, OutputBox); tmp = OutputBox; OutputBox = (CStmlWnd *)pWnd; ret = p->WndNotification(pWnd, Message, unknown); OutputBox = tmp; return ret; } return p->WndNotification(pWnd, Message, unknown); } else { //DebugSpew("MQ2ChatWnd: 0x%X, Msg: 0x%X, value: %Xh",pWnd,Message,unknown); } return CSidlScreenWnd::WndNotification(pWnd,Message,unknown); };
int CListWnd__AddString_Detour(const CXStr &Str, COLORREF Color, uint32_t Data, const CTextureAnimation *pTa, const char*TooltipStr) #endif { if (gAnonymize) { CHAR *szStr = new CHAR[MAX_STRING]; GetCXStr(Str.Ptr, szStr); //WriteChatf("CListWnd__AddString_Detour %s", szStr); Anonymize(szStr,MAX_STRING,true); int ret = CListWnd__AddString_Trampoline(szStr,Color,Data,pTa,TooltipStr); delete szStr; return ret; } return CListWnd__AddString_Trampoline(Str,Color,Data,pTa,TooltipStr); }
int __cdecl GetGaugeValueFromEQ_Detour(int EQType, class CXStr *out, bool *arg3, unsigned long *colorout) { int ret = GetGaugeValueFromEQ_Trampoline(EQType,out,arg3,colorout); if (gAnonymize) { if (out && out->Ptr) { CHAR *szOut = new CHAR[MAX_STRING]; GetCXStr(out->Ptr, szOut); if (Anonymize(szOut,MAX_STRING)) { SetCXStr(&out->Ptr, szOut); } delete szOut; } } return ret; }
void ConsoleService(bool Broadcast, unsigned int MSG, void *lpData) { if (MSG != CONSOLE_OUTPUT_WITHCODES) { return; } // same as OnWriteChatColor if (!MQChatWnd) { EQGamestateService(false, GAMESTATESERVICE_CHANGED, (void*)gGameState); if (!MQChatWnd) { return; } } MQChatWnd->dShow = 1; PCHAR pConsOutput = (PCHAR)lpData; PFILTER pFilter = gpFilters; while (pFilter) { if (!pFilter->pEnabled || (*pFilter->pEnabled)) { if (!strnicmp(pConsOutput, pFilter->FilterText, pFilter->Length)) { return; } } pFilter = pFilter->pNext; } DWORD Color = pChatManager->GetRGBAFromIndex(USERCOLOR_DEFAULT); CHAR szProcessed[MAX_STRING]; MQToSTML(pConsOutput, szProcessed, MAX_STRING, Color); strcat(szProcessed,"<br>"); CXStr NewText(szProcessed); DebugTry(ConvertItemTags(NewText, 0)); CLock L(&ChatS,1); ChatBuffer *pNewBuffer = new ChatBuffer; GetCXStr(NewText.Ptr, pNewBuffer->Text, MAX_STRING); pNewBuffer->pPrev = pPendingChatTail; pNewBuffer->pNext = 0; if (pPendingChatTail) { pPendingChatTail->pNext = pNewBuffer; } else { pPendingChat = pNewBuffer; } pPendingChatTail = pNewBuffer; PendingChatLines++; }
int CComboWnd__InsertChoiceAtIndex_Detour(const CXStr& Str, unsigned __int32 index) { if (gAnonymize && gweareaddingpeople) { Advlootcombo = (CComboWnd*)this; //CHAR *szTemp = new CHAR[MAX_STRING]; CHAR szTemp[MAX_STRING]; //CHAR *orgszTemp = szTemp; GetCXStr(Str.Ptr, szTemp); std::string str = szTemp; std::string Found; bool bFound = false; for (std::map<std::string, std::string>::iterator i = lootcombo.begin(); i != lootcombo.end(); i++) { if (i->second == szTemp) { Found = i->first; break; } } if(Found.empty()) { Anonymize(szTemp, MAX_STRING, true); lootcombo[szTemp] = str; } else { strcpy_s(szTemp,MAX_STRING, Found.c_str()); } int ret = 0; std::map<std::string, std::string>::iterator j = lootcombo.find(szTemp); if (j != lootcombo.end()) { ret = CComboWnd__InsertChoiceAtIndex_Trampoline(j->first.c_str(), index); } else { ret = CComboWnd__InsertChoiceAtIndex_Trampoline(Str, index); } //delete orgszTemp; return ret; } else { int ret = CComboWnd__InsertChoiceAtIndex_Trampoline(Str, index); return ret; } }
CXStr CComboWnd__GetChoiceText_Detour(int index) const { CXStr ret = CComboWnd__GetChoiceText_Trampoline(index); if (gAnonymize) { if (ret.Ptr) { CHAR *szTemp = new CHAR[MAX_STRING]; GetCXStr(ret.Ptr, szTemp); if (lootcombo.find(szTemp) != lootcombo.end()) { std::string str = lootcombo[szTemp]; strcpy_s(szTemp, MAX_STRING, str.c_str()); SetCXStr(&ret.Ptr, szTemp); } delete szTemp; } } return ret; }
void DoCombo(PCHAR szArg, PCHAR key, PCHAR szCombostring) { if (szArg[0] == 0) { MacroError("Bad %s name.", key); return; } DWORD index = -1; CHAR szValue[255] = { 0 }; if (isdigit(szArg[0])) { index = atoi(szArg); index--; } if (!_stricmp(szArg, "any")) { sprintf_s(szValue, "Any %s",key); } else { strcpy_s(szValue, szArg); } if (CComboWnd *pCombo = (CComboWnd *)pBazaarSearchWnd->GetChildItem(szCombostring)) { if (CListWnd*pListWnd = (CListWnd*)pCombo->Items) { CXStr Str; CHAR szOut[255] = { 0 }; DWORD itemcnt = pCombo->GetItemCount(); if (index != -1 && index <= itemcnt) { SetComboSelection((CSidlScreenWnd*)pCombo, index); } else { for (DWORD i = 0; i < itemcnt; i++) { pListWnd->GetItemText(&Str, i, 0); GetCXStr(Str.Ptr, szOut, 254); if (szOut[0] != '\0') { if (!_stricmp(szValue, szOut)) { SetComboSelection((CSidlScreenWnd*)pCombo, i); break; } } } } } } }
VOID SaveChatToINI(PCSIDLWND pWindow) { CHAR szTemp[MAX_STRING]={0}; WritePrivateProfileString("Settings","AutoScroll", bAutoScroll?"on":"off",INIFileName); WritePrivateProfileString("Settings","NoCharSelect", bNoCharSelect?"on":"off",INIFileName); WritePrivateProfileString("Settings","SaveByChar", bSaveByChar?"on":"off",INIFileName); if (pWindow->Minimized) { WritePrivateProfileString(szChatINISection,"ChatTop", SafeItoa(pWindow->OldLocation.top, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatBottom", SafeItoa(pWindow->OldLocation.bottom, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatLeft", SafeItoa(pWindow->OldLocation.left, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatRight", SafeItoa(pWindow->OldLocation.right, szTemp,10),INIFileName); } else { WritePrivateProfileString(szChatINISection,"ChatTop", SafeItoa(pWindow->Location.top, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatBottom", SafeItoa(pWindow->Location.bottom, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatLeft", SafeItoa(pWindow->Location.left, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"ChatRight", SafeItoa(pWindow->Location.right, szTemp,10),INIFileName); } WritePrivateProfileString(szChatINISection,"Locked", SafeItoa(pWindow->Locked, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Fades", SafeItoa(pWindow->Fades, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Delay", SafeItoa(pWindow->FadeDelay, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Duration", SafeItoa(pWindow->FadeDuration, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"Alpha", SafeItoa(pWindow->Alpha, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"FadeToAlpha", SafeItoa(pWindow->FadeToAlpha, szTemp,10),INIFileName); ARGBCOLOR col = { 0 }; col.ARGB = pWindow->BGColor; WritePrivateProfileString(szChatINISection,"BGType", SafeItoa(pWindow->BGType, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.alpha", SafeItoa(col.A, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.red", SafeItoa(col.R, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.green", SafeItoa(col.G, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"BGTint.blue", SafeItoa(col.B, szTemp,10),INIFileName); WritePrivateProfileString(szChatINISection,"FontSize", SafeItoa(MQChatWnd->FontSize, szTemp,10),INIFileName); GetCXStr(pWindow->WindowText,szTemp, MAX_STRING); WritePrivateProfileString(szChatINISection,"WindowTitle",szTemp,INIFileName); }
int WndNotification(CXWnd *pWnd, unsigned int Message, void *data) { if (pWnd==(CXWnd*)InputBox) { if (Message==XWM_HITENTER) { char szBuffer[MAX_STRING] = { 0 }; GetCXStr((PCXSTR)InputBox->InputText,szBuffer, MAX_STRING); if (szBuffer[0]) { if (!sCmdHistory.size() || sCmdHistory.front().compare(szBuffer)) { if (sCmdHistory.size()>CMD_HIST_MAX) { sCmdHistory.pop_back(); } sCmdHistory.insert(sCmdHistory.begin(),string(szBuffer)); } iCurrentCmd=-1; //bool bScrollDown=bAutoScroll?true:(MQChatWnd->OutputBox->VScrollPos==MQChatWnd->OutputBox->VScrollMax?true:false); //char szProcessed[MAX_STRING]; //MQToSTML(szBuffer,szProcessed,MAX_STRING); //strcat_s(szProcessed,"<br>"); //CXStr NewText(szProcessed); //OutputBox->AppendSTML(NewText); //if (bScrollDown) ((CXWnd*)MQChatWnd->OutputBox)->SetVScrollPos(MQChatWnd->OutputBox->VScrollMax); SetCXStr(&InputBox->InputText,""); if (szBuffer[0]=='/') { DoCommand(((PCHARINFO)pCharData)->pSpawn,szBuffer); } else { Echo(((PCHARINFO)pCharData)->pSpawn,szBuffer); } } ((CXWnd*)InputBox)->ClrFocus(); } else if (Message == XWM_HISTORY) { if (data) { int* pInt=(int*)data; int iKeyPress=pInt[1]; if (iKeyPress==0xc8) // KeyUp { if (sCmdHistory.size()>0) { iCurrentCmd++; if (iCurrentCmd<((int)sCmdHistory.size()) && iCurrentCmd>=0) { string s=(string)sCmdHistory.at(iCurrentCmd); ((CXWnd*)InputBox)->SetWindowTextA(CXStr(s.c_str())); } else { iCurrentCmd=((int)sCmdHistory.size())-1; } } } else if (iKeyPress==0xd0) // KeyDown { if (sCmdHistory.size()>0) { iCurrentCmd--; if (iCurrentCmd>=0 && sCmdHistory.size()>0) { string s=(string)sCmdHistory.at(iCurrentCmd); ((CXWnd*)InputBox)->SetWindowTextA(CXStr(s.c_str())); } else if (iCurrentCmd<0) { iCurrentCmd=-1; SetCXStr(&InputBox->InputText,""); } } } } } else { DebugSpew("InputBox message %Xh, value: %Xh",Message,data); } } else if (pWnd==0) { if (Message==XWM_CLOSE) { dShow=1; return 1; } } else if (Message==XWM_LINK) { class CChatWindow *p = (class CChatWindow *)this; if (OutputBox!=(CStmlWnd *)pWnd) { CStmlWnd *tmp; int ret; //DebugSpew("MQ2ChatWnd: 0x%X, Msg: 0x%X, value: %Xh",pWnd,Message,data); //DebugSpew("MQ2ChatWnd: pWnd 0x%x != OutputBox 0x%x\n",pWnd,OutputBox); tmp=OutputBox; OutputBox=(CStmlWnd*)pWnd; ret=p->WndNotification(pWnd,Message,data); OutputBox=tmp; return ret; } return p->WndNotification(pWnd,Message,data); } else { //DebugSpew("MQ2ChatWnd: 0x%X, Msg: 0x%X, value: %Xh",pWnd,Message,data); } return CSidlScreenWnd::WndNotification(pWnd,Message,data); };
VOID Draw_Detour(VOID) { CLabel* pThisLabel = (CLabel*)this; CHAR Buffer[MAX_STRING] = {0}; BOOL Found=FALSE; DWORD index; if (gAnonymize) { if (!bTrimnames) { #if !defined(ROF2EMU) && !defined(UFEMU) EzDetourwName(CAdvancedLootWnd__UpdateMasterLooter, &CLabelHook::CAdvancedLootWnd__UpdateMasterLooter_Detour, &CLabelHook::CAdvancedLootWnd__UpdateMasterLooter_Trampoline,"CAdvancedLootWnd__UpdateMasterLooter"); EzDetourwName(CComboWnd__GetChoiceText, &CLabelHook::CComboWnd__GetChoiceText_Detour, &CLabelHook::CComboWnd__GetChoiceText_Trampoline,"CComboWnd__GetChoiceText"); EzDetourwName(CComboWnd__InsertChoiceAtIndex, &CLabelHook::CComboWnd__InsertChoiceAtIndex_Detour, &CLabelHook::CComboWnd__InsertChoiceAtIndex_Trampoline,"CComboWnd__InsertChoiceAtIndex"); EzDetourwName(CAdvancedLootWnd__AddPlayerToList, &CLabelHook::CAdvancedLootWnd__AddPlayerToList_Detour, &CLabelHook::CAdvancedLootWnd__AddPlayerToList_Trampoline,"CAdvancedLootWnd__AddPlayerToList"); if (pAdvancedLootWnd && GetGameState() == GAMESTATE_INGAME) { CleanupLootCombo(true); } #endif EzDetourwName(CListWnd__AddString, &CLabelHook::CListWnd__AddString_Detour, &CLabelHook::CListWnd__AddString_Trampoline,"CListWnd__AddString"); EzDetourwName(CEverQuest__trimName, &CLabelHook::CEverQuest__trimName_Detour, &CLabelHook::CEverQuest__trimName_Trampoline,"CEverQuest__trimName"); EzDetourwName(__GetGaugeValueFromEQ, GetGaugeValueFromEQ_Detour, GetGaugeValueFromEQ_Trampoline,"__GetGaugeValueFromEQ"); EzDetourwName(__GetLabelFromEQ, GetLabelFromEQ_Detour, GetLabelFromEQ_Trampoline,"__GetLabelFromEQ"); bTrimnames = 1; } if (pThisLabel && pThisLabel->CGetWindowText()) { GetCXStr(pThisLabel->CGetWindowText(), Buffer); Anonymize(Buffer,MAX_STRING); } } else { if (bTrimnames) { bTrimnames = 0; #if !defined(ROF2EMU) && !defined(UFEMU) RemoveDetour(CComboWnd__GetChoiceText); RemoveDetour(CComboWnd__InsertChoiceAtIndex); RemoveDetour(CAdvancedLootWnd__AddPlayerToList); #endif RemoveDetour(CListWnd__AddString); RemoveDetour(CEverQuest__trimName); RemoveDetour(__GetGaugeValueFromEQ); RemoveDetour(__GetLabelFromEQ); #if !defined(ROF2EMU) && !defined(UFEMU) CleanupLootCombo(false); RemoveDetour(CAdvancedLootWnd__UpdateMasterLooter); #endif } } Draw_Trampoline(); if ((DWORD)pThisLabel->EQType==9999) { if (!pThisLabel->GetXMLToolTip()) { strcpy_s(Buffer,"BadCustom"); Found=TRUE; } else { //strcpy_s(Buffer,&pThisLabel->XMLToolTip->Text[0]); STMLToPlainText(&pThisLabel->GetXMLToolTip()->Text[0],Buffer); ParseMacroParameter(((PCHARINFO)pCharData)->pSpawn,Buffer); if (!strcmp(Buffer,"NULL")) Buffer[0]=0; Found=TRUE; } } else if (pThisLabel->EQType==1000) { for (index=0;Id_PMP[index].ID>0 && !Found;index++) { if (Id_PMP[index].ID==(DWORD)pThisLabel->EQType) { strcpy_s(Buffer,Id_PMP[index].PMP); ParseMacroParameter(((PCHARINFO)pCharData)->pSpawn,Buffer); if (!strcmp(Buffer,"NULL")) Buffer[0]=0; Found=TRUE; } } } if (Found) { pThisLabel->CSetWindowText(Buffer); //SetCXStr(&(pThisLabel->WindowText), Buffer); } }