Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorActionSelectionMenuEntry.c
Go to the documentation of this file.
1 
10 {
11  protected ref SCR_BaseEditorAction m_Action;
12  protected SCR_BaseActionsEditorComponent m_ActionsEditorComponent;
13  protected vector m_vCursorWorldPos;
14  protected int m_iFlags;
15 
16  //------------------------------------------------------------------------------------------------
21  SCR_BaseEditorAction GetAction()
22  {
23  return m_Action;
24  }
25 
26  //------------------------------------------------------------------------------------------------
31  string GetActionShortcut()
32  {
33  if (!m_Action)
34  return string.Empty;
35 
36  return m_Action.GetShortcut();
37  }
38 
39  //------------------------------------------------------------------------------------------------
40  protected override void OnPerform()
41  {
42  if (!m_ActionsEditorComponent || !m_Action)
43  return;
44 
45  // Try to find current cursor world position
47  if (editorMenuLayout)
48  editorMenuLayout.GetCursorWorldPos(m_vCursorWorldPos);
49 
50  // Perform
51  m_ActionsEditorComponent.ActionPerform(m_Action, m_vCursorWorldPos, m_iFlags);
52  }
53 
54  //------------------------------------------------------------------------------------------------
55  void SCR_EditorActionSelectionMenuEntry(notnull SCR_BaseEditorAction action, notnull SCR_BaseActionsEditorComponent actionEditorComponent, vector cursorPosition, int actionFlags)
56  {
57  m_Action = action;
58  m_vCursorWorldPos = cursorPosition;
59  m_iFlags = actionFlags;
60  m_ActionsEditorComponent = actionEditorComponent;
61  }
62 };
SCR_BaseEditorAction
Definition: SCR_BaseEditorAction.c:24
SCR_EditorActionSelectionMenuEntry
Definition: SCR_EditorActionSelectionMenuEntry.c:9
SCR_MenuLayoutEditorComponent
Definition: SCR_MenuLayoutEditorComponent.c:15
SCR_SelectionMenuEntry
Definition: SCR_SelectionMenuEntry.c:7