Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LayerContextAction.c
Go to the documentation of this file.
3 {
4  [Attribute(desc: "Enable to enter the layer, disable to leave the layer")]
5  protected bool m_bToEnter;
6 
7  [Attribute(desc: "When enable, it will not move just one layer up, but all the way to root. And the same when moving down.")]
8  protected bool m_bToExtreme;
9 
10  [Attribute()]
11  protected bool m_bIsHidden;
12 
13  protected bool CanExit(SCR_LayersEditorComponent layersManager)
14  {
15  return layersManager.GetCurrentLayer() //--- Not in root
16  && (!m_bToExtreme || layersManager.GetCurrentLayer().GetParentEntity()); //--- When parent is already in the root, don't show the extreme version
17  }
18 
19  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
20  {
21  if (m_bIsHidden)
22  return false;
23 
25  if (!layersManager || !layersManager.IsEditingLayersEnabled())
26  return false;
27 
28  if (m_bToEnter && !hoveredEntity)
29  return false;
30 
31  if (m_bToEnter)
32  return hoveredEntity.CanEnterLayer(layersManager);
33  else
34  return !hoveredEntity && CanExit(layersManager); //--- Context menu action to return is shown only when not hovering over any entity
35  }
36  override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
37  {
39  if (!layersManager || !layersManager.IsEditingLayersEnabled())
40  return false;
41 
42  if (m_bToEnter && !hoveredEntity)
43  return false;
44 
45  if (m_bToEnter)
46  return hoveredEntity.CanEnterLayer(layersManager);
47  else
48  return CanExit(layersManager);
49  }
50  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
51  {
53  if (!layersManager)
54  return;
55 
56  if (m_bToEnter)
57  {
58  if (m_bToExtreme)
59  //--- Make entity's parent current layer, so the entity icon is directly visible
60  layersManager.SetCurrentLayer(hoveredEntity.GetParentEntity());
61  else
62  //--- Go one layer down
63  layersManager.ToggleCurrentLayer(hoveredEntity);
64  }
65  else
66  {
67  if (m_bToExtreme)
68  //--- Move to root
69  layersManager.SetCurrentLayer(null);
70  else
71  //--- Go one layer up
72  layersManager.SetCurrentLayerToParent();
73  }
74  }
75  override bool IsServer()
76  {
77  return false;
78  }
79 };
SCR_BaseEditorAction
Definition: SCR_BaseEditorAction.c:24
SCR_LayerContextAction
Definition: SCR_LayerContextAction.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_BaseEditorComponent
Definition: SCR_BaseEditorComponent.c:119
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_LayersEditorComponent
Definition: SCR_LayersEditorManager.c:11
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468