Game.GetActivePlayer (Civ5 API)

From Civilization Modding Wiki
Revision as of 19:36, 19 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Game.

This is a static method, invoke it with a dot.


Usage

PlayerID Game.GetActivePlayer()


Returned Value

No description available.


Source code samples

Too many occurences. Only 50 out of 513 are listed.

ActionInfoPanel.lua

UI/InGame/WorldView/ActionInfoPanel.lua
0074
local player = Players[Game.GetActivePlayer()];
0233
local iActivePlayer = Game.GetActivePlayer();
0414
local pPlayer = Players[Game.GetActivePlayer()];


AdvisorCounselPopup.lua

UI/InGame/Popups/AdvisorCounselPopup.lua
0195
CivIconHookup( Game.GetActivePlayer(), 64, Controls.Icon, Controls.CivIconBG, Controls.CivIconShadow, false, true );


ChangePassword.lua

UI/InGame/ChangePassword.lua
0008
local ePlayer = Game.GetActivePlayer();
0015
LuaEvents.PasswordChanged( Game.GetActivePlayer() );


CityBannerManager.lua

UI/InGame/CityBannerManager.lua
0814
local active_team = Players[Game.GetActivePlayer()]:GetTeam();
0992
if (player:GetID() ~= Game.GetActivePlayer()) then


CityStateDiploPopup.lua

UI/InGame/Popups/CityStateDiploPopup.lua
0643
if (iPlayerLoop ~= Game.GetActivePlayer()) then


CityStateDiploPopup.lua (G&K)

DLC/Expansion/UI/InGame/Popups/CityStateDiploPopup.lua
0637
Game.DoMinorPledgeProtection(Game.GetActivePlayer(), g_iMinorCivID, true);


CityStateGreetingPopup.lua

UI/InGame/Popups/CityStateGreetingPopup.lua
0227
if (iAlly ~= Game.GetActivePlayer()) then


CivilopediaScreen.lua

UI/Civilopedia/CivilopediaScreen.lua
2348
cost = Players[Game.GetActivePlayer()]:GetUnitProductionNeeded( unitID );
2733
cost = Players[Game.GetActivePlayer()]:GetBuildingProductionNeeded( buildingID );


Demographics.lua

UI/InGame/Popups/Demographics.lua
0464
BuildList( Game.GetActivePlayer() );


DiploCorner.lua

UI/InGame/WorldView/DiploCorner.lua
0041
{ text = Locale.Lookup("TXT_KEY_POP_NOTIFICATION_LOG"),            call=function() Popup(ButtonPopupTypes.BUTTONPOPUP_NOTIFICATION_LOG,Game.GetActivePlayer()); end };
0404
if( which == 1 ) then Events.EndGameShow( EndGameTypes.Technology, Game.GetActivePlayer() );
0406
elseif( which == 3 ) then Events.EndGameShow( EndGameTypes.Culture, Game.GetActivePlayer() );
0408
elseif( which == 5 ) then Events.EndGameShow( EndGameTypes.Time, Game.GetActivePlayer() );


DiploCorner.lua - DLC_01 DLC

DLC/DLC_01/Scenarios/Mongol Scenario/DiploCorner.lua
0030
g_MultiPullInfo[5] = { text="TXT_KEY_POP_NOTIFICATION_LOG",      call=function() Events.SerialEventGameMessagePopup( { Type = ButtonPopupTypes.BUTTONPOPUP_NOTIFICATION_LOG, Data1 = Game.GetActivePlayer() } ); end };


DiploCorner.lua (G&K)

DLC/Expansion/UI/InGame/WorldView/DiploCorner.lua
0393
local iLocalPlayer = Game.GetActivePlayer();


DiploCurrentDeals.lua

UI/InGame/Popups/DiploCurrentDeals.lua
0138
local iPlayer = Game.GetActivePlayer();


DiploList.lua

UI/InGame/DiploList.lua
0017
local g_iPlayer = Game.GetActivePlayer();


EspionageOverview.lua (G&K)

DLC/Expansion/UI/InGame/Popups/EspionageOverview.lua
0282
local activePlayer = Players[Game.GetActivePlayer()];
0328
Network.SendMoveSpy(Game.GetActivePlayer(), g_SelectedAgentID, -1, -1);
0717
Network.SendStageCoup(Game.GetActivePlayer(), v.AgentID);
0975
CivIconHookup( Game.GetActivePlayer(), 32, entry.CivIcon, entry.CivIconBG, entry.CivIconShadow, false, true);
1237
if (cityInfo.PlayerID == Game.GetActivePlayer()) then


GameMenu.lua

UI/InGame/Menus/GameMenu.lua
0286
info = GameInfo.HandicapInfos[ Players[Game.GetActivePlayer()]:GetHandicapType() ];


GenericWorldAnchor.lua

UI/InGame/GenericWorldAnchor.lua
0102
if (bShow and not Players[Game.GetActivePlayer()]:CanFound(iPlotX, iPlotY)) then


HappinessInfo.lua

UI/InGame/Popups/HappinessInfo.lua
0167
local iPlayerID = Game.GetActivePlayer();


InGame.lua (G&K)

DLC/Expansion/UI/InGame/InGame.lua
0257
local iFromPlayer = Game.GetActivePlayer();


LiberateMinorPopup.lua

UI/InGame/PopupsGeneric/LiberateMinorPopup.lua
0008
local pActivePlayer   = Players[Game.GetActivePlayer()];


MilitaryOverview.lua

UI/InGame/Popups/MilitaryOverview.lua
0073
Events.SerialEventUnitFlagSelected( Game:GetActivePlayer(), unitID );


PlayerChange.lua

UI/InGame/PlayerChange.lua
0009
if (PreGame.TestPassword( Game.GetActivePlayer(), Controls.EnterPasswordEditBox:GetText() )) then
0075
local bValid = PreGame.TestPassword( Game.GetActivePlayer(), Controls.EnterPasswordEditBox:GetText());


ProductionPopup.lua

UI/InGame/Popups/ProductionPopup.lua
0808
if playerID == Game.GetActivePlayer() and cityID == currentCityID then


ReligionOverview.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ReligionOverview.lua
0471
Network.SendFaithPurchase(Game.GetActivePlayer(), v1, v2);


TradeLogic.lua

UI/InGame/WorldView/TradeLogic.lua
0095
g_iUs = Game.GetActivePlayer();
0648
if( fromPlayer == Game.GetActivePlayer() ) then


TurnsRemaining.lua - DLC_04 DLC

DLC/DLC_04/Scenarios/1066Scenario/TurnsRemaining.lua
0038
Game.SetWinner(Players[Game.GetActivePlayer()]:GetTeam(), GameInfo.Victories["VICTORY_DOMINATION"].ID);
0158
if (iOldAlly == Game.GetActivePlayer())   then
0407
if (iHandicap > 4 and Game.GetActivePlayer() ~= iPlayer) then
0421
if (iHandicap > 6 and Game.GetActivePlayer() ~= iPlayer) then


TurnsRemaining.lua (G&K)

DLC/Expansion/Scenarios/MedievalScenario/TurnsRemaining.lua
0769
if (Game.GetActivePlayer() == iOwner) then


TurnsRemaining.lua (G&K)

DLC/Expansion/Scenarios/FallOfRomeScenario/TurnsRemaining.lua
0501
if (IsWesternRoman(Game.GetActivePlayer())) then
0966
local bIsPlayerBarbarian = not IsEmpire(Game.GetActivePlayer());


VictoryProgress.lua

UI/InGame/Popups/VictoryProgress.lua
0447
if(not v:IsMinorCiv() and v:IsAlive() and (leadAI == nil or v:GetNumPolicyBranchesFinished() > maxPolicies) and i ~= Game.GetActivePlayer()) then
0479
SimpleCivIconHookup( Game.GetActivePlayer(), 64, Controls.Icon );
0904
elseif(iPlayer == Game.GetActivePlayer()) then


VoteResultsPopup.lua

UI/InGame/Popups/VoteResultsPopup.lua
0121
elseif (pVoteCastPlayer:GetID() == Game.GetActivePlayer()) then



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.