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

◆ PerformCombination()

bool Icon::PerformCombination ( EntityAI selectedEntity,
EntityAI targetEntity,
int combinationFlag,
InventoryLocation ilSwapDst = null )
inlineprotected

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

519 {
520 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
521 ActionManagerClient amc;
522
523 switch (combinationFlag)
524 {
525 case InventoryCombinationFlags.ADD_AS_ATTACHMENT:
526 return player.PredictiveTakeEntityToTargetAttachment(targetEntity, selectedEntity);
527 case InventoryCombinationFlags.ADD_AS_CARGO:
528 SplitItemUtils.TakeOrSplitToInventory(player, targetEntity, selectedEntity);
529 return true;
530 case InventoryCombinationFlags.COMBINE_QUANTITY2:
531 targetEntity.CombineItemsClient(selectedEntity);
532 return true;
533 case InventoryCombinationFlags.SET_ACTION:
534 Class.CastTo(amc, player.GetActionManager());
535 if (targetEntity == player.GetHumanInventory().GetEntityInHands())
536 {
537 amc.SetActionFromInventory(ItemBase.Cast(targetEntity), ItemBase.Cast(selectedEntity));
538 }
539 else
540 {
541 amc.SetActionFromInventory(ItemBase.Cast(selectedEntity), ItemBase.Cast(targetEntity));
542 }
543 return true;
544 case InventoryCombinationFlags.PERFORM_ACTION:
545 Class.CastTo(amc, player.GetActionManager());
546 if (targetEntity == player.GetHumanInventory().GetEntityInHands())
547 {
548 amc.PerformActionFromInventory(ItemBase.Cast(targetEntity), ItemBase.Cast(selectedEntity));
549 }
550 else
551 {
552 amc.PerformActionFromInventory(ItemBase.Cast(selectedEntity), ItemBase.Cast(targetEntity));
553 }
554 return true;
555 case InventoryCombinationFlags.SWAP_MAGAZINE:
556 return player.GetWeaponManager().SwapMagazine(Magazine.Cast(selectedEntity));
557 case InventoryCombinationFlags.SWAP:
558 return player.PredictiveSwapEntities(targetEntity, selectedEntity);
559 case InventoryCombinationFlags.FSWAP:
560 return player.PredictiveForceSwapEntities(selectedEntity, targetEntity, ilSwapDst);
561 default:
562 return false;
563 }
564
565 return false;
566 }
class GP5GasMask extends MaskBase ItemBase
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, InventoryCombinationFlags::FSWAP, GetGame(), GetPlayer(), InventoryCombinationFlags::PERFORM_ACTION, ActionManagerClient::PerformActionFromInventory(), InventoryCombinationFlags::SET_ACTION, ActionManagerClient::SetActionFromInventory(), InventoryCombinationFlags::SWAP, InventoryCombinationFlags::SWAP_MAGAZINE и SplitItemUtils::TakeOrSplitToInventory().

Используется в Combine(), DropReceivedFromMain() и Swap().