Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AdjustCollimatorElevationAction.c
Go to the documentation of this file.
2{
3 [Attribute(defvalue: "1", desc: "")]
4 float m_fAngleUnit;
5
6 //------------------------------------------------------------------------------------------------
7 override void OnActionStart(IEntity pUserEntity)
8 {
9 super.OnActionStart(pUserEntity);
10
12 m_fTargetValue = m_SightsComponent.GetVerticalAngularCorrection();
13 }
14
15 //------------------------------------------------------------------------------------------------
18 override protected bool OnSaveActionData(ScriptBitWriter writer)
19 {
20 if (float.AlmostEqual(m_fTargetValue, m_SightsComponent.GetVerticalAngularCorrection()))
21 return false;
22
24 m_SightsComponent.SetVerticalAngularCorrection(m_fTargetValue * m_fAngleUnit);
25
26 return super.OnSaveActionData(writer);
27 }
28
29 //------------------------------------------------------------------------------------------------
33 override protected bool OnLoadActionData(ScriptBitReader reader)
34 {
35 bool loaded = super.OnLoadActionData(reader);
36
38 return loaded;
39
41 m_SightsComponent.SetVerticalAngularCorrection(m_fTargetValue * m_fAngleUnit);
42
43 return loaded;
44 }
45}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_CollimatorSightsComponent m_SightsComponent
float m_fTargetValue
Normalized current value.
bool m_bIsAdjustedByPlayer
Interacted with by main entity. Allows reading input actions.
SCR_FieldOfViewSettings Attribute