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
- CvGlobals::getDLLIFace()
- CvGlobals::GetEngineUserInterface()
- CvGlobals::UnwrapUnitPointer(ICvUnit1 *)
- CvUnit::GetID() const
ICvEngineUtility3::TradeVisuals_DeactivatePopupRouteICvUserInterface1::GetHeadSelectedUnit- IfTradeUnit_DisplayPopupTradeRoute(CvUnit *)
std::auto_ptr::auto_ptrstd::auto_ptr::get