Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PlayerControllerCommandingComponent.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Commanding", description: "This component should be attached to player controller and is used by commanding to send requests to server.")]
2 class SCR_PlayerControllerCommandingComponentClass : ScriptComponentClass
3 {
4 }
5 
6 class SCR_PlayerControllerCommandingComponent : ScriptComponent
7 {
8  [Attribute("{ECC45EC468D76CF4}Configs/Commanding/CommandingMenu.conf")]
9  protected ResourceName m_sCommandingMenuConfigPath;
10 
11  [Attribute("{2FFBD92174DDF3E0}Configs/Commanding/CommandingMapMenu.conf")]
12  protected ResourceName m_sCommandingMapMenuConfigPath;
13 
14  [Attribute()]
16 
18 
20 
21  protected IEntity m_SelectedEntity;
22 
25 
26  protected string m_sExecutedCommandName;
27 
28  protected bool m_bIsCommandExecuting = false;
29  protected bool m_bSlaveGroupRequested = false;
31 
33  protected static const float ABOVE_TERRAIN_OFFSET = 0.5;
34 
36  protected static const float COMMANDING_VISUAL_RANGE = 10000;
37 
38  //------------------------------------------------------------------------------------------------
41  static SCR_PlayerControllerCommandingComponent GetPlayerControllerCommandingComponent(int playerID)
42  {
43  PlayerController playerController = GetGame().GetPlayerManager().GetPlayerController(playerID);
44  if (!playerController)
45  return null;
46 
47  return SCR_PlayerControllerCommandingComponent.Cast(playerController.FindComponent(SCR_PlayerControllerCommandingComponent));
48  }
49 
50  //------------------------------------------------------------------------------------------------
52  static SCR_PlayerControllerCommandingComponent GetLocalPlayerControllerCommandingComponent()
53  {
55  if (!playerController)
56  return null;
57 
58  return SCR_PlayerControllerCommandingComponent.Cast(playerController.FindComponent(SCR_PlayerControllerCommandingComponent));
59  }
60 
61  //------------------------------------------------------------------------------------------------
62  override protected void OnPostInit(IEntity owner)
63  {
64  super.OnPostInit(owner);
65  SetEventMask(owner, EntityEvent.INIT);
66 
67  SCR_GroupsManagerComponent groupManager = SCR_GroupsManagerComponent.GetInstance();
69 
70  Resource holder = BaseContainerTools.LoadContainer(m_sCommandingMenuConfigPath);
71  BaseContainer container = holder.GetResource().ToBaseContainer();
72  m_CommandingMenuConfig = SCR_PlayerCommandingMenuConfig.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
73 
75  return;
76 
77  m_RadialMenuController.GetOnTakeControl().Insert(OnControllerTakeControl);
78 
79  SCR_MapEntity.GetOnMapOpen().Insert(OnMapOpen);
80  SCR_MapEntity.GetOnMapClose().Insert(OnMapClose);
81 
82  m_PhysicsHelper.InitPhysicsHelper();
83  }
84 
85  //------------------------------------------------------------------------------------------------
87  {
89  return;
90 
91  // Send/update entries in radial menu when control is gained
92  controller.UpdateMenuData();
94  }
95 
96  //------------------------------------------------------------------------------------------------
99  {
100  SCR_MapRadialUI mapMenu = SCR_MapRadialUI.GetInstance();
101  if (!mapMenu)
102  return;
103 
104  mapMenu.GetOnEntryPerformedInvoker().Insert(OnMapCommandPerformed);
105  }
106 
107  //------------------------------------------------------------------------------------------------
110  {
111  SCR_MapRadialUI mapMenu = SCR_MapRadialUI.GetInstance();
112  if (!mapMenu)
113  return;
114 
115  mapMenu.GetOnEntryPerformedInvoker().Remove(OnMapCommandPerformed);
116  }
117 
118  //------------------------------------------------------------------------------------------------
121  void SetupPlayerRadialMenu(IEntity owner)
122  {
123 
124  BaseGameMode gameMode = GetGame().GetGameMode();
125  if (!gameMode)
126  return;
127 
128  m_RadialMenu = SCR_RadialMenu.GlobalRadialMenu();
129  if (!m_RadialMenu)
130  return;
131 
132  m_RadialMenu.GetOnBeforeOpen().Insert(OnPlayerRadialMenuOpen);
133  m_RadialMenu.GetOnPerform().Insert(OnRadialMenuPerformed);
134  }
135 
136  //------------------------------------------------------------------------------------------------
138  void OnMapOpen(MapConfiguration config)
139  {
140  m_MapContextualMenu = SCR_MapRadialUI.GetInstance();
141  if (!m_MapContextualMenu)
142  return;
143 
144  m_MapContextualMenu.GetOnMenuInitInvoker().Insert(SetupMapRadialMenu);
145  m_MapContextualMenu.GetOnEntryPerformedInvoker().Insert(OnMapCommandPerformed);
146  }
147 
148  //------------------------------------------------------------------------------------------------
150  void OnMapClose(MapConfiguration config)
151  {
152  if (!m_MapContextualMenu)
153  return;
154 
155  m_MapContextualMenu.GetOnMenuInitInvoker().Remove(SetupMapRadialMenu);
156  m_MapContextualMenu.GetOnEntryPerformedInvoker().Remove(OnMapCommandPerformed);
157  }
158 
159  //------------------------------------------------------------------------------------------------
162  {
164  return;
165 
166  SCR_PlayerCommandingMenuCategoryElement rootCategory = m_CommandingMenuConfig.GetRootCategory();
167  if (!rootCategory)
168  return;
169 
170  AddElementsFromCategoryToMap(rootCategory);
171  }
172 
173  //------------------------------------------------------------------------------------------------
176  void OnMapCommandPerformed(SCR_SelectionMenuEntry element, float[] worldPos)
177  {
179  if (!mapEntry)
180  return;
181 
182  float height = GetGame().GetWorld().GetSurfaceY(worldPos[0], worldPos[1]);
183 
184  vector position;
185  position[0] = worldPos[0];
186  position[1] = height + ABOVE_TERRAIN_OFFSET;
187  position[2] = worldPos[1];
188 
189  PrepareExecuteCommand(mapEntry.GetEntryIdentifier(), position);
190 
191  }
192 
193  //------------------------------------------------------------------------------------------------
196  void OnGroupLeaderChanged(int groupID, int playerID)
197  {
198  SCR_PlayerControllerGroupComponent playerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
199  if (!playerGroupController)
200  return;
201 
202  //we do not care if it's outside of our group
203  if (playerGroupController.GetGroupID() != groupID)
204  return;
205 
206  bool enabled = playerID == GetGame().GetPlayerController().GetPlayerId();
207  }
208 
209  //------------------------------------------------------------------------------------------------
211  void OnGroupChanged(int groupID)
212  {
213  //check if player is the new leader of the group
214  SCR_PlayerControllerGroupComponent playerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
215  if (!playerGroupController)
216  return;
217 
218  SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
219  if (!groupsManager)
220  return;
221 
222  SCR_AIGroup playersGroup = groupsManager.FindGroup(groupID);
223  if (!playersGroup)
224  return;
225 
226  bool enabled = playerGroupController.IsPlayerLeader(GetGame().GetPlayerController().GetPlayerId(), playersGroup);
227  }
228 
229  //------------------------------------------------------------------------------------------------
233  {
234  SCR_SelectionMenuEntry element = SCR_SelectionMenuEntry.Cast(entry);
235  if (!element)
236  return;
237 
238  PrepareExecuteCommand(element.GetId());
239  }
240 
241  //------------------------------------------------------------------------------------------------
243  {
244  SCR_NotificationsComponent.SendLocal(ENotification.COMMANDING_NO_RIGHTS);
245  }
246 
247  //------------------------------------------------------------------------------------------------
250  void PrepareExecuteCommand(string commandName, vector targetPosition = "0 0 0")
251  {
252  //if another command is waiting for trace, do nothing
253  if (m_bIsCommandExecuting || commandName.IsEmpty())
254  return;
255 
256  m_sExecutedCommandName = commandName;
257 
258  if (targetPosition != vector.Zero)
259  {
260  ExecuteCommand(targetPosition, null);
261  return;
262  }
263 
264  PlayerController controller = GetGame().GetPlayerController();
265  PlayerCamera camera = PlayerCamera.Cast(GetGame().GetCameraManager().CurrentCamera());
266  if (!camera)
267  return;
268 
269  IEntity controlledEntity = controller.GetControlledEntity();
270 
271  vector mat[4];
272  camera.GetTransform(mat);
273  vector end = mat[3] + mat[2] * COMMANDING_VISUAL_RANGE;
274 
276  m_PhysicsHelper.GetOnTraceFinished().Insert(ExecuteCommand);
277 
278  //prevent other commands being executed while this one is waiting for trace
279  //todo:kuceramar: after radialmenurework, make radial menu elements disabled when this is true
280  m_bIsCommandExecuting = true;
281  m_PhysicsHelper.TraceSegmented(mat[3], end, TraceFlags.ENTS | TraceFlags.WORLD | TraceFlags.ANY_CONTACT, EPhysicsLayerDefs.Projectile, controlledEntity);
282  }
283 
284  //------------------------------------------------------------------------------------------------
288  void ExecuteCommand(vector targetPosition, IEntity tracedEntity)
289  {
290  m_bIsCommandExecuting = false;
291  if (m_PhysicsHelper)
292  {
293  m_PhysicsHelper.GetOnTraceFinished().Remove(ExecuteCommand);
294  m_PhysicsHelper = null;
295  }
296 
297  SCR_CommandingManagerComponent commandingManager = SCR_CommandingManagerComponent.GetInstance();
298  if (!commandingManager)
299  return;
300 
301  int playerID = SCR_PlayerController.GetLocalPlayerId();
302 
303  SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
304  SCR_GroupsManagerComponent groupManager = SCR_GroupsManagerComponent.GetInstance();
305  if (!groupController || !groupManager)
306  return;
307 
308  SCR_AIGroup playersGroup = groupManager.FindGroup(groupController.GetGroupID());
309  if (!playersGroup)
310  return;
311 
312  RplComponent rplComp;
313  if (!m_bSlaveGroupRequested && !playersGroup.GetSlave())
314  {
315  rplComp = RplComponent.Cast(playersGroup.FindComponent(RplComponent));
316  groupController.RequestCreateSlaveGroup(rplComp.Id());
317  m_bSlaveGroupRequested = true;
318  }
319 
320  SCR_AIGroup slaveGroup = playersGroup.GetSlave();
321  //todo:mour Unlink this, only AI commands should be reliant on slave group, so commands should have that as option, not for all commands
322  if (!slaveGroup)
323  {
324  //if there is not slaveGroup, we try to execute the command later because newly created group takes a bit of time to replicate
325  GetGame().GetCallqueue().CallLater(ExecuteCommand, 100, false, targetPosition, tracedEntity);
326  return;
327  }
328 
329  m_bSlaveGroupRequested = false;
330  rplComp = RplComponent.Cast(slaveGroup.FindComponent(RplComponent));
331  RplId groupRplID = rplComp.Id();
332  RplId cursorTargetRplID;
333 
334  int commandIndex = commandingManager.FindCommandIndex(m_sExecutedCommandName);
335 
336  if (m_SelectedEntity)
337  {
338  rplComp = RplComponent.Cast(m_SelectedEntity.FindComponent(RplComponent));
339  if (rplComp)
340  cursorTargetRplID = rplComp.Id();
341  }
342 
343  Rpc(RPC_RequestExecuteCommand, commandIndex, cursorTargetRplID, groupRplID, targetPosition, playerID);
344  }
345 
346  //------------------------------------------------------------------------------------------------
353  [RplRpc(RplChannel.Reliable, RplRcver.Server)]
354  void RPC_RequestExecuteCommand(int commandIndex, RplId cursorTargetID, RplId groupRplID, vector targetPoisition, int playerID)
355  {
356  SCR_CommandingManagerComponent commandingManager = SCR_CommandingManagerComponent.GetInstance();
357  if (!commandingManager)
358  return;
359 
360  commandingManager.RequestCommandExecution(commandIndex, cursorTargetID, groupRplID, targetPoisition ,playerID);
361  }
362 
363  //------------------------------------------------------------------------------------------------
366  void CommandExecutedCallback(int commandIndex)
367  {
368  Rpc(RPC_CommandExecutedCallback, commandIndex);
369  }
370 
371  //------------------------------------------------------------------------------------------------
374  [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
375  void RPC_CommandExecutedCallback(int commandIndex)
376  {
377  PlayCommandGesture(commandIndex);
378  }
379 
380  //------------------------------------------------------------------------------------------------
383  void PlayCommandGesture(int commandIndex)
384  {
385  if (commandIndex <= 0)
386  return;
387 
388  SCR_MapEntity mapEntity = SCR_MapEntity.GetMapInstance();
389 
390  //skip the commanding gesture if player has map open
391  if (mapEntity && mapEntity.IsOpen())
392  return;
393 
394  SCR_BaseGroupCommand command = SCR_BaseGroupCommand.Cast(m_CommandingManager.FindCommand(m_CommandingManager.FindCommandNameFromIndex(commandIndex)));
395  if (!command)
396  return;
397 
398  int gestureID = command.GetCommandGestureID();
399 
400  IEntity playerControlledEntity = GetGame().GetPlayerController().GetControlledEntity();
401 
402  if (!playerControlledEntity)
403  return;
404 
405  SCR_CharacterControllerComponent characterComponent = SCR_CharacterControllerComponent.Cast(playerControlledEntity.FindComponent(SCR_CharacterControllerComponent));
406  if (!characterComponent)
407  return;
408 
409  characterComponent.TryStartCharacterGesture(gestureID, 3000);
410  }
411 
412  //------------------------------------------------------------------------------------------------
416  void UpdateRadialMenu(IEntity owner, bool isOpen)
417  {
418  if (!m_RadialMenu || !m_CommandingMenuConfig || !isOpen)
419  return;
420 
421  PlayerCamera camera = PlayerCamera.Cast(GetGame().GetCameraManager().CurrentCamera());
422  if (!camera)
423  return;
424 
425  m_SelectedEntity = camera.GetCursorTarget();
426 
427  SCR_PlayerCommandingMenuCategoryElement rootCategory = m_CommandingMenuConfig.GetRootCategory();
428  if (!rootCategory)
429  return;
430 
431  AddElementsFromCategory(rootCategory);
432  }
433 
434  //------------------------------------------------------------------------------------------------
439  {
440  array<ref SCR_PlayerCommandingMenuBaseElement> elements = category.GetCategoryElements();
441 
443  SCR_SelectionMenuCategoryEntry createdCategory;
444 
445  foreach (SCR_PlayerCommandingMenuBaseElement element : elements)
446  {
447  elementCategory = SCR_PlayerCommandingMenuCategoryElement.Cast(element);
448  if (elementCategory)
449  {
450  createdCategory = SCR_SelectionMenuCategoryEntry.Cast(AddRadialMenuElement(elementCategory, rootCategory));
451  if (!createdCategory)
452  continue;
453 
454  AddElementsFromCategory(elementCategory, createdCategory);
455  }
456  else
457  {
458  AddRadialMenuElement(element, rootCategory);
459  }
460  }
461  }
462 
463  //------------------------------------------------------------------------------------------------
467  {
468  array<ref SCR_PlayerCommandingMenuBaseElement> elements = category.GetCategoryElements();
469  SCR_SelectionMenuCategoryEntry mapEntryCategory = m_MapContextualMenu.AddRadialCategory(category.GetCategoryDisplayText()); // add map category entry
470 
472  foreach (SCR_PlayerCommandingMenuBaseElement element : elements)
473  {
474  elementCategory = SCR_PlayerCommandingMenuCategoryElement.Cast(element);
475  if (elementCategory)
476  {
477  if (elementCategory.GetCanShowOnMap())
478  AddElementsFromCategoryToMap(elementCategory, mapEntryCategory);
479  }
480  else
481  {
482  InsertElementToMapRadial(element, category, mapEntryCategory);
483  }
484  }
485  }
486 
487  //------------------------------------------------------------------------------------------------
493  {
494  SCR_CommandingManagerComponent commandingManager = SCR_CommandingManagerComponent.GetInstance();
495  if (!commandingManager)
496  return;
497 
499  if (!commandingManager.CanShowOnMap(commandElement.GetCommandName()))
500  return;
501 
502  SCR_BaseRadialCommand command = commandingManager.FindCommand(commandElement.GetCommandName());
503 
504  SCR_MapMenuCommandingEntry mapEntry = new SCR_MapMenuCommandingEntry(commandElement.GetCommandName());
505  mapEntry.SetName(commandElement.GetCommandDisplayText());
506  if (command)
507  mapEntry.SetIcon(command.GetIconImageset(), command.GetIconName());
508 
509  m_MapContextualMenu.InsertCustomRadialEntry(mapEntry, mapCategory);
510 
511  }
512 
513  //------------------------------------------------------------------------------------------------
519  {
520  SCR_PlayerCommandingMenuCommand commandElement = SCR_PlayerCommandingMenuCommand.Cast(newElement);
521  if (commandElement)
522  return AddCommandElement(commandElement, parentCategory);
523 
525  if (categoryElement)
526  return AddCategoryElement(categoryElement, parentCategory);
527 
528  return null;
529  }
530 
531  //------------------------------------------------------------------------------------------------
537  {
539 
540  newCategory.SetName(category.GetCategoryDisplayText());
541 
542  if (!parentCategory)
543  {
544  m_RadialMenu.AddCategoryEntry(newCategory);
545  return newCategory;
546  }
547 
548  parentCategory.AddEntry(newCategory);
549 
550  return newCategory;
551  }
552 
553  //------------------------------------------------------------------------------------------------
559  {
560  SCR_CommandingManagerComponent commandingManager = SCR_CommandingManagerComponent.GetInstance();
561  if (!commandingManager)
562  return null;
563 
564  if (!commandingManager.CanShowCommand(command.GetCommandName()))
565  return null;
566 
567  SCR_BaseRadialCommand groupCommand = commandingManager.FindCommand(command.GetCommandName());
568 
570 
571  string displayName = command.GetCommandCustomName();
572  if (displayName.IsEmpty())
573  displayName = command.GetCommandDisplayText();
574 
575  entry.SetName(displayName);
576  entry.SetId(command.GetCommandName());
577  entry.SetIcon(groupCommand.GetIconImageset(), groupCommand.GetIconName());
578  entry.Enable(groupCommand.CanBePerformed());
579 
580  if (parentCategory)
581  parentCategory.AddEntry(entry);
582  else
583  m_RadialMenu.AddEntry(entry);
584 
585  return entry;
586  }
587 
588  //------------------------------------------------------------------------------------------------
591  {
593  return;
594 
595  m_RadialMenu.ClearEntries();
596 
597  PlayerCamera camera = PlayerCamera.Cast(GetGame().GetCameraManager().CurrentCamera());
598  if (!camera)
599  return;
600 
601  m_SelectedEntity = camera.GetCursorTarget();
602 
603  SCR_PlayerCommandingMenuCategoryElement rootCategory = m_CommandingMenuConfig.GetRootCategory();
604  if (!rootCategory)
605  return;
606 
607  AddElementsFromCategory(rootCategory);
608  }
609 }
AddElementsFromCategory
void AddElementsFromCategory(SCR_PlayerCommandingMenuCategoryElement category, SCR_SelectionMenuCategoryEntry rootCategory=null)
Definition: SCR_PlayerControllerCommandingComponent.c:438
SCR_PlayerController
Definition: SCR_PlayerController.c:31
SCR_RadialMenuController
Definition: SCR_RadialMenuController.c:8
OnRadialMenuPerformed
void OnRadialMenuPerformed(SCR_SelectionMenu menu, SCR_SelectionMenuEntry entry)
Definition: SCR_PlayerControllerCommandingComponent.c:232
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
SCR_SelectionMenuCategoryEntry
Definition: SCR_SelectionMenuCategory.c:6
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
ExecuteCommand
void ExecuteCommand(vector targetPosition, IEntity tracedEntity)
Definition: SCR_PlayerControllerCommandingComponent.c:288
UpdateRadialMenu
void UpdateRadialMenu(IEntity owner, bool isOpen)
Definition: SCR_PlayerControllerCommandingComponent.c:416
SetupPlayerRadialMenu
void SetupPlayerRadialMenu(IEntity owner)
Definition: SCR_PlayerControllerCommandingComponent.c:121
RPC_CommandExecutedCallback
void RPC_CommandExecutedCallback(int commandIndex)
Definition: SCR_PlayerControllerCommandingComponent.c:375
SCR_MapRadialUI
2D map radial menu UI
Definition: SCR_MapRadialUI.c:13
m_RadialMenuController
protected ref SCR_RadialMenuController m_RadialMenuController
Definition: SCR_PlayerControllerCommandingComponent.c:15
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
OnMapClose
void OnMapClose(MapConfiguration config)
Definition: SCR_PlayerControllerCommandingComponent.c:150
PlayCommandGesture
void PlayCommandGesture(int commandIndex)
Definition: SCR_PlayerControllerCommandingComponent.c:383
SCR_PlayerControllerCommandingComponentClass
Definition: SCR_PlayerControllerCommandingComponent.c:2
RplRpc
SCR_AchievementsHandlerClass ScriptComponentClass RplRpc(RplChannel.Reliable, RplRcver.Owner)] void UnlockOnClient(AchievementId achievement)
Definition: SCR_AchievementsHandler.c:11
RemoveMapListener
void RemoveMapListener()
Definition: SCR_PlayerControllerCommandingComponent.c:109
m_CommandingMenuConfig
protected ref SCR_PlayerCommandingMenuConfig m_CommandingMenuConfig
Definition: SCR_PlayerControllerCommandingComponent.c:19
SCR_CharacterControllerComponent
Definition: SCR_CharacterControllerComponent.c:35
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
OnRadialMenuFailed
void OnRadialMenuFailed()
Definition: SCR_PlayerControllerCommandingComponent.c:242
SCR_PlayerCommandingMenuCommand
Commanding menu commanding element class.
Definition: SCR_PlayerCommandsConfig.c:32
SCR_SelectionMenu
Definition: SCR_SelectionMenu.c:6
m_CommandingManager
protected SCR_CommandingManagerComponent m_CommandingManager
Definition: SCR_PlayerControllerCommandingComponent.c:23
ENotification
ENotification
Definition: ENotification.c:4
AddElementsFromCategoryToMap
void AddElementsFromCategoryToMap(notnull SCR_PlayerCommandingMenuCategoryElement category, SCR_SelectionMenuCategoryEntry rootCategory=null)
Definition: SCR_PlayerControllerCommandingComponent.c:466
m_PhysicsHelper
protected ref SCR_PhysicsHelper m_PhysicsHelper
Definition: SCR_PlayerControllerCommandingComponent.c:30
CommandExecutedCallback
void CommandExecutedCallback(int commandIndex)
Definition: SCR_PlayerControllerCommandingComponent.c:366
SCR_BaseRadialCommand
Definition: SCR_BaseRadialCommand.c:2
OnPlayerRadialMenuOpen
void OnPlayerRadialMenuOpen()
Definition: SCR_PlayerControllerCommandingComponent.c:590
Attribute
SCR_PlayerControllerCommandingComponentClass ScriptComponentClass Attribute("{ECC45EC468D76CF4}Configs/Commanding/CommandingMenu.conf")
Definition: SCR_PlayerControllerCommandingComponent.c:8
SetupMapRadialMenu
void SetupMapRadialMenu()
Definition: SCR_PlayerControllerCommandingComponent.c:161
m_sExecutedCommandName
protected string m_sExecutedCommandName
Definition: SCR_PlayerControllerCommandingComponent.c:26
OnPostInit
override protected void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_PlayerControllerCommandingComponent.c:62
m_bSlaveGroupRequested
protected bool m_bSlaveGroupRequested
Definition: SCR_PlayerControllerCommandingComponent.c:29
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
SetupMapListener
void SetupMapListener()
Definition: SCR_PlayerControllerCommandingComponent.c:98
SCR_PhysicsHelper
Definition: SCR_PhysicsHelper.c:6
m_sCommandingMapMenuConfigPath
Configs Commanding CommandingMapMenu conf protected ResourceName m_sCommandingMapMenuConfigPath
Definition: SCR_PlayerControllerCommandingComponent.c:12
m_RadialMenu
protected SCR_RadialMenu m_RadialMenu
Definition: SCR_PlayerControllerCommandingComponent.c:17
SCR_MapMenuCommandingEntry
Definition: SCR_MapMenuCommandingEntry.c:2
PrepareExecuteCommand
void PrepareExecuteCommand(string commandName, vector targetPosition="0 0 0")
Definition: SCR_PlayerControllerCommandingComponent.c:250
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_GroupsManagerComponent.c:1320
OnMapCommandPerformed
void OnMapCommandPerformed(SCR_SelectionMenuEntry element, float[] worldPos)
Definition: SCR_PlayerControllerCommandingComponent.c:176
CurrentCamera
CameraManagerClass GenericEntityClass CurrentCamera()
Returns the current camera.
SCR_PlayerCommandingMenuBaseElement
Commanding menu base element class.
Definition: SCR_PlayerCommandsConfig.c:76
SCR_BaseGroupCommand
Definition: SCR_BaseGroupCommand.c:3
SCR_AIGroup
Definition: SCR_AIGroup.c:68
OnGroupChanged
void OnGroupChanged(int groupID)
Definition: SCR_PlayerControllerCommandingComponent.c:211
m_SelectedEntity
protected IEntity m_SelectedEntity
Definition: SCR_PlayerControllerCommandingComponent.c:21
RPC_RequestExecuteCommand
void RPC_RequestExecuteCommand(int commandIndex, RplId cursorTargetID, RplId groupRplID, vector targetPoisition, int playerID)
Definition: SCR_PlayerControllerCommandingComponent.c:354
SCR_SelectionMenuEntry
Definition: SCR_SelectionMenuEntry.c:7
m_MapContextualMenu
protected SCR_MapRadialUI m_MapContextualMenu
Definition: SCR_PlayerControllerCommandingComponent.c:24
m_bIsCommandExecuting
protected bool m_bIsCommandExecuting
Definition: SCR_PlayerControllerCommandingComponent.c:28
AddCategoryElement
SCR_SelectionMenuEntry AddCategoryElement(SCR_PlayerCommandingMenuCategoryElement category, SCR_SelectionMenuCategoryEntry parentCategory=null)
Definition: SCR_PlayerControllerCommandingComponent.c:536
position
vector position
Definition: SCR_DestructibleTreeV2.c:30
SCR_CommandingManagerComponent
void SCR_CommandingManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CommandingManagerComponent.c:46
InsertElementToMapRadial
void InsertElementToMapRadial(SCR_PlayerCommandingMenuBaseElement element, notnull SCR_PlayerCommandingMenuCategoryElement category, SCR_SelectionMenuCategoryEntry mapCategory)
Definition: SCR_PlayerControllerCommandingComponent.c:492
OnControllerTakeControl
protected void OnControllerTakeControl(SCR_RadialMenuController controller)
Definition: SCR_PlayerControllerCommandingComponent.c:86
SCR_PlayerCommandingMenuConfig
Commanding menu config root.
Definition: SCR_PlayerCommandsConfig.c:18
AddRadialMenuElement
SCR_SelectionMenuEntry AddRadialMenuElement(SCR_PlayerCommandingMenuBaseElement newElement, SCR_SelectionMenuCategoryEntry parentCategory=null)
Definition: SCR_PlayerControllerCommandingComponent.c:518
SCR_RadialMenu
Definition: SCR_RadialMenu.c:8
OnMapOpen
void OnMapOpen(MapConfiguration config)
Definition: SCR_PlayerControllerCommandingComponent.c:138
SCR_PlayerCommandingMenuCategoryElement
Commanding menu base element class.
Definition: SCR_PlayerCommandsConfig.c:84
GetPlayerId
proto external int GetPlayerId()
Definition: SCR_SpawnRequestComponent.c:39
OnGroupLeaderChanged
void OnGroupLeaderChanged(int groupID, int playerID)
Definition: SCR_PlayerControllerCommandingComponent.c:196
AddCommandElement
SCR_SelectionMenuEntry AddCommandElement(SCR_PlayerCommandingMenuCommand command, SCR_SelectionMenuCategoryEntry parentCategory=null)
Definition: SCR_PlayerControllerCommandingComponent.c:558
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180