Ticket #4253: patrol_prepare_v1.patch
File patrol_prepare_v1.patch, 2.8 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/input.js
function getActionInfo(action, target) 207 207 cursor = "action-attack-move"; 208 208 } 209 209 else if (Engine.HotkeyIsPressed("session.patrol")) 210 210 { 211 211 data.command = "patrol"; 212 data.targetClasses = { "attack": ["Unit"]};212 data.targetClasses = { "attack": g_PatrolTargets }; 213 213 cursor = "action-patrol"; 214 214 } 215 215 return { "possible": true, "data": data, "cursor": cursor }; 216 216 } 217 217 -
binaries/data/mods/public/gui/session/unit_actions.js
1 1 /** 2 * Which enemy entity types will be attacked on sight when patroling. 3 */ 4 var g_PatrolTargets = ["Unit", "Structure"]; 5 6 /** 2 7 * List of different actions units can execute, 3 8 * this is mostly used to determine which actions can be executed 4 9 * 5 10 * "execute" is meant to send the command to the engine 6 11 * … … var unitActions = 216 221 "type": "patrol", 217 222 "entities": selection, 218 223 "x": target.x, 219 224 "z": target.z, 220 225 "target": action.target, 221 "targetClasses": { "attack": ["Unit"] }, // patrol should only attack units226 "targetClasses": { "attack": g_PatrolTargets }, 222 227 "queued": queued, 223 228 "allowCapture": false 224 229 }); 225 230 Engine.GuiInterfaceCall("PlaySound", { "name": "order_patrol", "entity": selection[0] }); 226 231 return true; -
binaries/data/mods/public/simulation/components/UnitAI.js
UnitAI.prototype.UnitFsmSpec = { 1113 1113 return; 1114 1114 } 1115 1115 if (!this.patrolStartPosOrder) 1116 1116 { 1117 1117 this.patrolStartPosOrder = cmpPosition.GetPosition(); 1118 this.patrolStartPosOrder.targetClasses = { "attack": ["Unit"] };1118 this.patrolStartPosOrder.targetClasses = this.order.data.targetClasses; 1119 1119 } 1120 1120 1121 1121 this.StartTimer(0, 1000); 1122 1122 }, 1123 1123 … … UnitAI.prototype.UnitFsmSpec = { 1643 1643 return; 1644 1644 } 1645 1645 if (!this.patrolStartPosOrder) 1646 1646 { 1647 1647 this.patrolStartPosOrder = cmpPosition.GetPosition(); 1648 this.patrolStartPosOrder.targetClasses = { "attack": ["Unit"] };1648 this.patrolStartPosOrder.targetClasses = this.order.data.targetClasses; 1649 1649 } 1650 1650 1651 1651 this.StartTimer(0, 1000); 1652 1652 this.SelectAnimation("move"); 1653 1653 },