DayZ 1.30
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 строка 543

544 {
545 if (!m_ThisEntityAI)
546 return;
547
548 // Lets update sockets, if there are any
549 int slots_c = GetSocketsCount();
550
551 for (int i = 0; i < slots_c; ++i)
552 {
553 EntityAI plug_owner = GetDeviceBySocketID(i);
554
555 if (plug_owner)
556 {
557 string plugged_selection = SOCKET_ + (i+1).ToString() + _PLUGGED;
558 string available_selection = SOCKET_ + (i+1).ToString() + _AVAILABLE;
559 m_ThisEntityAI.ShowSelection(plugged_selection);
560 m_ThisEntityAI.HideSelection(available_selection);
561 string texture_path = plug_owner.GetCompEM().GetCordTextureFile();
562 int selection_index = m_ThisEntityAI.GetHiddenSelectionIndex(plugged_selection);
563 m_ThisEntityAI.SetObjectTexture(selection_index, texture_path);
564 }
565 else
566 {
567 m_ThisEntityAI.ShowSelection(SOCKET_ + (i+1).ToString() + _AVAILABLE);
568 m_ThisEntityAI.HideSelection(SOCKET_ + (i+1).ToString() + _PLUGGED);
569 }
570 }
571
572 // Now lets update the cord/plug state
573 if (GetEnergySource())
574 {
575 m_ThisEntityAI.ShowSelection(SEL_CORD_PLUGGED);
576 m_ThisEntityAI.HideSelection(SEL_CORD_FOLDED);
577 }
578 else
579 {
580 m_ThisEntityAI.ShowSelection(SEL_CORD_FOLDED);
581 m_ThisEntityAI.HideSelection(SEL_CORD_PLUGGED);
582 }
583 }
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:1324
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:1134
EntityAI GetDeviceBySocketID(int id)
Energy manager: Returns the device which is plugged into the given socket ID.
Определения ComponentEnergyManager.c:1330

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