Differential D1323 Diff 16923 ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
Show First 20 Lines • Show All 570 Lines • ▼ Show 20 Lines | GuiInterface.prototype.GetEntityState = function(player, ent) | ||||
let cmpUnitMotion = Engine.QueryInterface(ent, IID_UnitMotion); | let cmpUnitMotion = Engine.QueryInterface(ent, IID_UnitMotion); | ||||
if (cmpUnitMotion) | if (cmpUnitMotion) | ||||
ret.speed = { | ret.speed = { | ||||
"walk": cmpUnitMotion.GetWalkSpeed(), | "walk": cmpUnitMotion.GetWalkSpeed(), | ||||
"run": cmpUnitMotion.GetWalkSpeed() * cmpUnitMotion.GetRunMultiplier() | "run": cmpUnitMotion.GetWalkSpeed() * cmpUnitMotion.GetRunMultiplier() | ||||
}; | }; | ||||
let cmpUpkeep = Engine.QueryInterface(ent, IID_Upkeep); | |||||
if (cmpUpkeep) | |||||
ret.upkeep = { | |||||
"interval": cmpUpkeep.GetInterval(), | |||||
"rates": cmpUpkeep.GetRates() | |||||
}; | |||||
return ret; | return ret; | ||||
}; | }; | ||||
GuiInterface.prototype.GetMultipleEntityStates = function(player, ents) | GuiInterface.prototype.GetMultipleEntityStates = function(player, ents) | ||||
{ | { | ||||
return ents.map(ent => ({ "entId": ent, "state": this.GetEntityState(player, ent) })); | return ents.map(ent => ({ "entId": ent, "state": this.GetEntityState(player, ent) })); | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 1,528 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator