Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Identity.js
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | "<element name='Icon'>" + | |||||||||||
"<text/>" + | "<text/>" + | |||||||||||
"</element>" + | "</element>" + | |||||||||||
"</optional>" + | "</optional>" + | |||||||||||
"<optional>" + | "<optional>" + | |||||||||||
"<element name='RequiredTechnology' a:help='Optional name of a technology which must be researched before the entity can be produced.'>" + | "<element name='RequiredTechnology' a:help='Optional name of a technology which must be researched before the entity can be produced.'>" + | |||||||||||
"<text/>" + | "<text/>" + | |||||||||||
"</element>" + | "</element>" + | |||||||||||
"</optional>" + | "</optional>" + | |||||||||||
"<optional>" + | ||||||||||||
"<element name='Controllable' a:help='Whether players can control this entity. Defaults to true.'>" + | ||||||||||||
"<data type='boolean'/>" + | ||||||||||||
"</element>" + | ||||||||||||
"</optional>" + | ||||||||||||
"<element name='Undeletable' a:help='Prevent players from deleting this entity.'>" + | "<element name='Undeletable' a:help='Prevent players from deleting this entity.'>" + | |||||||||||
"<data type='boolean'/>" + | "<data type='boolean'/>" + | |||||||||||
"</element>"; | "</element>"; | |||||||||||
Identity.prototype.Init = function() | Identity.prototype.Init = function() | |||||||||||
{ | { | |||||||||||
this.classesList = GetIdentityClasses(this.template); | this.classesList = GetIdentityClasses(this.template); | |||||||||||
this.visibleClassesList = GetVisibleIdentityClasses(this.template); | this.visibleClassesList = GetVisibleIdentityClasses(this.template); | |||||||||||
if (this.template.Phenotype) | if (this.template.Phenotype) | |||||||||||
this.phenotype = pickRandom(this.GetPossiblePhenotypes()); | this.phenotype = pickRandom(this.GetPossiblePhenotypes()); | |||||||||||
else | else | |||||||||||
this.phenotype = "default"; | this.phenotype = "default"; | |||||||||||
this.controllable = this.template.Controllable ? this.template.Controllable == "true" : true; | ||||||||||||
bbUnsubmitted Done Inline Actions
bb: | ||||||||||||
}; | }; | |||||||||||
Identity.prototype.HasSomeFormation = function() | Identity.prototype.HasSomeFormation = function() | |||||||||||
{ | { | |||||||||||
return this.GetFormationsList().length > 0; | return this.GetFormationsList().length > 0; | |||||||||||
}; | }; | |||||||||||
Identity.prototype.GetCiv = function() | Identity.prototype.GetCiv = function() | |||||||||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | Identity.prototype.GetGenericName = function() | |||||||||||
return this.template.GenericName; | return this.template.GenericName; | |||||||||||
}; | }; | |||||||||||
Identity.prototype.IsUndeletable = function() | Identity.prototype.IsUndeletable = function() | |||||||||||
{ | { | |||||||||||
return this.template.Undeletable == "true"; | return this.template.Undeletable == "true"; | |||||||||||
}; | }; | |||||||||||
Identity.prototype.IsControllable = function() | ||||||||||||
{ | ||||||||||||
return this.controllable; | ||||||||||||
}; | ||||||||||||
Identity.prototype.SetControllable = function(controllability) | ||||||||||||
Done Inline Actionsbool → controllable? Stan: bool → controllable? | ||||||||||||
Done Inline ActionsThis can not be used when selecting entities owned by another player and one has the ControlAllUnits on. Freagarach: This can not be used when selecting entities owned by another player and one has the… | ||||||||||||
Done Inline ActionsHmm, indeed, that's GUI-dependent. Probably needs a special check on the GUI-side too (or as an alternative) wraitii: Hmm, indeed, that's GUI-dependent.
Probably needs a special check on the GUI-side too (or as… | ||||||||||||
{ | ||||||||||||
this.controllable = controllability; | ||||||||||||
Not Done Inline ActionsWe could do something like garrisonable does, namely keeping track of who set us to uncontrollable? Freagarach: We could do something like garrisonable does, namely keeping track of who set us to… | ||||||||||||
}; | ||||||||||||
Engine.RegisterComponentType(IID_Identity, "Identity", Identity); | Engine.RegisterComponentType(IID_Identity, "Identity", Identity); |
Wildfire Games · Phabricator