Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GuiInterface.js
Show First 20 Lines • Show All 747 Lines • ▼ Show 20 Lines | GuiInterface.prototype.IsStanceSelected = function(player, data) | ||||
{ | { | ||||
let cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI); | let cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI); | ||||
if (cmpUnitAI && cmpUnitAI.GetStanceName() == data.stance) | if (cmpUnitAI && cmpUnitAI.GetStanceName() == data.stance) | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
}; | }; | ||||
GuiInterface.prototype.IsPrefAttackSelected = function(player, data) | |||||
{ | |||||
for (let ent of data.ents) | |||||
Freagarach: `some` | |||||
{ | |||||
let cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI); | |||||
if (cmpUnitAI && cmpUnitAI.GetPrefAttack() == data.prefAttack) | |||||
return true; | |||||
let cmpBuildingAI = Engine.QueryInterface(ent, IID_BuildingAI); | |||||
if (cmpBuildingAI && cmpBuildingAI.GetPrefAttack() == data.prefAttack) | |||||
return true; | |||||
} | |||||
return false; | |||||
}; | |||||
GuiInterface.prototype.GetAllBuildableEntities = function(player, cmd) | GuiInterface.prototype.GetAllBuildableEntities = function(player, cmd) | ||||
{ | { | ||||
let buildableEnts = []; | let buildableEnts = []; | ||||
for (let ent of cmd.entities) | for (let ent of cmd.entities) | ||||
{ | { | ||||
let cmpBuilder = Engine.QueryInterface(ent, IID_Builder); | let cmpBuilder = Engine.QueryInterface(ent, IID_Builder); | ||||
if (!cmpBuilder) | if (!cmpBuilder) | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 1,165 Lines • ▼ Show 20 Lines | let exposedFunctions = { | ||||
"GetTimeNotifications": 1, | "GetTimeNotifications": 1, | ||||
"GetAvailableFormations": 1, | "GetAvailableFormations": 1, | ||||
"GetFormationRequirements": 1, | "GetFormationRequirements": 1, | ||||
"CanMoveEntsIntoFormation": 1, | "CanMoveEntsIntoFormation": 1, | ||||
"IsFormationSelected": 1, | "IsFormationSelected": 1, | ||||
"GetFormationInfoFromTemplate": 1, | "GetFormationInfoFromTemplate": 1, | ||||
"IsStanceSelected": 1, | "IsStanceSelected": 1, | ||||
"IsPrefAttackSelected": 1, | |||||
"UpdateDisplayedPlayerColors": 1, | "UpdateDisplayedPlayerColors": 1, | ||||
"SetSelectionHighlight": 1, | "SetSelectionHighlight": 1, | ||||
"GetAllBuildableEntities": 1, | "GetAllBuildableEntities": 1, | ||||
"SetStatusBars": 1, | "SetStatusBars": 1, | ||||
"GetPlayerEntities": 1, | "GetPlayerEntities": 1, | ||||
"GetNonGaiaEntities": 1, | "GetNonGaiaEntities": 1, | ||||
"DisplayRallyPoint": 1, | "DisplayRallyPoint": 1, | ||||
Show All 36 Lines |
Wildfire Games · Phabricator
some