Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/unit_actions.js
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
* "specificness" is used to determine how specific an action is, | * "specificness" is used to determine how specific an action is, | ||||
* The lower the number, the more specific an action is, and the bigger | * The lower the number, the more specific an action is, and the bigger | ||||
* the chance of selecting that action when multiple actions are possible | * the chance of selecting that action when multiple actions are possible | ||||
*/ | */ | ||||
var g_UnitActions = | var g_UnitActions = | ||||
{ | { | ||||
"move": | "move": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "walk", | "type": "walk", | ||||
"entities": selection, | "entities": selection, | ||||
"x": target.x, | "x": position.x, | ||||
"z": target.z, | "z": position.z, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getDefault() | "formation": g_AutoFormation.getDefault() | ||||
}); | }); | ||||
DrawTargetMarker(target); | DrawTargetMarker(position); | ||||
Engine.GuiInterfaceCall("PlaySound", { | Engine.GuiInterfaceCall("PlaySound", { | ||||
"name": "order_walk", | "name": "order_walk", | ||||
"entity": action.firstAbleEntity | "entity": action.firstAbleEntity | ||||
}); | }); | ||||
return true; | return true; | ||||
}, | }, | ||||
Show All 16 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 12, | "specificness": 12, | ||||
}, | }, | ||||
"attack-move": | "attack-move": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
let targetClasses; | let targetClasses; | ||||
if (Engine.HotkeyIsPressed("session.attackmoveUnit")) | if (Engine.HotkeyIsPressed("session.attackmoveUnit")) | ||||
targetClasses = { "attack": ["Unit"] }; | targetClasses = { "attack": ["Unit"] }; | ||||
else | else | ||||
targetClasses = { "attack": ["Unit", "Structure"] }; | targetClasses = { "attack": ["Unit", "Structure"] }; | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "attack-walk", | "type": "attack-walk", | ||||
"entities": selection, | "entities": selection, | ||||
"x": target.x, | "x": position.x, | ||||
"z": target.z, | "z": position.z, | ||||
"targetClasses": targetClasses, | "targetClasses": targetClasses, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
}); | }); | ||||
DrawTargetMarker(target); | DrawTargetMarker(target); | ||||
Show All 24 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 30, | "specificness": 30, | ||||
}, | }, | ||||
"capture": | "capture": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "attack", | "type": "attack", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"allowCapture": true, | "allowCapture": true, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
Show All 30 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 9, | "specificness": 9, | ||||
}, | }, | ||||
"attack": | "attack": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "attack", | "type": "attack", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"allowCapture": false, | "allowCapture": false, | ||||
Show All 34 Lines | "actionCheck": function(target, selection) | ||||
"target": target, | "target": target, | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 10, | "specificness": 10, | ||||
}, | }, | ||||
"call-to-arms": { | "call-to-arms": { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
let targetClasses; | let targetClasses; | ||||
if (Engine.HotkeyIsPressed("session.attackmoveUnit")) | if (Engine.HotkeyIsPressed("session.attackmoveUnit")) | ||||
targetClasses = { "attack": ["Unit"] }; | targetClasses = { "attack": ["Unit"] }; | ||||
else | else | ||||
targetClasses = { "attack": ["Unit", "Structure"] }; | targetClasses = { "attack": ["Unit", "Structure"] }; | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "call-to-arms", | "type": "call-to-arms", | ||||
"entities": selection, | "entities": selection, | ||||
"target": target, | "position": position, | ||||
"targetClasses": targetClasses, | "targetClasses": targetClasses, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"allowCapture": true, | "allowCapture": true, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
}); | }); | ||||
return true; | return true; | ||||
}, | }, | ||||
Show All 21 Lines | "preSelectedActionCheck": function(target, selection) | ||||
return preSelectedAction == ACTION_CALLTOARMS && | return preSelectedAction == ACTION_CALLTOARMS && | ||||
this.actionCheck(target, selection); | this.actionCheck(target, selection); | ||||
}, | }, | ||||
"specificness": 50, | "specificness": 50, | ||||
}, | }, | ||||
"patrol": | "patrol": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "patrol", | "type": "patrol", | ||||
"entities": selection, | "entities": selection, | ||||
"x": target.x, | "x": position.x, | ||||
"z": target.z, | "z": position.z, | ||||
"target": action.target, | "target": action.target, | ||||
"targetClasses": { "attack": g_PatrolTargets }, | "targetClasses": { "attack": g_PatrolTargets }, | ||||
"queued": queued, | "queued": queued, | ||||
"allowCapture": false, | "allowCapture": false, | ||||
"formation": g_AutoFormation.getDefault() | "formation": g_AutoFormation.getDefault() | ||||
}); | }); | ||||
DrawTargetMarker(target); | DrawTargetMarker(position); | ||||
Engine.GuiInterfaceCall("PlaySound", { | Engine.GuiInterfaceCall("PlaySound", { | ||||
"name": "order_patrol", | "name": "order_patrol", | ||||
"entity": action.firstAbleEntity | "entity": action.firstAbleEntity | ||||
}); | }); | ||||
return true; | return true; | ||||
}, | }, | ||||
"getActionInfo": function(entState, targetState) | "getActionInfo": function(entState, targetState) | ||||
Show All 23 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 37, | "specificness": 37, | ||||
}, | }, | ||||
"heal": | "heal": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "heal", | "type": "heal", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | "preSelectedActionCheck": function(target, selection) | ||||
return { "type": "construct" }; | return { "type": "construct" }; | ||||
return false; | return false; | ||||
}, | }, | ||||
"specificness": 0, | "specificness": 0, | ||||
}, | }, | ||||
"repair": | "repair": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "repair", | "type": "repair", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"autocontinue": true, | "autocontinue": true, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 11, | "specificness": 11, | ||||
}, | }, | ||||
"gather": | "gather": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "gather", | "type": "gather", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
Show All 35 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 1, | "specificness": 1, | ||||
}, | }, | ||||
"returnresource": | "returnresource": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "returnresource", | "type": "returnresource", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 2, | "specificness": 2, | ||||
}, | }, | ||||
"cancel-setup-trade-route": | "cancel-setup-trade-route": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "cancel-setup-trade-route", | "type": "cancel-setup-trade-route", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued | "queued": queued | ||||
}); | }); | ||||
Show All 33 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 2, | "specificness": 2, | ||||
}, | }, | ||||
"setup-trade-route": | "setup-trade-route": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued) | "execute": function(position, action, selection, queued) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "setup-trade-route", | "type": "setup-trade-route", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"source": null, | "source": null, | ||||
"route": null, | "route": null, | ||||
"queued": queued, | "queued": queued, | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 0, | "specificness": 0, | ||||
}, | }, | ||||
"occupy-turret": | "occupy-turret": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "occupy-turret", | "type": "occupy-turret", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 21, | "specificness": 21, | ||||
}, | }, | ||||
"garrison": | "garrison": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "garrison", | "type": "garrison", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 20, | "specificness": 20, | ||||
}, | }, | ||||
"guard": | "guard": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "guard", | "type": "guard", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront, | "pushFront": pushFront, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
Show All 38 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 40, | "specificness": 40, | ||||
}, | }, | ||||
"collect-treasure": | "collect-treasure": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued) | "execute": function(position, action, selection, queued) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "collect-treasure", | "type": "collect-treasure", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"formation": g_AutoFormation.getNull() | "formation": g_AutoFormation.getNull() | ||||
}); | }); | ||||
Show All 26 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 1, | "specificness": 1, | ||||
}, | }, | ||||
"remove-guard": | "remove-guard": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "remove-guard", | "type": "remove-guard", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued, | "queued": queued, | ||||
"pushFront": pushFront | "pushFront": pushFront | ||||
}); | }); | ||||
Show All 25 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 41, | "specificness": 41, | ||||
}, | }, | ||||
"set-rallypoint": | "set-rallypoint": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
// if there is a position set in the action then use this so that when setting a | // if there is a position set in the action then use this so that when setting a | ||||
// rally point on an entity it is centered on that entity | // rally point on an entity it is centered on that entity | ||||
if (action.position) | if (action.position) | ||||
target = action.position; | position = action.position; | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "set-rallypoint", | "type": "set-rallypoint", | ||||
"entities": selection, | "entities": selection, | ||||
"x": target.x, | "x": position.x, | ||||
"z": target.z, | "z": position.z, | ||||
"data": action.data, | "data": action.data, | ||||
"queued": queued | "queued": queued | ||||
}); | }); | ||||
// Display rally point at the new coordinates, to avoid display lag | // Display rally point at the new coordinates, to avoid display lag | ||||
Engine.GuiInterfaceCall("DisplayRallyPoint", { | Engine.GuiInterfaceCall("DisplayRallyPoint", { | ||||
"entities": selection, | "entities": selection, | ||||
"x": target.x, | "x": position.x, | ||||
"z": target.z, | "z": position.z, | ||||
"queued": queued | "queued": queued | ||||
}); | }); | ||||
return true; | return true; | ||||
}, | }, | ||||
"getActionInfo": function(entState, targetState) | "getActionInfo": function(entState, targetState) | ||||
{ | { | ||||
if (!entState.rallyPoint) | if (!entState.rallyPoint) | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | "actionCheck": function(target, selection) | ||||
"firstAbleEntity": actionInfo.entity | "firstAbleEntity": actionInfo.entity | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 6, | "specificness": 6, | ||||
}, | }, | ||||
"unset-rallypoint": | "unset-rallypoint": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued, pushFront) | "execute": function(position, action, selection, queued, pushFront) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "unset-rallypoint", | "type": "unset-rallypoint", | ||||
"entities": selection | "entities": selection | ||||
}); | }); | ||||
// Remove displayed rally point | // Remove displayed rally point | ||||
Engine.GuiInterfaceCall("DisplayRallyPoint", { | Engine.GuiInterfaceCall("DisplayRallyPoint", { | ||||
Show All 22 Lines | "unset-rallypoint": | ||||
}, | }, | ||||
"specificness": 11, | "specificness": 11, | ||||
}, | }, | ||||
// This is a "fake" action to show a failure cursor | // This is a "fake" action to show a failure cursor | ||||
// when only uncontrollable entities are selected. | // when only uncontrollable entities are selected. | ||||
"uncontrollable": | "uncontrollable": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued) | "execute": function(position, action, selection, queued) | ||||
{ | { | ||||
return true; | return true; | ||||
}, | }, | ||||
"actionCheck": function(target, selection) | "actionCheck": function(target, selection) | ||||
{ | { | ||||
// Only show this action if all entities are marked uncontrollable. | // Only show this action if all entities are marked uncontrollable. | ||||
let playerState = g_SimState.players[g_ViewedPlayer]; | let playerState = g_SimState.players[g_ViewedPlayer]; | ||||
if (playerState && playerState.controlsAll || selection.some(ent => { | if (playerState && playerState.controlsAll || selection.some(ent => { | ||||
let entState = GetEntityState(ent); | let entState = GetEntityState(ent); | ||||
return entState && entState.identity && entState.identity.controllable; | return entState && entState.identity && entState.identity.controllable; | ||||
})) | })) | ||||
return false; | return false; | ||||
return { | return { | ||||
"type": "none", | "type": "none", | ||||
"cursor": "cursor-no", | "cursor": "cursor-no", | ||||
"tooltip": translatePlural("This entity cannot be controlled.", "These entities cannot be controlled.", selection.length) | "tooltip": translatePlural("This entity cannot be controlled.", "These entities cannot be controlled.", selection.length) | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 100, | "specificness": 100, | ||||
}, | }, | ||||
"none": | "none": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued) | "execute": function(position, action, selection, queued) | ||||
{ | { | ||||
return true; | return true; | ||||
}, | }, | ||||
"specificness": 100, | "specificness": 100, | ||||
}, | }, | ||||
}; | }; | ||||
var g_UnitActionsSortedKeys = Object.keys(g_UnitActions).sort((a, b) => g_UnitActions[a].specificness - g_UnitActions[b].specificness); | var g_UnitActionsSortedKeys = Object.keys(g_UnitActions).sort((a, b) => g_UnitActions[a].specificness - g_UnitActions[b].specificness); | ||||
▲ Show 20 Lines • Show All 573 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
Engine.GuiInterfaceCall("AddTargetMarker", { | Engine.GuiInterfaceCall("AddTargetMarker", { | ||||
"template": g_TargetMarker.move, | "template": g_TargetMarker.move, | ||||
"x": target.x, | "x": target.x, | ||||
"z": target.z | "z": target.z | ||||
}); | }); | ||||
} | } | ||||
function displayFlare(target, playerID) | function displayFlare(position, playerID) | ||||
{ | { | ||||
Engine.GuiInterfaceCall("AddTargetMarker", { | Engine.GuiInterfaceCall("AddTargetMarker", { | ||||
"template": g_TargetMarker.map_flare, | "template": g_TargetMarker.map_flare, | ||||
"x": target.x, | "x": position.x, | ||||
"z": target.z, | "z": position.z, | ||||
"owner": playerID | "owner": playerID | ||||
}); | }); | ||||
g_MiniMapPanel.flare(target, playerID); | g_MiniMapPanel.flare(position, playerID); | ||||
} | } | ||||
function getCommandInfo(command, entStates) | function getCommandInfo(command, entStates) | ||||
{ | { | ||||
return entStates && g_EntityCommands[command] && | return entStates && g_EntityCommands[command] && | ||||
allowedPlayersCheck(entStates, g_EntityCommands[command].allowedPlayers) && | allowedPlayersCheck(entStates, g_EntityCommands[command].allowedPlayers) && | ||||
g_EntityCommands[command].getInfo(entStates); | g_EntityCommands[command].getInfo(entStates); | ||||
} | } | ||||
Show All 36 Lines |
Wildfire Games · Phabricator