Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorAttributesHintCondition.c
Go to the documentation of this file.
1 [BaseContainerProps(), SCR_BaseContainerHintCondition()]
3 {
4  [Attribute(uiwidget: UIWidgets.ComboBox, enums: { new ParamEnum("Game Mode", "0"), new ParamEnum("Camera", "1"), new ParamEnum("Editable Entity", "2") })]
5  protected int m_iItemType;
6 
7  //------------------------------------------------------------------------------------------------
8  protected void OnAttributesStart()
9  {
10  SCR_AttributesManagerEditorComponent attributesManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
11  if (attributesManager)
12  {
13  array<Managed> items = {};
14  if (attributesManager.GetEditedItems(items) == 0 || !items[0])
15  return;
16 
17  typename type;
18  switch (m_iItemType)
19  {
20  case 0: type = SCR_BaseGameMode; break;
21  case 1: type = SCR_ManualCamera; break;
22  case 2: type = SCR_EditableEntityComponent; break;
23  }
24 
25  if (items[0].Type().IsInherited(type))
26  Activate();
27  }
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  override protected void OnInitConditionEditor(SCR_EditorManagerEntity editorManager)
32  {
33  SCR_AttributesManagerEditorComponent attributesManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
34  if (attributesManager)
35  {
36  attributesManager.GetOnAttributesStart().Insert(OnAttributesStart);
37  attributesManager.GetOnAttributesConfirm().Insert(Deactivate);
38  attributesManager.GetOnAttributesCancel().Insert(Deactivate);
39  }
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  override protected void OnExitConditionEditor(SCR_EditorManagerEntity editorManager)
44  {
45  SCR_AttributesManagerEditorComponent attributesManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
46  if (attributesManager)
47  {
48  attributesManager.GetOnAttributesStart().Remove(OnAttributesStart);
49  attributesManager.GetOnAttributesConfirm().Remove(Deactivate);
50  attributesManager.GetOnAttributesCancel().Remove(Deactivate);
51  }
52  }
53 }
SCR_BaseEditorHintCondition
Definition: SCR_BaseEditorHintCondition.c:2
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
SCR_ManualCamera
Definition: SCR_ManualCamera.c:16
SCR_EditorAttributesHintCondition
Definition: SCR_EditorAttributesHintCondition.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
IsInherited
bool IsInherited(string factionKey)
Definition: SCR_Faction.c:227
Deactivate
protected void Deactivate()
Definition: SCR_BaseHintCondition.c:27
Activate
protected void Activate()
Definition: SCR_BaseHintCondition.c:9
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
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
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26