Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/ResourceDropsite.js
Show All 12 Lines | ResourceDropsite.prototype.Schema = | ||||
"</element>"; | "</element>"; | ||||
ResourceDropsite.prototype.Init = function() | ResourceDropsite.prototype.Init = function() | ||||
{ | { | ||||
this.sharable = this.template.Sharable == "true"; | this.sharable = this.template.Sharable == "true"; | ||||
this.shared = this.sharable; | this.shared = this.sharable; | ||||
}; | }; | ||||
ResourceDropsite.prototype.Update = function(newTemplate) | |||||
{ | |||||
this.template = newTemplate; | |||||
let wasSharable = this.sharable; | |||||
this.sharable = this.template.Sharable == "true"; | |||||
if (this.sharable && !wasSharable) | |||||
this.shared = this.sharable; | |||||
}; | |||||
/** | /** | ||||
* Returns the list of resource types accepted by this dropsite, | * Returns the list of resource types accepted by this dropsite, | ||||
* as defined by it being referred to in the template and the resource being enabled. | * as defined by it being referred to in the template and the resource being enabled. | ||||
*/ | */ | ||||
ResourceDropsite.prototype.GetTypes = function() | ResourceDropsite.prototype.GetTypes = function() | ||||
{ | { | ||||
let types = ApplyValueModificationsToEntity("ResourceDropsite/Types", this.template.Types, this.entity); | let types = ApplyValueModificationsToEntity("ResourceDropsite/Types", this.template.Types, this.entity); | ||||
return types.split(/\s+/); | return types.split(/\s+/); | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator