Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
containerwithelectricmanager.c
Go to the documentation of this file.
1 class ContainerWithElectricManager : ContainerWithCargoAndAttachments
2 {
3  override void UpdateInterval()
4  {
5  super.UpdateInterval();
6 
7  if (m_Entity)
8  ElectricityIcon();
9  }
10 
11  override void SetEntity(EntityAI entity, bool immedUpdate = true)
12  {
13  super.SetEntity(entity, immedUpdate);
14 
15  ElectricityIcon();
16  }
17 
18  void ElectricityIcon()
19  {
20  if (GetRootWidget().FindAnyWidget("electricity"))
21  {
22  bool hasElectricityIcon = m_Entity.GetCompEM().HasElectricityIcon();
23  GetRootWidget().FindAnyWidget("electricity").Show(hasElectricityIcon);
24  }
25 
26  if (GetRootWidget().FindAnyWidget("electricity_can_work"))
27  {
28  bool electricityCanWorkIcon = m_Entity.GetCompEM().CanWork() && !m_Entity.IsRuined();
29  GetRootWidget().FindAnyWidget("electricity_can_work").Show(electricityCanWorkIcon);
30  }
31  }
32 }
FindAnyWidget
proto native Widget FindAnyWidget(string pathname)
ContainerWithElectricManager
Definition: containerwithelectricmanager.c:1
EntityAI
Definition: building.c:5
m_Entity
EntityAI m_Entity
Definition: actiondebug.c:11