Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorPlacingHintCondition.c
Go to the documentation of this file.
1 [BaseContainerProps(), SCR_BaseContainerHintCondition()]
3 {
4  [Attribute("-1", uiwidget: UIWidgets.ComboBox, enums: SCR_Enum.GetList(EEditableEntityType, new ParamEnum("<None>", "-1")))]
5  protected EEditableEntityType m_Type;
6 
7  //------------------------------------------------------------------------------------------------
8  protected void OnSelectedPrefabChange(ResourceName prefab, ResourceName prefabPrev)
9  {
10  if (prefab)
11  {
12  if (m_Type == -1)
13  {
14  GetGame().GetCallqueue().CallLater(Activate, 100); //--- Wait for asset browser to close
15  }
16  else
17  {
18  Resource resource = Resource.Load(prefab);
19  IEntitySource entitySource = SCR_BaseContainerTools.FindEntitySource(resource);
20  IEntityComponentSource editableEntitySource = SCR_EditableEntityComponentClass.GetEditableEntitySource(entitySource);
21  if (SCR_EditableEntityComponentClass.GetEntityType(editableEntitySource) == m_Type)
22  {
23  GetGame().GetCallqueue().CallLater(Activate, 100); //--- Wait for asset browser to close
24  }
25  }
26  }
27  else
28  {
29  Deactivate();
30  }
31  }
32 
33  //------------------------------------------------------------------------------------------------
34  override protected void OnInitConditionEditor(SCR_EditorManagerEntity editorManager)
35  {
37  if (placingManager)
38  placingManager.GetOnSelectedPrefabChange().Insert(OnSelectedPrefabChange);
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  override protected void OnExitConditionEditor(SCR_EditorManagerEntity editorManager)
43  {
45  if (placingManager)
46  placingManager.GetOnSelectedPrefabChange().Remove(OnSelectedPrefabChange);
47  }
48 }
SCR_BaseEditorHintCondition
Definition: SCR_BaseEditorHintCondition.c:2
SCR_Enum
Definition: SCR_Enum.c:1
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_EditorPlacingHintCondition
Definition: SCR_EditorPlacingHintCondition.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
m_Type
protected EEditableEntityType m_Type
Definition: SCR_EntitiesToolbarEditorUIComponent.c:3
Deactivate
protected void Deactivate()
Definition: SCR_BaseHintCondition.c:27
Activate
protected void Activate()
Definition: SCR_BaseHintCondition.c:9
SCR_BaseContainerTools
Definition: SCR_BaseContainerTools.c:3
SCR_EditableEntityComponentClass
Definition: SCR_EditableEntityComponentClass.c:2
SCR_PlacingEditorComponent
Definition: SCR_PlacingEditorComponent.c:118
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