Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GuiInterface.js
Show First 20 Lines • Show All 496 Lines • ▼ Show 20 Lines | ret.resourceTrickle = { | ||||
"interval": cmpResourceTrickle.GetTimer(), | "interval": cmpResourceTrickle.GetTimer(), | ||||
"rates": cmpResourceTrickle.GetRates() | "rates": cmpResourceTrickle.GetRates() | ||||
}; | }; | ||||
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.GetRunSpeedMultiplier() | "run": cmpUnitMotion.GetWalkSpeed() * cmpUnitMotion.GetRunSpeedMultiplier(), | ||||
"current": cmpUnitMotion.GetSpeed(), | |||||
"tryingToMove" : cmpUnitMotion.IsTryingToMove() | |||||
}; | }; | ||||
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,462 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator