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

◆ UpdatePossibleActions()

override void UpdatePossibleActions ( PlayerBase player,
ActionTarget target,
ItemBase item,
int action_condition_mask )

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

353 {
354 if ( ForceActionCheck(player))
355 {
356 m_SelectActions.Clear();
357 m_SelectActions.Insert(m_ForcedActionData.m_Action);
358 return;
359 }
360
361 if(m_ForcedTarget)
362 {
363 target = m_ForcedTarget;
364 }
365
366 array<ActionBase> select_actions_all = new array<ActionBase>;
367 int i, last_index;
368 bool change = false;
369 m_HasTarget = false;
370
371 m_MainItem = item;
372 m_Target = target;
373 m_ConditionMask = action_condition_mask;
374
375
376 if( m_DetectFromItem )
377 {
378 _GetSelectedActions( item, select_actions_all, m_HasTarget);
379 }
380
381
382 if( m_DetectFromTarget )
383 {
384 _GetSelectedActions( target.GetObject(), select_actions_all, m_HasTarget);
385 _GetSelectedActions( target.GetParent(), select_actions_all, m_HasTarget);
386 }
387
388 if( m_DetectFromPlayer )
389 {
390 _GetSelectedActions( player, select_actions_all, m_HasTarget);
391 }
392
393 if (select_actions_all.Count())
394 {
395 last_index = 0;
396 for ( i = 0; i < select_actions_all.Count(); i++ )
397 {
398 ActionBase action = select_actions_all[i];
399 if ( m_HasTarget )
400 {
401 if ( action.HasTarget() )
402 {
403 if ( m_SelectActions.Count() > last_index )
404 {
405 if ( m_SelectActions[last_index] != action )
406 {
407 change = true;
408 m_SelectActions[last_index] = action;
409 }
410 }
411 else
412 {
413 change = true;
414 m_SelectActions.Insert(action);
415 }
416 action.OnActionInfoUpdate(player, target, item);
417 last_index++;
418 }
419 }
420 else
421 {
422 if ( m_SelectActions.Count() > last_index )
423 {
424 if ( m_SelectActions[last_index] != action )
425 {
426 change = true;
427 m_SelectActions[last_index++] = action;
428 }
429 }
430 else
431 {
432 change = true;
433 m_SelectActions.Insert(action);
434 }
435 action.OnActionInfoUpdate(player, target, item);
436 last_index++;
437 }
438 }
439 }
440 else
441 {
442 change = true;
444 m_SelectActions.Clear();
445 }
446
447 if (m_SelectActions.Count() > last_index)
448 {
449 change = true;
450 for (i = last_index; i < m_SelectActions.Count(); i++)
451 {
452 m_SelectActions.Remove(last_index);
453 }
454 }
455
456 if ( change )
457 {
459 m_Player.GetActionManager().SelectFirstActionCategory();
460 }
461 }
ref ActionTarget m_Target
Определения ActionBase.c:18
void _GetSelectedActions(Object action_source_object, out array< ActionBase > select_actions_all, out bool has_any_action_target)
Определения ActionInput.c:308
int m_selectedActionIndex
Определения ActionInput.c:293
ActionInput m_SelectActions
class BaitData m_MainItem
Определения ActionBase.c:36
DayZPlayer m_Player
Определения Hand_Events.c:42
bool HasTarget()
Определения ActionBase.c:244
void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionBase.c:1214
Определения ActionBase.c:53
Result for an object found in CGame.IsBoxCollidingGeometryProxy.

Перекрестные ссылки _GetSelectedActions(), ActionTarget, ActionBase::HasTarget(), m_MainItem, m_Player, m_SelectActions, m_selectedActionIndex, m_Target и ActionBase::OnActionInfoUpdate().