Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LayerEditableEntityUIComponent.c
Go to the documentation of this file.
2 {
3  [Attribute("IconEmpty", desc: "Icon used when the entity does not have any child entities.")]
4  protected string m_sEmptyIconWidgetName;
5 
6  [Attribute("IconLayer", desc: "Icon used when the entity is a layer, e.g., has some children.\nMUST BE HIDDEN BY DEFAULT!")]
7  protected string m_sLayerIconWidgetName;
8 
9  protected bool m_bIsCustom;
10 
11  //------------------------------------------------------------------------------------------------
12  protected void OnParentEntityChanged(SCR_EditableEntityComponent entity, SCR_EditableEntityComponent parent, SCR_EditableEntityComponent parentPrev)
13  {
14  if (parent == m_Entity || parentPrev == m_Entity)
15  {
16  bool isLayer;
17  if (m_Entity)
18  isLayer = m_Entity.IsLayer();
19 
20  Widget emptyIconWidget = GetWidget().FindAnyWidget(m_sEmptyIconWidgetName);
21  if (emptyIconWidget)
22  emptyIconWidget.SetVisible(!isLayer);
23 
24  Widget layerIconWidget = GetWidget().FindAnyWidget(m_sLayerIconWidgetName);
25  if (layerIconWidget)
26  layerIconWidget.SetVisible(isLayer);
27  }
28  }
29 
30  //------------------------------------------------------------------------------------------------
32  {
33  if (info)
34  {
35  //--- Set custom texture
36  ImageWidget emptyIconWidget = ImageWidget.Cast(GetWidget().FindAnyWidget(m_sEmptyIconWidgetName));
37  m_bIsCustom = info.SetIconTo(emptyIconWidget);
38  }
39 
40  //--- Use automatic textures only if the entity does not have custom one
41  if (!m_bIsCustom && entity)
42  {
44  core.Event_OnParentEntityChanged.Insert(OnParentEntityChanged);
45  if (core)
46  OnParentEntityChanged(null, entity, null);
47  }
48  }
49 
50  //------------------------------------------------------------------------------------------------
51  override void HandlerDeattached(Widget w)
52  {
53  super.HandlerDeattached(w);
54 
55  if (!m_bIsCustom)
56  {
58  if (core)
59  core.Event_OnParentEntityChanged.Remove(OnParentEntityChanged);
60  }
61  }
62 }
SCR_EditableEntityCore
Definition: SCR_EditableEntityCore.c:10
SCR_LayerEditableEntityUIComponent
Definition: SCR_LayerEditableEntityUIComponent.c:1
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_EditableEntityBaseSlotUIComponent
Definition: SCR_EditableEntityBaseSlotUIComponent.c:6
m_Entity
enum EAITargetInfoCategory m_Entity
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseEditableEntityUIComponent
Definition: SCR_BaseEditableEntityUIComponent.c:8
SCR_UIInfo
Definition: SCR_UIInfo.c:7
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
GetWidget
protected Widget GetWidget()
Definition: SCR_VonDisplay.c:155