Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GuiInterface.js
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | if (cmpMirage) | ||||
ret.mirage = true; | ret.mirage = true; | ||||
let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | ||||
if (cmpIdentity) | if (cmpIdentity) | ||||
ret.identity = { | ret.identity = { | ||||
"rank": cmpIdentity.GetRank(), | "rank": cmpIdentity.GetRank(), | ||||
"classes": cmpIdentity.GetClassesList(), | "classes": cmpIdentity.GetClassesList(), | ||||
"visibleClasses": cmpIdentity.GetVisibleClassesList(), | "visibleClasses": cmpIdentity.GetVisibleClassesList(), | ||||
"selectionGroupName": cmpIdentity.GetSelectionGroupName(), | "selectionGroupName": cmpIdentity.GetSelectionGroupName() | ||||
"canDelete": !cmpIdentity.IsUndeletable() | |||||
}; | }; | ||||
let cmpPosition = Engine.QueryInterface(ent, IID_Position); | let cmpPosition = Engine.QueryInterface(ent, IID_Position); | ||||
if (cmpPosition && cmpPosition.IsInWorld()) | if (cmpPosition && cmpPosition.IsInWorld()) | ||||
ret.position = cmpPosition.GetPosition(); | ret.position = cmpPosition.GetPosition(); | ||||
let cmpHealth = QueryMiragedInterface(ent, IID_Health); | let cmpHealth = QueryMiragedInterface(ent, IID_Health); | ||||
if (cmpHealth) | if (cmpHealth) | ||||
{ | { | ||||
ret.hitpoints = cmpHealth.GetHitpoints(); | ret.hitpoints = cmpHealth.GetHitpoints(); | ||||
ret.maxHitpoints = cmpHealth.GetMaxHitpoints(); | ret.maxHitpoints = cmpHealth.GetMaxHitpoints(); | ||||
ret.needsRepair = cmpHealth.IsRepairable() && cmpHealth.IsInjured(); | ret.needsRepair = cmpHealth.IsRepairable() && cmpHealth.IsInjured(); | ||||
ret.needsHeal = !cmpHealth.IsUnhealable(); | ret.needsHeal = !cmpHealth.IsUnhealable(); | ||||
} | } | ||||
let cmpCapturable = QueryMiragedInterface(ent, IID_Capturable); | let cmpCapturable = QueryMiragedInterface(ent, IID_Capturable); | ||||
if (cmpCapturable) | if (cmpCapturable) | ||||
{ | { | ||||
ret.capturePoints = cmpCapturable.GetCapturePoints(); | ret.capturePoints = cmpCapturable.GetCapturePoints(); | ||||
ret.maxCapturePoints = cmpCapturable.GetMaxCapturePoints(); | ret.maxCapturePoints = cmpCapturable.GetMaxCapturePoints(); | ||||
} | } | ||||
let cmpControllability = Engine.QueryInterface(ent, IID_Controllability); | |||||
if (cmpControllability) | |||||
{ | |||||
ret.controllability = cmpControllability.GetControllability(); | |||||
} | |||||
let cmpBuilder = Engine.QueryInterface(ent, IID_Builder); | let cmpBuilder = Engine.QueryInterface(ent, IID_Builder); | ||||
if (cmpBuilder) | if (cmpBuilder) | ||||
ret.builder = true; | ret.builder = true; | ||||
let cmpMarket = QueryMiragedInterface(ent, IID_Market); | let cmpMarket = QueryMiragedInterface(ent, IID_Market); | ||||
if (cmpMarket) | if (cmpMarket) | ||||
ret.market = { | ret.market = { | ||||
"land": cmpMarket.HasType("land"), | "land": cmpMarket.HasType("land"), | ||||
▲ Show 20 Lines • Show All 1,711 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator