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

◆ OnPerformCombination()

void Icon::OnPerformCombination ( int combinationFlags)
inlineprotected

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

455 {
456 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
457 if (m_am_entity1 == null || m_am_entity2 == null) return;
458
459 if (combinationFlags == InventoryCombinationFlags.NONE) return;
460
461 Weapon_Base wpn;
462 Magazine mag;
463
464 if (combinationFlags & InventoryCombinationFlags.PERFORM_ACTION)
465 {
466 ActionManagerClient amc;
467 Class.CastTo(amc, player.GetActionManager());
468
469 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
470 {
471 amc.PerformActionFromInventory(ItemBase.Cast( m_am_entity1 ),ItemBase.Cast( m_am_entity2 ));
472 }
473 else
474 {
475 amc.PerformActionFromInventory(ItemBase.Cast( m_am_entity2 ),ItemBase.Cast( m_am_entity1 ));
476 }
477 }
478 else if (combinationFlags & InventoryCombinationFlags.SET_ACTION)
479 {
480 ActionManagerClient amc2;
481 Class.CastTo(amc2, player.GetActionManager());
482
483 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
484 {
485 amc2.SetActionFromInventory(ItemBase.Cast( m_am_entity1 ), ItemBase.Cast( m_am_entity2 ));
486 }
487 else
488 {
489 amc2.SetActionFromInventory(ItemBase.Cast( m_am_entity2 ), ItemBase.Cast( m_am_entity1 ));
490 }
491 }
492 else if (combinationFlags & InventoryCombinationFlags.COMBINE_QUANTITY2)
493 {
494 ItemBase entity = ItemBase.Cast(m_am_entity1);
495 entity.CombineItemsClient(ItemBase.Cast( m_am_entity2 ));
496 }
497 else if (combinationFlags & InventoryCombinationFlags.ADD_AS_ATTACHMENT)
498 {
499 float stackable = m_am_entity2.GetTargetQuantityMax(-1);
500
501 if (stackable == 0 || stackable >= m_am_entity2.GetQuantity())
502 {
503 player.PredictiveTakeEntityToTargetAttachment(m_am_entity1, m_am_entity2);
504 }
505 else
506 {
507 InventoryLocation il = new InventoryLocation();
508 m_am_entity1.GetInventory().FindFreeLocationFor(m_am_entity2, FindInventoryLocationType.ATTACHMENT, il);
509 ItemBase.Cast(m_am_entity2).SplitIntoStackMaxToInventoryLocationClient(il);
510 }
511 }
512 else if (combinationFlags & InventoryCombinationFlags.ADD_AS_CARGO)
513 {
514 SplitItemUtils.TakeOrSplitToInventory(player, m_am_entity1, m_am_entity2);
515 }
516 }
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
PlayerBase GetPlayer()
Определения ModifierBase.c:51
void SetActionFromInventory(ItemBase mainItem, ItemBase targetItem)
Определения ActionManagerClient.c:1224
void PerformActionFromInventory(ItemBase mainItem, ItemBase targetItem)
Определения ActionManagerClient.c:1087
proto native CGame GetGame()

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, Class::CastTo(), InventoryCombinationFlags::COMBINE_QUANTITY2, GetGame(), GetPlayer(), InventoryCombinationFlags::NONE, InventoryCombinationFlags::PERFORM_ACTION, ActionManagerClient::PerformActionFromInventory(), InventoryCombinationFlags::SET_ACTION, ActionManagerClient::SetActionFromInventory() и SplitItemUtils::TakeOrSplitToInventory().

Используется в FlagAction() и ShowActionMenuCombine().