DayZ 1.27
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 строка 547

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

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