Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Trigger.js
function Trigger() {} | function Trigger() {} | ||||
Trigger.prototype.Schema = | Trigger.prototype.Schema = | ||||
"<a:component type='system'/><empty/>"; | "<a:component type='system'/><empty/>"; | ||||
/** | /** | ||||
* Events we're able to receive and call handlers for. | * Events we're able to receive and call handlers for. | ||||
*/ | */ | ||||
Trigger.prototype.eventNames = | Trigger.prototype.eventNames = | ||||
[ | [ | ||||
"CinemaPathEnded", | "CinemaPathEnded", | ||||
"CinemaQueueEnded", | "CinemaQueueEnded", | ||||
"ConstructionStarted", | "ConstructionStarted", | ||||
"DiplomacyChanged", | |||||
"InitGame", | "InitGame", | ||||
"Interval", | "Interval", | ||||
"OwnershipChanged", | "OwnershipChanged", | ||||
"PlayerCommand", | "PlayerCommand", | ||||
"PlayerDefeated", | "PlayerDefeated", | ||||
"PlayerWon", | "PlayerWon", | ||||
"Range", | "Range", | ||||
"ResearchFinished", | "ResearchFinished", | ||||
▲ Show 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | Trigger.prototype.OnGlobalPlayerDefeated = function(msg) | ||||
this.CallEvent("PlayerDefeated", msg); | this.CallEvent("PlayerDefeated", msg); | ||||
}; | }; | ||||
Trigger.prototype.OnGlobalPlayerWon = function(msg) | Trigger.prototype.OnGlobalPlayerWon = function(msg) | ||||
{ | { | ||||
this.CallEvent("PlayerWon", msg); | this.CallEvent("PlayerWon", msg); | ||||
}; | }; | ||||
Trigger.prototype.OnGlobalDiplomacyChanged = function(msg) | |||||
{ | |||||
this.CallEvent("DiplomacyChanged", msg); | |||||
}; | |||||
/** | /** | ||||
* Execute a function after a certain delay. | * Execute a function after a certain delay. | ||||
* | * | ||||
* @param {Number} time - delay in milleseconds | * @param {Number} time - delay in milleseconds | ||||
* @param {String} action - Name of the action function | * @param {String} action - Name of the action function | ||||
* @param {Object} data - will be passed to the action function | * @param {Object} data - will be passed to the action function | ||||
*/ | */ | ||||
Trigger.prototype.DoAfterDelay = function(miliseconds, action, data) | Trigger.prototype.DoAfterDelay = function(miliseconds, action, data) | ||||
Show All 21 Lines |
Wildfire Games · Phabricator