Bazaar developer reference

CvGame::mouseoverUnit(CvUnit *, bool)

Defined in
CvGame.cpp, line 2764
Class
CvGame
Hook name
CivHooks::CvGame_mouseoverUnit

Hooks

static bool BeforeCvGame_mouseoverUnit(CvGame* self, CvUnit * pUnit, bool bEnter);static void AfterCvGame_mouseoverUnit(CvGame* self, CvUnit * pUnit, bool bEnter);static void ReplaceCvGame_mouseoverUnit(void (*original)(CvGame*, CvUnit *, bool), CvGame* self, CvUnit * pUnit, bool bEnter);CivRegisterBefore<CivHooks::CvGame_mouseoverUnit>(host, &BeforeCvGame_mouseoverUnit);CivRegisterAfter<CivHooks::CvGame_mouseoverUnit>(host, &AfterCvGame_mouseoverUnit);CivRegisterReplace<CivHooks::CvGame_mouseoverUnit>(host, &ReplaceCvGame_mouseoverUnit);

Code

2764void CvGame::mouseoverUnit(CvUnit *pUnit, bool bEnter)2765{2766	CvUnit *pkSelectedUnit;27672768	if (pUnit)2769	{2770		if (bEnter) {2771			IfTradeUnit_DisplayPopupTradeRoute(pUnit);2772			m_iLastMouseoverUnitID = pUnit->GetID();2773		} else {2774			if (pUnit->GetID() == m_iLastMouseoverUnitID) {2775				gDLL->TradeVisuals_DeactivatePopupRoute();27762777				//reactivate selected unit's popup route2778				auto_ptr<ICvUnit1> pSelectedUnit(GC.GetEngineUserInterface()->GetHeadSelectedUnit());2779				pkSelectedUnit = GC.UnwrapUnitPointer(pSelectedUnit.get());2780				IfTradeUnit_DisplayPopupTradeRoute(pkSelectedUnit);2781			}2782		}2783	}2784}

Calls

Called by