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

◆ GetItemDesc()

string ActionTargetsCursor::GetItemDesc ( ActionBase action)
inlineprotected

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

782 {
783 string desc = "";
785 if (!tgObject && m_Target)
786 {
787 tgObject = m_Target.GetObject();
788 }
789
790 if (tgObject)
791 {
792 //BreakOut if item is ruined
793 Object tgParent = m_Target.GetParent();
794 if (!tgObject.IsAlive())
795 {
796 //Fetch parent item name if one is present
797 if (!tgParent || tgObject.DisplayNameRuinAttach())
798 desc = tgObject.GetDisplayName();
799 else
800 desc = tgParent.GetDisplayName();
801 return desc;
802 }
803
804 EntityAI targetEntity;
805
806 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport()))
807 {
808 targetEntity = EntityAI.Cast(tgParent);
809 }
810
811 if (tgObject.IsItemBase() || tgObject.IsTransport())
812 {
813 targetEntity = EntityAI.Cast(tgObject);
814 }
815
816 if (targetEntity && targetEntity.ShowZonesHealth())
817 {
818 string zone = "";
819
820 array<string> selections = new array<string>();
821
822 //NOTE: relevant fire geometry and view geometry selection names MUST match in order to get a valid damage zone
823 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
824 {
825 //This is really specific to tents, as they use proxies. Hence object must be used
826 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
827 {
828 desc = DamageSystem.GetDamageDisplayName(targetEntity, zone);
829 }
830 }
831 else
832 {
833 targetEntity.GetActionComponentNameList(m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
834
835 //Important to get display name from component tied to multiple selections
836 for (int s = 0; s < selections.Count(); s++)
837 {
838 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, selections[s], zone))
839 {
840 desc = DamageSystem.GetDamageDisplayName(targetEntity, zone);
841 }
842 }
843 }
844 }
845
846 //Safety check to output something to widget
847 if (targetEntity && desc == "")
848 desc = targetEntity.GetDisplayName();
849 }
850
851 return desc;
class LogManager EntityAI
ActionTarget m_Target
Определения ActionTargetsCursor.c:61
Object m_DisplayInteractTarget
Определения ActionTargetsCursor.c:63
override bool ShowZonesHealth()
Определения Transport.c:288
class LOD Object

Перекрестные ссылки m_DisplayInteractTarget, m_Target, LOD::NAME_FIRE, LOD::NAME_VIEW и EntityAI::ShowZonesHealth().

Используется в PrepareCursorContent().