DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ UpdateSelections()

void ComponentEnergyManager::UpdateSelections ( )
inlineprotected

Energy manager: Shows/Hides all selections this system works with. Call this if something is wrong with selections (like during Init and Restore event in config)

См. определение в файле ComponentEnergyManager.c строка 556

557 {
558 if (!m_ThisEntityAI)
559 return;
560
561 // Lets update sockets, if there are any
562 int slots_c = GetSocketsCount();
563
564 for (int i = 0; i < slots_c; ++i)
565 {
566 EntityAI plug_owner = GetDeviceBySocketID(i);
567
568 if (plug_owner)
569 {
570 string plugged_selection = SOCKET_ + (i+1).ToString() + _PLUGGED;
571 string available_selection = SOCKET_ + (i+1).ToString() + _AVAILABLE;
572 m_ThisEntityAI.ShowSelection(plugged_selection);
573 m_ThisEntityAI.HideSelection(available_selection);
574 string texture_path = plug_owner.GetCompEM().GetCordTextureFile();
575 int selection_index = m_ThisEntityAI.GetHiddenSelectionIndex(plugged_selection);
576 m_ThisEntityAI.SetObjectTexture(selection_index, texture_path);
577 }
578 else
579 {
580 m_ThisEntityAI.ShowSelection(SOCKET_ + (i+1).ToString() + _AVAILABLE);
581 m_ThisEntityAI.HideSelection(SOCKET_ + (i+1).ToString() + _PLUGGED);
582 }
583 }
584
585 // Now lets update the cord/plug state
586 if (GetEnergySource())
587 {
588 m_ThisEntityAI.ShowSelection(SEL_CORD_PLUGGED);
589 m_ThisEntityAI.HideSelection(SEL_CORD_FOLDED);
590 }
591 else
592 {
593 m_ThisEntityAI.ShowSelection(SEL_CORD_FOLDED);
594 m_ThisEntityAI.HideSelection(SEL_CORD_PLUGGED);
595 }
596 }
class LogManager EntityAI
proto string ToString()
EntityAI m_ThisEntityAI
Определения Component.c:24
static const string SEL_CORD_FOLDED
Определения ComponentEnergyManager.c:66
static const string SOCKET_
Определения ComponentEnergyManager.c:62
static const string _AVAILABLE
Определения ComponentEnergyManager.c:64
static const string _PLUGGED
Определения ComponentEnergyManager.c:63
EntityAI GetEnergySource()
Energy manager: Returns the energy source this device is plugged into.
Определения ComponentEnergyManager.c:1337
static const string SEL_CORD_PLUGGED
Определения ComponentEnergyManager.c:65
int GetSocketsCount()
Energy manager: Returns the count of power sockets (whenever used or not)
Определения ComponentEnergyManager.c:1147
EntityAI GetDeviceBySocketID(int id)
Energy manager: Returns the device which is plugged into the given socket ID.
Определения ComponentEnergyManager.c:1343

Перекрестные ссылки _AVAILABLE, _PLUGGED, GetDeviceBySocketID(), GetEnergySource(), GetSocketsCount(), Component::m_ThisEntityAI, SEL_CORD_FOLDED, SEL_CORD_PLUGGED, SOCKET_ и ToString().