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

◆ SetActionFromInventory()

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

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

1231 {
1232 ItemBase itemInHand = m_Player.GetItemInHands();
1233 ActionTarget target;
1234 target = new ActionTarget(targetItem, null, -1, vector.Zero, -1);
1235 bool hasTarget = targetItem != NULL;
1236
1237 if (mainItem)
1238 {
1239 array<ActionBase_Basic> actions;
1240 ActionBase picked_action;
1241
1242 //First check single use actions
1243 mainItem.GetActions(DefaultActionInput, actions);
1244 if (actions)
1245 {
1246 for (int i = 0; i < actions.Count(); i++)
1247 {
1248 picked_action = ActionBase.Cast(actions[i]);
1249 if (picked_action && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBeSetFromInventory())
1250 {
1251 if (hasTarget == picked_action.HasTarget())
1252 {
1253 SetInventoryAction(picked_action, target, itemInHand);
1254 return;
1255 }
1256 }
1257 }
1258 }
1259 //second continuous actions
1260 mainItem.GetActions(ContinuousDefaultActionInput, actions);
1261 if (actions)
1262 {
1263 for (int j = 0; j < actions.Count(); j++)
1264 {
1265 picked_action = ActionBase.Cast(actions[j]);
1266 if (picked_action && picked_action.HasTarget() && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBeSetFromInventory())
1267 {
1268 if (hasTarget == picked_action.HasTarget())
1269 {
1270 SetInventoryAction(picked_action, target, itemInHand);
1271 return;
1272 }
1273 }
1274 }
1275 }
1276 }
1277 }
void ContinuousDefaultActionInput(PlayerBase player)
Определения ActionInput.c:607
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:121
class GP5GasMask extends MaskBase ItemBase
DayZPlayer m_Player
Определения Hand_Events.c:42
bool HasTarget()
Определения ActionBase.c:244
bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
Определения ActionBase.c:897
bool CanBeSetFromInventory()
Определения ActionBase.c:319
void SetInventoryAction(ActionBase action_name, ItemBase target_item, ItemBase main_item)
Определения ActionManagerClient.c:794

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

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