Player.AddNotification (Civ5 API)
This page is a part of the Lua and UI Reference (Civ5).
|This function is a member of Player.|
This is an instance method, invoke it with a colon.
Triggers a notification for a Player. Notifications appear as icons on the right side of the screen.
notificationType: No description available. description: The text displayed when mousing over the icon title: The text displayed (temporarily) next to the icon x: X coordinate of relevant plot; use -1 if notification is not tied to a specific location y: Y coordinate of relevant plot; use -1 if notification is not tied to a specific location extra1: Optional additional information needed by some notification types extra2: Optional additional information needed by some notification types
local pPlayer = Players[Game.GetActivePlayer()] local pCity = pPlayer:GetCapitalCity() local sTitle = "Plague strikes " .. pCity:GetName() local sText = pCity:GetName() .. " is suffering from plague; population has been decreased" pPlayer:AddNotification(NotificationTypes.NOTIFICATION_STARVING, sText, sTitle, pCity:GetX(), pCity:GetY())
Source code samples
TurnsRemaining.lua - DLC_02 DLC
player:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, text, heading);
pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, text, heading);
pActivePlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, sMessage, sSummary, -1, -1, iNewOwner);
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.