mercenary caption color fix
Posted: Wed Oct 29, 2008 9:54 pm
When mercenarys are untargetted their names would show up as black, then when you target it, they would show up as yellow. Adding the following highlighted lines is a real simple fix. Testing this out however if you target a mercenary and then use escape to clear your target, there is a fraction of a second where the caption over the mercenary disappears, and I don't know what's causing it or how to fix it.
MQ2Main\MQ2Spawns.cpp:
MQ2Main\MQ2Spawns.cpp:
Code: Select all
VOID SetNameSpriteTint(PSPAWNINFO pSpawn)
{
if (!gMQCaptions) return;
// DebugSpew("SetNameSpriteTint(%s)",pSpawn->Name);
DWORD NewColor;
switch(GetSpawnType(pSpawn))
{
case PC:
/*
#define CC_PC 0
#define CC_PCConColor 1
#define CC_PCPVPTeamColor 2
#define CC_PCRaidColor 3
#define CC_PCClassColor 4
#define CC_PCGroupColor 5
#define CC_PCTrader 6
/**/
if (pSpawn->Trader && CaptionColors[CC_PCTrader].Enabled)
NewColor=CaptionColors[CC_PCTrader].Color;
else if (CaptionColors[CC_PCGroupColor].Enabled && IsGroupMember(pSpawn))
NewColor=CaptionColors[CC_PCGroupColor].Color;
else if (CaptionColors[CC_PCClassColor].Enabled)
NewColor=((PEQRAIDWINDOW)pRaidWnd)->ClassColors[ClassInfo[pSpawn->Class].RaidColorOrder];
else if (CaptionColors[CC_PCRaidColor].Enabled && IsRaidMember(pSpawn))
NewColor=CaptionColors[CC_PCRaidColor].Color;
else if (CaptionColors[CC_PCPVPTeamColor].Enabled)
{
// TODO
}
else if (CaptionColors[CC_PCConColor].Enabled)
NewColor=ConColorToARGB(ConColor(pSpawn));
else if (CaptionColors[CC_PC].Enabled)
NewColor=CaptionColors[CC_PC].Color;
else
{
((EQPlayerHook*)pSpawn)->SetNameSpriteTint_Trampoline();
return;
}
break;
case NPC:
/*
#define CC_NPC 7
#define CC_NPCConColor 8
#define CC_NPCClassColor 9
#define CC_NPCMerchant 10
#define CC_NPCBanker 11
#define CC_NPCAssist 12
#define CC_NPCMark 13
/**/
if (CaptionColors[CC_NPCMark].Enabled && IsMarkedNPC(pSpawn))
NewColor=CaptionColors[CC_NPCMark].Color;
if (CaptionColors[CC_NPCAssist].Enabled && IsAssistNPC(pSpawn))
NewColor=CaptionColors[CC_NPCAssist].Color;
else if (CaptionColors[CC_NPCBanker].Enabled && pSpawn->Class==40)
NewColor=CaptionColors[CC_NPCBanker].Color;
else if (CaptionColors[CC_NPCMerchant].Enabled && (pSpawn->Class==41 || pSpawn->Class==61))
NewColor=CaptionColors[CC_NPCMerchant].Color;
else if (CaptionColors[CC_NPCClassColor].Enabled && pSpawn->Class<0x10)
NewColor=((PEQRAIDWINDOW)pRaidWnd)->ClassColors[ClassInfo[pSpawn->Class].RaidColorOrder];
else if (CaptionColors[CC_NPCConColor].Enabled)
NewColor=ConColorToARGB(ConColor(pSpawn));
else if (CaptionColors[CC_NPC].Enabled)
NewColor=CaptionColors[CC_NPC].Color;
else
{
((EQPlayerHook*)pSpawn)->SetNameSpriteTint_Trampoline();
return;
}
break;
case CORPSE:
if (CaptionColors[CC_CorpseClassColor].Enabled)
NewColor=((PEQRAIDWINDOW)pRaidWnd)->ClassColors[ClassInfo[pSpawn->Class].RaidColorOrder];
else if (CaptionColors[CC_Corpse].Enabled)
NewColor=CaptionColors[CC_Corpse].Color;
else
{
((EQPlayerHook*)pSpawn)->SetNameSpriteTint_Trampoline();
return;
}
break;
case PET:
if (CaptionColors[CC_PetClassColor].Enabled)
NewColor=((PEQRAIDWINDOW)pRaidWnd)->ClassColors[ClassInfo[pSpawn->Class].RaidColorOrder];
else if (CaptionColors[CC_PetConColor].Enabled)
NewColor=ConColorToARGB(ConColor(pSpawn));
else if (CaptionColors[CC_PetNPC].Enabled && ((PSPAWNINFO)GetSpawnByID(pSpawn->MasterID))->Type==SPAWN_NPC)
NewColor=CaptionColors[CC_PetNPC].Color;
else if (CaptionColors[CC_PetPC].Enabled && ((PSPAWNINFO)GetSpawnByID(pSpawn->MasterID))->Type==SPAWN_PLAYER)
NewColor=CaptionColors[CC_PetPC].Color;
else
{
((EQPlayerHook*)pSpawn)->SetNameSpriteTint_Trampoline();
return;
}
break;
case OBJECT:
((EQPlayerHook*)pSpawn)->SetNameSpriteTint_Trampoline();
return;
[color=red] case MERCENARY:
((EQPlayerHook*)pSpawn)->SetNameSpriteTint_Trampoline();
return;[/color]
}
DebugTry(((CActorEx *)pSpawn->pcactorex)->SetNameColor(NewColor));
}