Events (Civ5 Type)
This page is a part of the Lua and UI Reference (Civ5).
Usage
This object exposes events designed to make the UI react to data changes. You may try to use them to implement gameplay changes but be aware that those events may not be fired in circumstances where the UI do not need it. For example the events used by the city screen may not be fired for cities controlled by the AI.
Static Events
Events can be subscribed by using Events.SomeEvent.Add(SomeFunction)
. Regular events can also be fired through a dot by using Events.SomeEvent(<args>)
. This will invoke all subscribers with the provided arguments.
A
![]() |
![]() |
||||
![]() |
![]() |
![]() |
![]() |
|
ActivePlayerTurnEnd()
|
![]() |
![]() |
![]() |
![]() |
|
ActivePlayerTurnStart()
|
![]() |
![]() |
|
AddPopupTextEvent(Vector3 worldPosition, unknown text, int delay)
| ||
![]() |
![]() |
|
AddUnitMoveHexRangeHex(float i, float j, unknown k, bool attackMove, unknown unitID)
| ||
![]() |
![]() |
|
AdvisorDisplayHide()
| ||
![]() |
![]() |
|
AdvisorDisplayShow(AdvisorEventInfo info)
| ||
![]() |
![]() |
|
AfterModsActivate()
| ||
![]() |
![]() |
|
AfterModsDeactivate()
| ||
![]() |
![]() |
|
AILeaderMessage(PlayerID player, DiploUIStateType diploUIState, string leaderMessage, int animationAction, int data1)
| ||
![]() |
![]() |
|
AudioDebugChangeMusic(bool arg0, bool arg1, bool arg2)
| ||
![]() |
![]() |
|
AudioPlay2DSound(string audio)
|
B
![]() |
![]() |
||||
![]() |
![]() |
|
BuildingLibrarySwap(int assetCulture, int assetEra)
|
C
D
![]() |
![]() |
||||
![]() |
![]() |
|
DisplayMovementIndicator(bool show)
|
E
![]() |
![]() |
||||
![]() |
![]() |
|
EndCombatSim(PlayerID attackingPlayer, UnitID attackingUnit, int attackingUnitDamage, int attackingUnitFinalDamage, int attackingUnitMaxHitPoints, PlayerID defendingPlayer, UnitID defendingUnit, int defendingUnitDamage, int defendingUnitFinalDamage, int defendingUnitMaxHitPoints)
| ||
![]() |
![]() |
|
EndGameShow(EndGameType type, TeamID team)
| ||
![]() |
![]() |
|
EndTurnBlockingChanged(EndTurnBlockingType prevEndTurnBlockingType, EndTurnBlockingType newEndTurnBlockingType)
| ||
![]() |
![]() |
|
EndTurnTimerUpdate(int percentComplete)
| ||
![]() |
![]() |
|
EventOpenOptionsScreen()
| ||
![]() |
![]() |
|
EventPoliciesDirty()
| ||
![]() |
![]() |
|
ExitToMainMenu()
|
F
![]() |
![]() |
||||
![]() |
![]() |
|
FrontEndPopup(string string)
|
G
![]() |
![]() |
||||
![]() |
![]() |
|
GameMessageChat(PlayerID fromPlayer, PlayerID toPlayer, string text, ChatTargetType targetType)
| ||
![]() |
![]() |
|
GameOptionsChanged()
| ||
![]() |
![]() |
|
GameplayAlertMessage(unknown data)
| ||
![]() |
![]() |
|
GameplayFX(float arg0, float arg1, int arg2)
| ||
![]() |
![]() |
|
GameplaySetActivePlayer(PlayerID activePlayer, int prevActivePlayer)
| ||
![]() |
![]() |
|
GenericWorldAnchor(GenericWorldAnchorType type, bool show, int plotX, int plotY, FeatureType data1 = nil)
| ||
![]() |
![]() |
|
GoToPediaHomePage(ImprovementType homePage)
| ||
![]() |
![]() |
|
GraphicsOptionsChanged()
|
H
![]() |
![]() |
||||
![]() |
![]() |
|
HexFOWStateChanged(Vector2 hexPos, int fowType, bool wholeMap)
| ||
![]() |
![]() |
|
HexYieldMightHaveChanged(int gridX, int gridY)
|
I
![]() |
![]() |
||||
![]() |
![]() |
|
InitCityRangeStrike(PlayerID Player, CityID CityID)
| ||
![]() |
![]() |
|
InstalledModsUpdated()
| ||
![]() |
![]() |
|
InterfaceModeChanged(InterfaceMode oldInterfaceMode, InterfaceMode newInterfaceMode)
|
K
![]() |
![]() |
||||
![]() |
![]() |
|
KeyUpEvent(KeyType wParam)
|
L
![]() |
![]() |
||||
![]() |
![]() |
|
LandmarkLibrarySwap()
| ||
![]() |
![]() |
|
LeavingLeaderViewMode()
| ||
![]() |
![]() |
|
LoadScreenClose()
| ||
![]() |
![]() |
|
LocalMachineAppUpdate(unknown tickCount, int timeIncrement)
| ||
![]() |
![]() |
|
LocalMachineUnitPositionChanged(PlayerID player, UnitID unitID, Vector3 unitPosition)
|
M
![]() |
![]() |
||||
![]() |
![]() |
|
MinimapClickedEvent(int x, int y)
| ||
![]() |
![]() |
|
MinimapTextureBroadcastEvent(unknown uiHandle, int width, int height, unknown paddingX)
| ||
![]() |
![]() |
|
MultiplayerConnectionFailed()
| ||
![]() |
![]() |
|
MultiplayerGameAbandoned(NetKicked reason)
| ||
![]() |
![]() |
|
MultiplayerGameInvite()
| ||
![]() |
![]() |
|
MultiplayerGameLaunched()
| ||
![]() |
![]() |
|
MultiplayerGameListClear()
| ||
![]() |
![]() |
|
MultiplayerGameListComplete()
| ||
![]() |
![]() |
|
MultiplayerGamePlayerDisconnected(PlayerID player)
| ||
![]() |
![]() |
|
MultiplayerGamePlayerUpdated()
| ||
![]() |
![]() |
|
MultiplayerJoinRoomComplete()
| ||
![]() |
![]() |
|
MultiplayerJoinRoomFailed(NetError extendedError, unknown aExtendedErrorText)
| ||
![]() |
![]() |
|
MultiplayerPingTimesChanged()
|
N
![]() |
![]() |
||||
![]() |
![]() |
|
NaturalWonderRevealed(float i, int j)
| ||
![]() |
![]() |
|
NotificationAdded(CityAIFocusType notification, NotificationType notificationType, string toolTip, string summary, int gameValue, TechType extraGameData)
| ||
![]() |
![]() |
|
NotificationRemoved(CityAIFocusType )
|
O
![]() |
![]() |
||||
![]() |
![]() |
|
OpenInfoCorner(InfoCornerID infoType)
| ||
![]() |
![]() |
|
OpenPlayerDealScreenEvent(PlayerID player, int target = nil)
|
P
![]() |
![]() |
||||
![]() |
![]() |
|
ParticleEffectReloadRequested()
| ||
![]() |
![]() |
|
ParticleEffectStatsRequested()
| ||
![]() |
![]() |
|
ParticleEffectStatsResponse(unknown responseData)
| ||
![]() |
![]() |
|
PlayerChoseToLoadGame(string thisLoadFile, bool arg1 = nil)
| ||
![]() |
![]() |
|
PlayerVersionMismatchEvent(PlayerID player, unknown playerName, bool isHost)
| ||
![]() |
![]() |
|
PreGameDirty()
|
R
![]() |
![]() |
||||
![]() |
![]() |
|
RemotePlayerTurnEnd()
| ||
![]() |
![]() |
|
RemoveAllArrowsEvent()
| ||
![]() |
![]() |
|
RequestYieldDisplay(YieldDisplayType type, ResourceType arg1 = nil, ResourceType gridX = nil, int gridY = nil)
| ||
![]() |
![]() |
![]() |
![]() |
|
RunCombatSim(PlayerID attackingPlayer, UnitID attackingUnit, int attackingUnitDamage, int attackingUnitFinalDamage, int attackingUnitMaxHitPoints, PlayerID defendingPlayer, UnitID defendingUnit, int defendingUnitDamage, int defendingUnitFinalDamage, int defendingUnitMaxHitPoints)
|
S
T
![]() |
![]() |
||||
![]() |
![]() |
|
TaskListUpdate(PopupInfo TaskListInfo)
| ||
![]() |
![]() |
|
TechAcquired()
|
U
![]() |
![]() |
||||
![]() |
![]() |
|
UIPathFinderUpdate(unknown data)
| ||
![]() |
![]() |
|
UnitActionChanged(PlayerID player, UnitID unitID)
| ||
![]() |
![]() |
|
UnitDataEdited(int floatVarList, int memberCount, int memberIndex, bool isDebugFSM, SpecialistType specRender, bool isFromLua = nil)
| ||
![]() |
![]() |
|
UnitDataRequested(int arg0)
| ||
![]() |
![]() |
|
UnitDebugFSM(int arg0)
| ||
![]() |
![]() |
|
UnitEmbark(PlayerID player, UnitID unitID)
| ||
![]() |
![]() |
|
UnitFlagUpdated(int unitCulture, int unitType, float unitHealth, bool unitFortified)
| ||
![]() |
![]() |
|
UnitGarrison(PlayerID player, UnitID unitID, int garrisoned)
| ||
![]() |
![]() |
|
UnitHexHighlight(float i, int j, unknown k, bool on, int unitId)
| ||
![]() |
![]() |
|
UnitLibrarySwap()
| ||
![]() |
![]() |
|
UnitMarkThreatening(PlayerID player, UnitID unitID, bool mark)
| ||
![]() |
![]() |
|
UnitMemberCombatStateChanged(PlayerID player, UnitID unitID, int memberID, unknown stateID)
| ||
![]() |
![]() |
|
UnitMemberCombatTargetChanged(PlayerID player, UnitID unitID, int memberID, unknown targetPlayerID, unknown targetUnitID, int targetMemberID)
| ||
![]() |
![]() |
|
UnitMemberOverlayAdd(PlayerID player, UnitID unitID, int memberID, unknown position)
| ||
![]() |
![]() |
|
UnitMemberOverlayRemove(PlayerID player, UnitID unitID, int memberID)
| ||
![]() |
![]() |
|
UnitMemberOverlayShowHide(PlayerID player, UnitID unitID, int memberID, bool show)
| ||
![]() |
![]() |
|
UnitMemberPositionChanged(PlayerID player, UnitID unitID, int memberID, unknown unitPosition)
| ||
![]() |
![]() |
|
UnitMoveQueueChanged(PlayerID player, UnitID unitID, bool remainingMoves)
| ||
![]() |
![]() |
|
UnitSelectionChanged(PlayerID player, UnitID u, float hexX, float hexY, int k, bool isSelected, bool arg6)
| ||
![]() |
![]() |
|
UnitSelectionCleared()
| ||
![]() |
![]() |
|
UnitShouldDimFlag(PlayerID player, UnitID unitID, int dim)
| ||
![]() |
![]() |
|
UnitStateChangeDetected(PlayerID player, UnitID unitID, int fogState)
| ||
![]() |
![]() |
|
UnitTypeChanged(string arg0)
| ||
![]() |
![]() |
|
UnitVisibilityChanged(PlayerID player, UnitID unitID, bool visible, bool checkFlag, unknown blendTime)
| ||
![]() |
![]() |
|
UserRequestClose()
|
W
![]() |
![]() |
||||
![]() |
![]() |
|
WarStateChanged(TeamID team1, TeamID team2, bool war)
| ||
![]() |
![]() |
|
WorldMouseOver(int worldHasMouseOver)
|
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.