Page 1 of 2
MQ2ItemDisplay.cpp
Posted: Fri Jun 17, 2005 12:19 am
by Lacky
There is an error with the /inote stuff in MQ2ItemDisplay when compiling ISXEQ. To get around it either delete them before building ISXEQItemDisplay or do....
Code: Select all
#ifndef ISXEQ
void Comment(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR Arg[MAX_STRING] = {0};
CHAR ItemNo[MAX_STRING] = {0};
.....CodeBlahBlah..Old Ifndef was before this line....
// Called once, when the plugin is to initialize
.....moreblah....
RemoveCommand("/inote");
}
#endif
That code is at the bottom of the file. You are just moving the #ifndef ISXEQ up about 20 lines.
The next code is around line 149
Code: Select all
#ifndef ISXEQ
GetPrivateProfileString("Notes",temp,"",temp2,MAX_STRING,INIFileName);
if (strlen(temp2)>0)
{
sprintf(temp,"Note: %s<br>",temp2);
strcat(out, temp);
}
#endif
Just add the ifndef and endif around that code.
Ok I guess that was it thought there was a third for some reason :}
Thanks to dont_know_at_all for the help and telling me what to fix and stuff.
Posted: Fri Jun 17, 2005 12:50 am
by dont_know_at_all
The was a third spot -- remove these lines:
Posted: Fri Jun 17, 2005 1:01 am
by Lacky
Actually with the #ifndef ISXEQ on the last chunk of code moved up 20 or so lines it fixes that problem with out removing it.
Posted: Fri Jun 17, 2005 1:06 am
by dont_know_at_all
Oh, I see. They already out. Never mind.
Hmm
Posted: Wed Jul 06, 2005 12:18 am
by Lacky
Looking at this I think I took too much out when I first did it. Might explain some wierdthings.
Posted: Wed Jul 06, 2005 12:42 am
by Lacky
line 350 on should look like this in the mq2itemdisplay
Code: Select all
#ifndef ISXEQ
void Comment(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR Arg[MAX_STRING] = {0};
CHAR ItemNo[MAX_STRING] = {0};
CHAR Comment[MAX_STRING] = {0};
CHAR szTemp[MAX_STRING] = {0};
GetArg(Arg,szLine,1);
GetArg(ItemNo,szLine,2);
GetArg(szTemp,szLine,3);
for(int i=4;strlen(szTemp);i++){
strcat(Comment,szTemp);
strcat(Comment," ");
GetArg(szTemp,szLine,i);
}
int itemno = atoi(ItemNo);
if (stricmp(Arg,"add") && stricmp(Arg,"del"))
{
WriteChatColor("Use: /inote <add|del> <itemno> \"Comment\"",CONCOLOR_YELLOW);
return;
}
if (itemno <= 0)
{
WriteChatColor("Invalid item number");
WriteChatColor("Use: /inote <add|del> <itemno> \"Comment\"",CONCOLOR_YELLOW);
return;
}
if (strlen(Comment)==0 || !stricmp(Arg,"del"))
{
sprintf(szTemp,"%07d",itemno);
WritePrivateProfileString("Notes",szTemp,"",INIFileName);
return;
}
if (!stricmp(Arg,"add"))
{
sprintf(szTemp,"%07d",itemno);
WritePrivateProfileString("Notes",szTemp,Comment,INIFileName);
return;
}
}
#endif
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2ItemDisplay");
// Add commands, macro parameters, hooks, etc.
// EasyClassDetour(CItemDisplayWnd__SetItem,ItemDisplayHook,SetItem_Detour,void,(class EQ_Item *, bool),SetItem_Trampoline);
EzDetour(CItemDisplayWnd__SetItem,ItemDisplayHook::SetItem_Detour,ItemDisplayHook::SetItem_Trampoline);
// EasyClassDetour(CItemDisplayWnd__SetSpell,ItemDisplayHook,SetSpell_Detour,void,(int SpellID,bool HasSpellDescr,int),SetSpell_Trampoline);
EzDetour(CItemDisplayWnd__SetSpell,ItemDisplayHook::SetSpell_Detour,ItemDisplayHook::SetSpell_Trampoline);
#ifndef ISXEQ
AddCommand("/inote",Comment);
#endif
}
// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2ItemDisplay");
// Remove commands, macro parameters, hooks, etc.
RemoveDetour(CItemDisplayWnd__SetItem);
RemoveDetour(CItemDisplayWnd__SetSpell);
#ifndef ISXEQ
RemoveCommand("/inote");
#endif
}
And Line 149-156 will become this
Code: Select all
#ifndef ISXEQ
GetPrivateProfileString("Notes",temp,"",temp2,MAX_STRING,INIFileName);
if (strlen(temp2)>0)
{
sprintf(temp,"Note: %s<br>",temp2);
strcat(out, temp);
}
#endif
This compiled with 0 errors for me. Will actually check to see if its working now :)
Re: MQ2ItemDisplay.cpp
Posted: Sun May 25, 2025 10:05 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Sun May 25, 2025 11:18 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Sun May 25, 2025 11:19 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Sun May 25, 2025 11:56 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Sun May 25, 2025 11:57 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Sun May 25, 2025 11:58 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Sun May 25, 2025 11:59 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Tue Jan 06, 2026 8:35 pm
by xyilla
Re: MQ2ItemDisplay.cpp
Posted: Tue Jan 06, 2026 8:36 pm
by xyilla