Bazaar developer reference

CvPlayer::getPlayerTextColor() const

Defined in
CvPlayer.cpp, line 18633
Class
CvPlayer
Hook name
CivHooks::CvPlayer_getPlayerTextColor

Hooks

static bool BeforeCvPlayer_getPlayerTextColor(const CvPlayer* self, const CvColorA*& result);static void AfterCvPlayer_getPlayerTextColor(const CvPlayer* self, const CvColorA*& result);static const CvColorA& ReplaceCvPlayer_getPlayerTextColor(const CvColorA& (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_getPlayerTextColor>(host, &BeforeCvPlayer_getPlayerTextColor);CivRegisterAfter<CivHooks::CvPlayer_getPlayerTextColor>(host, &AfterCvPlayer_getPlayerTextColor);CivRegisterReplace<CivHooks::CvPlayer_getPlayerTextColor>(host, &ReplaceCvPlayer_getPlayerTextColor);

Code

18633const CvColorA& CvPlayer::getPlayerTextColor() const18634{18635	CvAssertMsg(getPlayerColor() != NO_PLAYERCOLOR, "getPlayerColor() is not expected to be equal with NO_PLAYERCOLOR");18636	CvPlayerColorInfo* pkPlayerColorInfo = GC.GetPlayerColorInfo(getPlayerColor());18637	CvColorInfo* pkColorInfo = NULL;18638	if(pkPlayerColorInfo)18639	{18640		ColorTypes eTextColor = static_cast<ColorTypes>(pkPlayerColorInfo->GetColorTypeText());18641		pkColorInfo = GC.GetColorInfo(eTextColor);18642		if(pkColorInfo)18643			return pkColorInfo->GetColor();18644	}1864518646	//Default to black text if no color exists.18647	static CvColorA black(0,0,0,1.0f);18648	return black;18649}

Calls