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

◆ OnPerformCombination()

void Icon::OnPerformCombination ( int combinationFlags)
inlineprotected

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

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

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

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