Bazaar developer reference

CvDiplomacyAI::DoBeginDiploWithHuman()

Defined in
CvDiplomacyAI.cpp, line 16240
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoBeginDiploWithHuman

Hooks

static bool BeforeCvDiplomacyAI_DoBeginDiploWithHuman(CvDiplomacyAI* self);static void AfterCvDiplomacyAI_DoBeginDiploWithHuman(CvDiplomacyAI* self);static void ReplaceCvDiplomacyAI_DoBeginDiploWithHuman(void (*original)(CvDiplomacyAI*), CvDiplomacyAI* self);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoBeginDiploWithHuman>(host, &BeforeCvDiplomacyAI_DoBeginDiploWithHuman);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoBeginDiploWithHuman>(host, &AfterCvDiplomacyAI_DoBeginDiploWithHuman);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoBeginDiploWithHuman>(host, &ReplaceCvDiplomacyAI_DoBeginDiploWithHuman);

Code

16239/// Initiate diplo screen with default state16240void CvDiplomacyAI::DoBeginDiploWithHuman()16241{16242	if(!GC.getGame().isOption(GAMEOPTION_ALWAYS_WAR))16243	{16244#if defined(MOD_AI_MP_DIPLOMACY)16245		bool bShowLeaderMessage = true;16246		16247		if (MOD_AI_MP_DIPLOMACY) {16248			// JdH => go into the deal, if there is anything proposed16249			PlayerTypes eTo = GC.getGame().getActivePlayer();16250			CvPlayer& kTo = GET_PLAYER(eTo);16251			CvDiplomacyRequests* pRequests = kTo.GetDiplomacyRequests();16252			pRequests->ActivateAllFrom(GetPlayer()->GetID());16253			16254			bShowLeaderMessage = !pRequests->HasActiveRequest();16255		}1625616257		if (bShowLeaderMessage)16258		{16259#endif16260		LeaderheadAnimationTypes eAnimation = LEADERHEAD_ANIM_NEUTRAL_HELLO;16261		const char* szText = GetGreetHumanMessage(eAnimation);1626216263#if defined(MOD_API_EXTENSIONS) && defined(MOD_DIPLOMACY_NO_LEADERHEADS)16264		if (MOD_DIPLOMACY_NO_LEADERHEADS) {16265			CvPreGame::pushGameType(GAME_NETWORK_MULTIPLAYER);16266		}16267#endif16268				16269// CUSTOMLOG("STFU@%i: DoBeginDiploWithHuman for player %i", GC.getGame().getGameTurn(), GetPlayer()->GetID());16270		gDLL->GameplayDiplomacyAILeaderMessage(GetPlayer()->GetID(), DIPLO_UI_STATE_DEFAULT_ROOT, szText, eAnimation);16271		DIPLOMACYLOG(m_pPlayer->GetID(), szText, GetPlayer()->GetID(), DIPLO_UI_STATE_DEFAULT_ROOT, DIPLO_MESSAGE_GREETING_NEUTRAL_HELLO);16272#if defined(MOD_AI_MP_DIPLOMACY)16273		}16274#endif16275	}16276}

Calls

Called by