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

◆ GetItemDesc()

string ActionTargetsCursor::GetItemDesc ( ActionBase action)
inlineprotected

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

743 {
744 string desc = "";
746 if (!tgObject && m_Target)
747 {
748 tgObject = m_Target.GetObject();
749 }
750
751 if (tgObject)
752 {
753 //BreakOut if item is ruined
754 Object tgParent = m_Target.GetParent();
755 if (!tgObject.IsAlive())
756 {
757 //Fetch parent item name if one is present
758 if (!tgParent || tgObject.DisplayNameRuinAttach())
759 desc = tgObject.GetDisplayName();
760 else
761 desc = tgParent.GetDisplayName();
762 return desc;
763 }
764
765 EntityAI targetEntity;
766
767 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport() || tgParent.CanUseConstruction()))
768 {
769 targetEntity = EntityAI.Cast(tgParent);
770 }
771
772 if (tgObject.IsItemBase() || tgObject.IsTransport() || tgObject.CanUseConstruction())
773 {
774 targetEntity = EntityAI.Cast(tgObject);
775 }
776
777 if (targetEntity && targetEntity.ShowZonesHealth()) //TODO: investigate, should ShowZonesHealth be in the 'description' part?
778 {
779 string zone = "";
780
781 array<string> selections = new array<string>();
782
783 //NOTE: relevant fire geometry and view geometry selection names MUST match in order to get a valid damage zone
784 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
785 {
786 //This is really specific to tents, as they use proxies. Hence object must be used
787 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
788 {
789 desc = DamageSystem.GetDamageDisplayName(targetEntity, zone);
790 }
791 }
792 else
793 {
794 targetEntity.GetActionComponentNameList(m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
795
796 //Important to get display name from component tied to multiple selections
797 for (int s = 0; s < selections.Count(); s++)
798 {
799 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, selections[s], zone))
800 {
801 desc = DamageSystem.GetDamageDisplayName(targetEntity, zone);
802 }
803 }
804 }
805 }
806
807 //Safety check to output something to widget
808 if (targetEntity && desc == "")
809 desc = targetEntity.GetDisplayName();
810 }
811
812 return desc;
813 }
class LogManager EntityAI
ActionTarget m_Target
Определения ActionTargetsCursor.c:65
Object m_DisplayInteractTarget
Определения ActionTargetsCursor.c:67
class LOD Object

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

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