Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Player.js
Show First 20 Lines • Show All 857 Lines • ▼ Show 20 Lines | Engine.BroadcastMessage(MT_TributeExchanged, { | ||||
"amounts": amounts | "amounts": amounts | ||||
}); | }); | ||||
}; | }; | ||||
Player.prototype.AddDisabledTemplate = function(template) | Player.prototype.AddDisabledTemplate = function(template) | ||||
{ | { | ||||
this.disabledTemplates[template] = true; | this.disabledTemplates[template] = true; | ||||
Engine.BroadcastMessage(MT_DisabledTemplatesChanged, {}); | Engine.BroadcastMessage(MT_DisabledTemplatesChanged, {}); | ||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | |||||
cmpGuiInterface.PushNotification({ | |||||
"type": "resetselectionpannel", | |||||
"players": [this.GetPlayerID()] | |||||
}); | |||||
}; | }; | ||||
Player.prototype.RemoveDisabledTemplate = function(template) | Player.prototype.RemoveDisabledTemplate = function(template) | ||||
{ | { | ||||
this.disabledTemplates[template] = false; | this.disabledTemplates[template] = false; | ||||
Engine.BroadcastMessage(MT_DisabledTemplatesChanged, {}); | Engine.BroadcastMessage(MT_DisabledTemplatesChanged, {}); | ||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | |||||
cmpGuiInterface.PushNotification({ | |||||
"type": "resetselectionpannel", | |||||
"players": [this.GetPlayerID()] | |||||
}); | |||||
}; | }; | ||||
Player.prototype.SetDisabledTemplates = function(templates) | Player.prototype.SetDisabledTemplates = function(templates) | ||||
{ | { | ||||
this.disabledTemplates = {}; | this.disabledTemplates = {}; | ||||
for (let template of templates) | for (let template of templates) | ||||
this.disabledTemplates[template] = true; | this.disabledTemplates[template] = true; | ||||
Engine.BroadcastMessage(MT_DisabledTemplatesChanged, {}); | Engine.BroadcastMessage(MT_DisabledTemplatesChanged, {}); | ||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | |||||
cmpGuiInterface.PushNotification({ | |||||
"type": "resetselectionpannel", | |||||
"players": [this.GetPlayerID()] | |||||
}); | |||||
}; | }; | ||||
Player.prototype.GetDisabledTemplates = function() | Player.prototype.GetDisabledTemplates = function() | ||||
{ | { | ||||
return this.disabledTemplates; | return this.disabledTemplates; | ||||
}; | }; | ||||
Player.prototype.AddDisabledTechnology = function(tech) | Player.prototype.AddDisabledTechnology = function(tech) | ||||
Show All 36 Lines |
Wildfire Games · Phabricator