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

◆ SetActionFromInventory()

void ActionManagerClient::SetActionFromInventory ( ItemBase mainItem,
ItemBase targetItem )
inlineprotected

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

1286 {
1287 ItemBase itemInHand = m_Player.GetItemInHands();
1288 ActionTarget target;
1289 target = new ActionTarget(targetItem, null, -1, vector.Zero, -1);
1290 bool hasTarget = targetItem != NULL;
1291
1292 if (mainItem)
1293 {
1294 array<ActionBase_Basic> actions;
1295 ActionBase picked_action;
1296
1297 //First check single use actions
1298 mainItem.GetActions(DefaultActionInput, actions);
1299 if (actions)
1300 {
1301 for (int i = 0; i < actions.Count(); i++)
1302 {
1303 picked_action = ActionBase.Cast(actions[i]);
1304 if (picked_action && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBeSetFromInventory())
1305 {
1306 if (hasTarget == picked_action.HasTarget())
1307 {
1308 SetInventoryAction(picked_action, target, itemInHand);
1309 return;
1310 }
1311 }
1312 }
1313 }
1314 //second continuous actions
1315 mainItem.GetActions(ContinuousDefaultActionInput, actions);
1316 if (actions)
1317 {
1318 for (int j = 0; j < actions.Count(); j++)
1319 {
1320 picked_action = ActionBase.Cast(actions[j]);
1321 if (picked_action && picked_action.HasTarget() && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBeSetFromInventory())
1322 {
1323 if (hasTarget == picked_action.HasTarget())
1324 {
1325 SetInventoryAction(picked_action, target, itemInHand);
1326 return;
1327 }
1328 }
1329 }
1330 }
1331 }
1332 }
void ActionBase()
Определения ActionBase.c:82
void ContinuousDefaultActionInput(PlayerBase player)
Определения ActionInput.c:630
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:125
class GP5GasMask extends MaskBase ItemBase
DayZPlayer m_Player
Определения Hand_Events.c:42
void SetInventoryAction(ActionBase action_name, ItemBase target_item, ItemBase main_item)
Определения ActionManagerClient.c:849

Перекрестные ссылки ActionBase(), ActionTarget(), ContinuousDefaultActionInput(), m_Player, SetInventoryAction() и vector::Zero.

Используется в Icon::OnPerformCombination() и Icon::PerformCombination().