Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorActionRadialEntry.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
2 class SCR_EditorActionRadialEntry : ScriptedSelectionMenuEntry
3 {
4  private ref SCR_EditorActionData m_ActionData;
5  private SCR_BaseActionsEditorComponent m_EditorComponent;
6  private vector m_CursorWorldPosition;
7  private int m_Flags;
8 
10  override void OnPerform(IEntity user, BaseSelectionMenu sourceMenu)
11  {
12  super.OnPerform(user, sourceMenu);
13  m_EditorComponent.ActionPerform(m_ActionData.GetAction(), m_CursorWorldPosition, m_Flags);
14  }
15 
17  override bool CanBeShownScript(IEntity user, BaseSelectionMenu sourceMenu)
18  {
19  // Context Action Radial Menu only contains entries that are always shown
20  return true;
21  }
22 
24  override bool CanBePerformedScript(IEntity user, BaseSelectionMenu sourceMenu)
25  {
26  return m_ActionData.GetCanBePerformed();
27  }
28 
31  override bool GetEntryNameScript(out string outName)
32  {
33  outName = m_ActionData.GetAction().GetInfo().GetName();
34  return true;
35  }
36 
39  override bool GetEntryDescriptionScript(out string outDescription)
40  {
41  outDescription = m_ActionData.GetAction().GetInfo().GetDescription();
42  return true;
43  }
44 
47  override bool GetEntryIconPathScript(out string outIconPath)
48  {
49  outIconPath = m_ActionData.GetAction().GetInfo().GetIconPath();
50  return true;
51  }
52 
53  void SCR_EditorActionRadialEntry(SCR_EditorActionData actionData, SCR_BaseActionsEditorComponent component, vector cursorWorldPosition, EEditorContextActionFlags flags = 0)
54  {
55  m_ActionData = actionData;
56  m_EditorComponent = component;
57  m_CursorWorldPosition = cursorWorldPosition;
58  m_Flags = flags;
59  }
60 
62  {
63  m_ActionData = null;
64  }
65 };
SCR_EditorActionRadialEntry
Definition: SCR_EditorActionRadialEntry.c:2
SCR_EditorActionData
Definition: SCR_BaseEditorAction.c:280
EEditorContextActionFlags
EEditorContextActionFlags
Definition: EEditorContextActionFlags.c:1
BaseSelectionMenu
Definition: BaseSelectionMenu.c:12