24 bool m_DetectFromItem;
25 bool m_DetectFromTarget;
26 bool m_DetectFromPlayer;
33 ref ActionTarget m_ForcedTarget;
35 ref ForcedActionData m_ForcedActionData;
37 ref ActionTarget m_Target;
47 m_ForcedTarget = null;
48 m_ForcedActionData = null;
52 m_JustActivate =
false;
53 m_DetectFromTarget =
false;
54 m_DetectFromItem =
true;
55 m_DetectFromPlayer =
true;
66 Debug.ActionLog(
"n/a",this.
ToString(),
"n/a",
"Init()", player.ToString());
71 void SetEnablity(
bool value)
78 m_input =
GetUApi().GetInputByName(input_name).GetPersistentWrapper();
82 if (m_input && m_input.InputP())
83 Debug.ActionLog(
"(+) input set to " + input_name ,this.
ToString(),
"n/a",
"SetInput()",
"n/a");
85 Debug.ActionLog(
"(-) input is not set to " + input_name ,this.
ToString(),
"n/a",
"SetInput()",
"n/a");
96 return m_input.InputP();
101 return m_JustActivate;
119 m_JustActivate =
false;
123 switch ( m_InputType )
126 m_JustActivate =
false;
129 m_Active = m_input.InputP().LocalHold();
133 m_Active = m_input.InputP().LocalHoldBegin();
134 m_JustActivate = m_Active;
138 m_Active = m_input.InputP().LocalClick();
139 m_JustActivate = m_Active;
142 m_Active = m_input.InputP().LocalDoubleClick();
143 m_JustActivate = m_Active;
147 m_Active = m_input.InputP().LocalHoldBegin();
148 m_JustActivate = m_Active;
152 m_JustActivate =
false;
155 if ( m_input.InputP().LocalClick() )
162 m_Active = m_input.InputP().LocalClick();
163 m_JustActivate = m_Active;
232 m_ForcedActionData =
new ForcedActionData;
233 m_ForcedActionData.m_Action = action;
234 m_ForcedActionData.m_Target = target;
235 m_ForcedActionData.m_Item = item;
240 m_ForcedTarget = target;
245 m_ForcedActionData = null;
250 m_ForcedTarget = NULL;
255 if (m_ForcedActionData)
257 if (m_ForcedActionData.m_Action.Can(player, m_ForcedActionData.m_Target, m_ForcedActionData.m_Item))
260 m_Target = m_ForcedActionData.m_Target;
281 return m_input != NULL;
303 super.ForceAction(action, target, item);
310 if ( !action_source_object )
315 action_source_object.GetActions(this.
Type(), possible_actions);
320 for (
int i = 0; i < possible_actions.Count(); i++)
322 action =
ActionBase.Cast(possible_actions.Get(i));
328 for (
int j = 0; j < variant_actions.Count(); j++)
330 action = variant_actions[j];
333 select_actions_all.Insert(action);
335 has_any_action_target =
true;
343 select_actions_all.Insert(action);
345 has_any_action_target =
true;
354 if ( ForceActionCheck(player))
363 target = m_ForcedTarget;
373 m_ConditionMask = action_condition_mask;
376 if( m_DetectFromItem )
382 if( m_DetectFromTarget )
388 if( m_DetectFromPlayer )
393 if (select_actions_all.Count())
396 for ( i = 0; i < select_actions_all.Count(); i++ )
459 m_Player.GetActionManager().SelectFirstActionCategory();
526 SetInput(
"UAAction");
529 m_DetectFromTarget =
true;
530 m_DetectFromItem =
false;
531 m_DetectFromPlayer =
true;
543 override void OnActionStart()
545 super.OnActionStart();
549 override bool WasEnded()
559 m_DetectFromTarget =
false;
562 override void UpdatePossibleActions(
PlayerBase player, ActionTarget target,
ItemBase item,
int action_condition_mask)
566 m_ConditionMask = action_condition_mask;
572 return m_ForcedActionData.m_Action;
582 for (
int i = 0; i < possible_actions.Count(); i++)
584 action =
ActionBase.Cast(possible_actions.Get(i));
604class ContinuousDefaultActionInput : StandardActionInput
609 SetInput(
"UADefaultAction");
612 m_DetectFromTarget =
false;
613 m_DetectFromItem =
true;
614 m_DetectFromPlayer =
true;
626 super.ActionsSelectReset();
639 override void OnActionStart()
641 super.OnActionStart();
645 override bool WasEnded()
662 ref ActionTarget targetNew;
666 SetInput(
"UACarHorn");
669 m_DetectFromItem =
false;
670 m_DetectFromTarget =
false;
671 m_DetectFromPlayer =
false;
674 override void UpdatePossibleActions(
PlayerBase player, ActionTarget target,
ItemBase item,
int action_condition_mask)
676 if (ForceActionCheck(player))
688 if (player && player.IsInVehicle())
690 HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
693 Transport trans = vehCommand.GetTransport();
707 target = m_ForcedTarget;
710 if (target && target.GetObject())
712 target.GetObject().GetActions(this.
Type(), possibleActions);
715 for (i = 0; i < possibleActions.Count(); i++)
717 action =
ActionBase.Cast(possibleActions.Get(i));
718 if (action.
Can(player, target,
m_MainItem, action_condition_mask))
738 SetInput(
"UACarHorn");
741 m_DetectFromItem =
false;
742 m_DetectFromTarget =
false;
743 m_DetectFromPlayer =
false;
749 ref ActionTarget target_new;
753 SetInput(
"UAToggleHeadlight");
758 override void UpdatePossibleActions(
PlayerBase player, ActionTarget target,
ItemBase item,
int action_condition_mask)
760 if( ForceActionCheck(player) )
773 if ( player && !player.IsInVehicle() )
775 Clothing headgear =
Clothing.Cast(player.FindAttachmentBySlotName(
"Headgear"));
776 Clothing eyewear =
Clothing.Cast(player.FindAttachmentBySlotName(
"Eyewear"));
781 target_new =
new ActionTarget(headgear, null, -1,
vector.Zero, -1);
782 ForceActionTarget(target_new);
786 target_new =
new ActionTarget(eyewear, null, -1,
vector.Zero, -1);
787 ForceActionTarget(target_new);
792 else if ( player && player.IsInVehicle() )
794 HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
797 Transport trans = vehCommand.GetTransport();
800 target_new =
new ActionTarget(trans, null, -1,
vector.Zero, -1);
801 ForceActionTarget(target_new);
809 target = m_ForcedTarget;
812 if(target && target.GetObject())
814 target.GetObject().GetActions(this.
Type(), possible_actions);
817 for (i = 0; i < possible_actions.Count(); i++)
819 action =
ActionBase.Cast(possible_actions.Get(i));
820 if ( action.
Can(player, target,
m_MainItem, action_condition_mask) )
838 ref ActionTarget target_new;
842 SetInput(
"UAToggleNVG");
847 override void UpdatePossibleActions(
PlayerBase player, ActionTarget target,
ItemBase item,
int action_condition_mask)
849 if( ForceActionCheck(player) )
864 Mich2001Helmet helmet = Mich2001Helmet.Cast(player.FindAttachmentBySlotName(
"Headgear"));
869 target_new =
new ActionTarget(helmet, null, -1,
vector.Zero, -1);
870 ForceActionTarget(target_new);
872 else if ( headstrap )
874 target_new =
new ActionTarget(headstrap, null, -1,
vector.Zero, -1);
875 ForceActionTarget(target_new);
881 target = m_ForcedTarget;
884 if(target && target.GetObject())
886 target.GetObject().GetActions(this.
Type(), possible_actions);
889 for (i = 0; i < possible_actions.Count(); i++)
891 action =
ActionBase.Cast(possible_actions.Get(i));
892 if ( action.
Can(player, target,
m_MainItem, action_condition_mask) )
ref ActionTarget m_Target
class BaitData m_MainItem
int GetVariants(out array< ref ActionBase > variants)
void UpdateVariants(Object item, Object target, int componet_index)
void OnActionInfoUpdate(PlayerBase player, ActionTarget target, ItemBase item)
bool Can(PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
override ItemBase GetLightSourceItem()
Native class for boats - handles physics simulation.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.