11 override void CreateConditionComponents()
22 override bool HasProgress()
27 override bool HasTarget()
35 if (
Class.CastTo(optic, item) && !optic.IsInOptics() && !player.IsNVGLowered())
42 override bool ActionConditionContinue(
ActionData action_data)
47 override void OnStartClient(
ActionData action_data)
49 super.OnStartClient(action_data);
51 GetGame().GetMission().AddActiveInputExcludes({
"actonViewOpticExcl"});
54 override void OnStartServer(
ActionData action_data)
56 super.OnStartServer(action_data);
59 GetGame().GetMission().AddActiveInputExcludes({
"actonViewOpticExcl"});
62 override void OnStartAnimationLoopServer(
ActionData action_data)
65 if (
Class.CastTo(optic, action_data.m_MainItem))
67 if (!optic.IsInOptics())
69 EnterOptics(optic, action_data.m_Player);
74 override void OnStartAnimationLoopClient(
ActionData action_data)
77 if (
Class.CastTo(optic, action_data.m_MainItem))
79 if (!optic.IsInOptics())
81 EnterOptics(optic, action_data.m_Player);
86 override void OnEndClient(
ActionData action_data)
89 if (
Class.CastTo(optic, action_data.m_MainItem) && optic.IsInOptics())
91 ExitOptics(optic, action_data.m_Player);
93 GetGame().GetMission().RemoveActiveInputExcludes({
"actonViewOpticExcl"});
96 override void OnEndServer(
ActionData action_data)
99 if (
Class.CastTo(optic, action_data.m_MainItem) && optic.IsInOptics())
101 ExitOptics(optic, action_data.m_Player);
104 if (!
GetGame().IsMultiplayer())
105 GetGame().GetMission().RemoveActiveInputExcludes({
"actonViewOpticExcl"});
108 override void OnEndAnimationLoopClient(
ActionData action_data)
111 if (
Class.CastTo(optic, action_data.m_MainItem))
113 ExitOptics(optic, action_data.m_Player);
117 override void OnEndAnimationLoopServer(
ActionData action_data)
120 if (
Class.CastTo(optic, action_data.m_MainItem))
122 ExitOptics(optic, action_data.m_Player);
128 if (!item.HasEnergyManager())
132 else if (item.GetCompEM() && item.GetCompEM().CanWork())
142 player.SetIronsights(
false);
143 player.SetHandheldOpticsInUse(
true);
144 player.SetOptics(
true);
146 optic.HideSelection(
"hide");
147 if (optic.HasEnergyManager())
148 optic.GetCompEM().SwitchOn();
149 player.GetAimingModel().SetAimNoiseAllowed(
false);
154 optic.ShowSelection(
"hide");
156 player.SetHandheldOpticsInUse(
false);
157 if (optic.HasEnergyManager())
158 optic.GetCompEM().SwitchOff();
159 player.GetAimingModel().SetAimNoiseAllowed(
true);