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

◆ PerformActionFromInventory()

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

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

1149 {
1150 ItemBase itemInHand = m_Player.GetItemInHands();
1151 ActionTarget target;
1152 target = new ActionTarget(targetItem, null, -1, vector.Zero, -1);
1153 bool hasTarget = targetItem != NULL;
1154
1155 if (mainItem)
1156 {
1157 ActionBase picked_action;
1158 array<ActionBase_Basic> actions;
1159 int i;
1160
1161 //First check single use actions
1162 mainItem.GetActions(DefaultActionInput, actions);
1163 if (actions)
1164 {
1165 for (i = 0; i < actions.Count(); i++)
1166 {
1167 picked_action = ActionBase.Cast(actions[i]);
1168 if (picked_action && picked_action.Can(m_Player,target, itemInHand) && picked_action.CanBePerformedFromInventory())
1169 {
1170 if (hasTarget == picked_action.HasTarget())
1171 {
1172 ActionStart(picked_action, target, mainItem);
1173 return;
1174 }
1175 }
1176 }
1177 }
1178
1179 //Inventory specific actions
1180 mainItem.GetActions(InventoryOnlyActionInput, actions);
1181 if (actions)
1182 {
1183 for (i = 0; i < actions.Count(); i++)
1184 {
1185 picked_action = ActionBase.Cast(actions[i]);
1186 if (picked_action && picked_action.Can(m_Player,target, itemInHand))
1187 {
1188 if (hasTarget == picked_action.HasTarget())
1189 {
1190 ActionStart(picked_action, target, mainItem);
1191 return;
1192 }
1193 }
1194 }
1195 }
1196 }
1197 }
void ActionBase()
Определения ActionBase.c:82
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 ActionStart(ActionBase action, ActionTarget target, ItemBase item, Param extra_data=NULL)
Определения ActionManagerClient.c:626

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

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