Hooks
static bool BeforeCvLuaCity_lCanConstructTooltip(lua_State* L, int& result);static void AfterCvLuaCity_lCanConstructTooltip(lua_State* L, int& result);static int ReplaceCvLuaCity_lCanConstructTooltip(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lCanConstructTooltip>(host, &BeforeCvLuaCity_lCanConstructTooltip);CivRegisterAfter<CivHooks::CvLuaCity_lCanConstructTooltip>(host, &AfterCvLuaCity_lCanConstructTooltip);CivRegisterReplace<CivHooks::CvLuaCity_lCanConstructTooltip>(host, &ReplaceCvLuaCity_lCanConstructTooltip);
Code
868int CvLuaCity::lCanConstructTooltip(lua_State* L)869{870 CvString toolTip;871 CvCity* pkCity = GetInstance(L);872 const BuildingTypes eBuilding = (BuildingTypes) lua_tointeger(L, 2);873874 // City Production Modifier875#if defined(MOD_API_EXTENSIONS)876 pkCity->canConstruct(eBuilding, false, false, false, false, &toolTip);877#else878 pkCity->canConstruct(eBuilding, false, false, false, &toolTip);879#endif880881 lua_pushstring(L, toolTip.c_str());882 return 1;883}