Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseEditableEntityUIComponent.c
Go to the documentation of this file.
1
2
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;
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 //------------------------------------------------------------------------------------------------
62 void Exit(SCR_EditableEntityBaseSlotUIComponent slot)
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}
override void Init()
ArmaReforgerScripted GetGame()
Definition game.c:1398
bool IsVisible()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Widget GetWidget()
SCR_UIInfo GetInfo(IEntity owner=null)
IEntity GetEntity()
SCR_FieldOfViewSettings Attribute