Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/SkirmishReplacer.js
Show All 9 Lines | SkirmishReplacer.prototype.Schema = | ||||
"</optional>"; | "</optional>"; | ||||
SkirmishReplacer.prototype.Init = function() | SkirmishReplacer.prototype.Init = function() | ||||
{ | { | ||||
}; | }; | ||||
SkirmishReplacer.prototype.Serialize = null; // We have no dynamic state to save | SkirmishReplacer.prototype.Serialize = null; // We have no dynamic state to save | ||||
//this function gets the replacement entities from the {civ}.json file | |||||
function getReplacementEntities(civ) | function getReplacementEntities(civ) | ||||
{ | { | ||||
var rawCivData = Engine.ReadCivJSONFile(civ+".json"); | return Engine.ReadJSONFile("simulation/data/civs/" + civ + ".json").SkirmishReplacements; | ||||
if (rawCivData && rawCivData.SkirmishReplacements) | |||||
return rawCivData.SkirmishReplacements; | |||||
warn("SkirmishReplacer.js: no replacements found in '"+civ+".json'"); | |||||
return {}; | |||||
} | } | ||||
SkirmishReplacer.prototype.OnOwnershipChanged = function(msg) | SkirmishReplacer.prototype.OnOwnershipChanged = function(msg) | ||||
{ | { | ||||
if (msg.to == 0) | if (msg.to == 0) | ||||
warn("Skirmish map elements can only be owned by regular players. Please delete entity "+this.entity+" or change the ownership to a non-gaia player."); | warn("Skirmish map elements can only be owned by regular players. Please delete entity "+this.entity+" or change the ownership to a non-gaia player."); | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator