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

◆ OnPerformCombination()

void HandsContainer::OnPerformCombination ( int combinationFlags)
inlineprotected

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

625 {
626 PlayerBase m_player = PlayerBase.Cast( GetGame().GetPlayer() );
627 if ( m_am_entity1 == null || m_am_entity2 == null ) return;
628
629 if ( combinationFlags == InventoryCombinationFlags.NONE ) return;
630
631 if ( combinationFlags & InventoryCombinationFlags.LOAD_CHAMBER )
632 {
633 Magazine mag;
634 if ( Class.CastTo(mag, m_am_entity2 ) )
635 {
637 return;
638 }
639 }
640
641 if ( combinationFlags & InventoryCombinationFlags.ADD_AS_ATTACHMENT )
642 {
643 if( m_Atts )
644 {
645 m_Body.RemoveItem( m_Atts.GetWrapper() );
646 delete m_Atts;
647 }
648 if( m_am_entity2.GetSlotsCountCorrect() > 0 )
649 {
650 m_Atts = new Attachments( this, m_am_entity2 );
651 m_Atts.InitAttachmentGrid( 1 );
652
653 }
654
655 Refresh();
656 m_Parent.Refresh();
657
658 Weapon_Base wpn1;
659 Magazine mag1;
660 if ( Class.CastTo(wpn1, m_am_entity1 ) && Class.CastTo(mag1, m_am_entity2 ) )
661 {
663 {
665 return;
666 }
667 }
668
669 SplitItemUtils.TakeOrSplitToInventory(m_player, m_am_entity1, m_am_entity2);
670 //m_player.PredictiveTakeEntityToTargetAttachment( m_am_entity1, m_am_entity2 );
671 }
672
673 if ( combinationFlags & InventoryCombinationFlags.ADD_AS_CARGO )
674 {
675 m_player.PredictiveTakeEntityToTargetCargo( m_am_entity1, m_am_entity2 );
676 }
677
678 if ( combinationFlags & InventoryCombinationFlags.SWAP )
679 {
680 Magazine swapmag1;
681 Magazine swapmag2;
682 if (Class.CastTo(swapmag1, m_am_entity1) && Class.CastTo(swapmag2, m_am_entity2 ) )
683 {
684 if( m_player.GetWeaponManager().CanSwapMagazine( Weapon_Base.Cast( swapmag1.GetParent() ), Magazine.Cast( swapmag2 ) ) )
685 {
687 return;
688 }
689
690 if( m_player.GetWeaponManager().CanSwapMagazine(Weapon_Base.Cast( swapmag2.GetParent() ), Magazine.Cast( swapmag1 )) )
691 {
693 return;
694 }
695 }
696 if ( !m_player.PredictiveSwapEntities( m_am_entity1, m_am_entity2 ) && m_player.GetHumanInventory().CanAddEntityInHands( m_am_entity1 ) )
697 {
698 m_player.PredictiveTakeEntityToHands( m_am_entity1 );
699 }
700 }
701
702 if ( combinationFlags & InventoryCombinationFlags.TAKE_TO_HANDS )
703 {
704 if ( m_Atts )
705 {
706 m_Body.RemoveItem( m_Atts.GetWrapper() );
707 delete m_Atts;
708 }
709
710 if ( m_am_entity2.GetSlotsCountCorrect() > 0 )
711 {
712 m_Atts = new Attachments( this, m_am_entity2 );
713 m_Atts.InitAttachmentGrid( 1 );
714
715 }
716 Refresh();
717 m_Parent.Refresh();
718
719 if ( m_player.GetHumanInventory().CanAddEntityInHands( m_am_entity2 ) )
720 {
721 m_player.PredictiveTakeEntityToHands( m_am_entity2 );
722 }
723 }
724 }
PlayerBase GetPlayer()
Определения ModifierBase.c:51
DayZPlayer m_player
Определения RandomGeneratorSyncManager.c:16
Widget m_Parent
Определения SizeToChild.c:92
WeaponManager GetWeaponManager()
Определения DayZPlayerImplement.c:970
ref Attachments m_Atts
Определения HandsContainer.c:7
override void Refresh()
Определения HandsContainer.c:323
bool CanAttachMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
Определения WeaponManager.c:91
bool AttachMagazine(Magazine mag, ActionBase control_action=NULL)
Определения WeaponManager.c:397
bool LoadBullet(Magazine mag, ActionBase control_action=NULL)
Определения WeaponManager.c:422
bool CanSwapMagazine(Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
Определения WeaponManager.c:132
bool SwapMagazine(Magazine mag, ActionBase control_action=NULL)
Определения WeaponManager.c:407
proto native CGame GetGame()

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, Class::CastTo(), GetGame(), GetPlayer(), InventoryCombinationFlags::LOAD_CHAMBER, m_Atts, m_Parent, m_player, InventoryCombinationFlags::NONE, Refresh(), InventoryCombinationFlags::SWAP, InventoryCombinationFlags::TAKE_TO_HANDS и SplitItemUtils::TakeOrSplitToInventory().