EQManiac
Member
- Joined
- Jan 29, 2006
- RedCents
- 31¢
For those who have ben trying to use the /notify with the rewards window you will have noticed what a PITA it is.
The problem with the window is the fact that the number of tabs are dynamic. The tab template in the XML is actually nothing mmore then a class definition and is left blank in the client to be used as a template. Copies of this window are spawned off and added to the tab window as needed. Once created they remain in memory until the UI is reloaded.
To get around this oddness I have thrown together this plugin so we have basic functionality. I wanted to add an ini based list to identify the task and the preffered reward, but there is not currently a way to identify the task/reward combo to enable this (missing an offset to read the tab text).
This plugin adds the command
/reward <optionNumber>
If no option number is specified it will default to option one.
The plugin is still in the rough stages and hasn't been refined yet so don't expect much
The problem with the window is the fact that the number of tabs are dynamic. The tab template in the XML is actually nothing mmore then a class definition and is left blank in the client to be used as a template. Copies of this window are spawned off and added to the tab window as needed. Once created they remain in memory until the UI is reloaded.
To get around this oddness I have thrown together this plugin so we have basic functionality. I wanted to add an ini based list to identify the task and the preffered reward, but there is not currently a way to identify the task/reward combo to enable this (missing an offset to read the tab text).
This plugin adds the command
/reward <optionNumber>
If no option number is specified it will default to option one.
The plugin is still in the rough stages and hasn't been refined yet so don't expect much

Rich (BB code):
// MQ2Reward.cpp : Defines the entry point for the DLL application.
//
// PLUGIN_API is only to be used for callbacks. All existing callbacks at this time
// are shown below. Remove the ones your plugin does not use. Always use Initialize
// and Shutdown for setup and cleanup, do NOT do it in DllMain.
// Original by: MstrGareth
#include "../MQ2Plugin.h"
PreSetup("MQ2Reward");
VOID AutoReward(PSPAWNINFO pChar, PCHAR szLine)
{
CXWnd *WorkingWnd;
int OptionNumber;
CHAR *z[2];
int y;
z[0] = szLine;
for (y = 1; *szLine != '\0'; ) {
if (*szLine == ' ') {
*szLine = '\0';
z[y++] = ++szLine;
break;
} else {
szLine++;
}
}
if (!strcmp(strupr(z[0]),"HELP"))
{
WriteChatColor("Usage: /reward <optionNumber>",111111);
return;
}
OptionNumber=(int)atoi(z[0]);
if (OptionNumber==0) OptionNumber=1;
// Parent TabWind PageTemplate1
WorkingWnd = FindMQ2Window("RewardSelectionWnd")->GetFirstChildWnd()->GetFirstChildWnd();
WorkingWnd=WorkingWnd->GetNextSib(); // assume first page is always empty template
while(WorkingWnd)
{
if(CXWnd *ChildWnd=WorkingWnd->GetChildItem("RewardSelectionChooseButton")) {
CListWnd *pList=(CListWnd*)((CSidlScreenWnd*)(WorkingWnd))->GetChildItem("RewardSelectionOptionList");
if (!pList)
{
//if (pList->IsLineEnabled(OptionNumber))
//{
pList->SetCurSel(OptionNumber);
//} else {
// WriteChatColor("/Reward, Invalid option number specified!",111111);
// return;
//}
}
DebugTry(CXRect rect=ChildWnd->GetScreenRect());
DebugTry(CXPoint pt=rect.CenterPoint());
DebugTry(ChildWnd->HandleLButtonDown(&pt,0));
DebugTry(ChildWnd->HandleLButtonUp(&pt,0));
}
WorkingWnd=WorkingWnd->GetNextSib();
}
}
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/reward",AutoReward);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/reward");
}

