Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditableEntityUIRule.c
Go to the documentation of this file.
1 
9 {
11  [Attribute(desc: "Entity states this component visualizes.", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(EEditableEntityState))]
12  protected EEditableEntityState m_States;
13 
15  [Attribute(desc: "When interactive, icons can be selected by mouse or gamepad.")]
16  protected bool m_bInteractive;
17 
18  [Attribute(desc: "When enabled, the icon will be shown only if other rules are active, it won't force visibility.")]
19  protected bool m_bIsDependent;
20 
22  [Attribute(desc: "Layouts assigned to each supported entity type.")]
23  protected ref array<ref SCR_EntitiesEditorUIPrefab> m_PrefabLinks;
24 
25  protected ref map<EEditableEntityType, ResourceName> m_PrefabLinksMap = new map<EEditableEntityType, ResourceName>;
26  protected ResourceName m_DefaultLayout;
27 
28  ResourceName GetLayout(EEditableEntityType type)
29  {
30  ResourceName layout;
31  if (!m_PrefabLinksMap.Find(type, layout))
32  layout = m_DefaultLayout;
33 
34  if (!layout)
35  Print(string.Format("No UI layout found for an entity of type '%1'!", typename.EnumToString(EEditableEntityType, type)), LogLevel.WARNING);
36 
37  return layout;
38  }
39  EEditableEntityState GetStates()
40  {
41  return m_States;
42  }
43  int GetStatesArray(out array<EEditableEntityState> outStates)
44  {
45  return SCR_Enum.BitToIntArray(m_States, outStates);
46  }
47  bool IsInteractive()
48  {
49  return m_bInteractive;
50  }
51  bool IsDependent()
52  {
53  return m_bIsDependent;
54  }
55 
57  {
58  //--- Build prefab map
59  foreach (SCR_EntitiesEditorUIPrefab link: m_PrefabLinks)
60  {
61  m_PrefabLinksMap.Insert(link.GetType(), link.GetLayout());
62  }
63  m_PrefabLinks = null; //--- Erase the value afterwards, it's in m_PrefabLinksMap now
64 
65  if (!m_PrefabLinksMap.Find(EEditableEntityType.GENERIC, m_DefaultLayout))
66  {
67  Print(string.Format("%1 for type %2 is missing GENERIC type!", Type(), Type().EnumToString(EEditableEntityType, EEditableEntityType.GENERIC)), LogLevel.ERROR);
68  }
69  }
70 };
EEditableEntityState
EEditableEntityState
Definition: EEditableEntityState.c:37
SCR_Enum
Definition: SCR_Enum.c:1
SCR_EntitiesEditorUIRule
Definition: SCR_EditableEntityUIRule.c:8
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_BaseContainerCustomTitleFlags
Attribute for setting any flags enum property as custom title.
Definition: Attributes.c:344
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
layout
UI layouts HUD CampaignMP CampaignMainHUD layout
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:20
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
SCR_EntitiesEditorUIPrefab
Definition: SCR_EntitiesEditorUIPrefab.c:2
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