Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseEditableEntityUIComponent.c
Go to the documentation of this file.
1 
8 class SCR_BaseEditableEntityUIComponent : ScriptedWidgetComponent
9 {
10  [Attribute(desc: "When true, the icon will remain visible on edge of the screen when it's not in the view.")]
11  private bool m_bShowOffScreen;
12 
13  private Widget m_Widget;
14  protected SCR_EditableEntityComponent m_Entity;
15  private WorkspaceWidget m_Workspace;
16  private float m_fFade;
17 
18  //------------------------------------------------------------------------------------------------
21  void OnRefresh(SCR_EditableEntityBaseSlotUIComponent slot);
22 
23  //------------------------------------------------------------------------------------------------
29 
30  //------------------------------------------------------------------------------------------------
33  void OnShownOffScreen(bool offScreen);
34 
35  //------------------------------------------------------------------------------------------------
40  {
41  if (entity)
42  {
43  m_Entity = entity;
44  OnInit(entity, entity.GetInfo(), slot)
45  }
46  }
47 
48  //------------------------------------------------------------------------------------------------
53  sealed void Init(SCR_UIInfo info, SCR_EditableEntityBaseSlotUIComponent slot)
54  {
55  if (info)
56  OnInit(null, info, slot)
57  }
58 
59  //------------------------------------------------------------------------------------------------
63  {
64  if (m_Widget)
65  {
66  m_Widget.RemoveFromHierarchy();
67  m_Widget = null;
68  }
69  }
70  //------------------------------------------------------------------------------------------------
72  SCR_EditableEntityComponent GetEntity()
73  {
74  return m_Entity;
75  }
76 
77  //------------------------------------------------------------------------------------------------
79  Widget GetWidget()
80  {
81  return m_Widget;
82  }
83 
84  //------------------------------------------------------------------------------------------------
86  bool IsVisible()
87  {
88  return m_Widget && m_Widget.IsVisible();
89  }
90 
91  //------------------------------------------------------------------------------------------------
94  void SetVisible(bool visible)
95  {
96  m_Widget.SetVisible(visible);
97  m_Widget.SetEnabled(visible);
98  }
99 
100 // //------------------------------------------------------------------------------------------------
101 // //! Get faction of editable entity.
102 // //! \param[in] owner Entity which will be checked (by default the entity the widget represents)
103 // //! \return Faction
104 // Faction GetFaction(GenericEntity owner = null)
105 // {
106 // if (!owner && m_Entity)
107 // owner = m_Entity.GetOwner();
108 //
109 // if (!owner)
110 // return null;
111 //
112 // FactionAffiliationComponent factionComponent = FactionAffiliationComponent.Cast(owner.FindComponent(FactionAffiliationComponent));
113 // if (!factionComponent)
114 // return null;
115 //
116 // return factionComponent.GetAffiliatedFaction();
117 // }
118 
119  //------------------------------------------------------------------------------------------------
122  bool IsShownOffScreen()
123  {
124  return m_bShowOffScreen;// || m_Entity.HasEntityState(EEditableEntityState.CURRENT_LAYER_CHILDREN);
125  }
126 
127  //------------------------------------------------------------------------------------------------
128  override void HandlerAttached(Widget w)
129  {
130  m_Widget = w;
131  m_Workspace = GetGame().GetWorkspace();
132  m_fFade = 0;
133  }
134 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
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.
m_Workspace
protected WorkspaceWidget m_Workspace
Definition: SCR_EntitiesEditorUIComponent.c:13
SCR_BaseEditableEntityUIComponent
Definition: SCR_BaseEditableEntityUIComponent.c:8
SCR_UIInfo
Definition: SCR_UIInfo.c:7
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
OnInit
override protected void OnInit(IEntity owner)
Definition: SCR_CharacterCommandHandler_Tests.c:523