9 [
Attribute(
"0", UIWidgets.CheckBox,
"Should hide parent of parent object when using 2D sights",
category:
"2DSights")]
10 protected bool m_bShouldHideParentParentObject;
12 [
Attribute(
"0", UIWidgets.CheckBox,
"Should reticle be scaled with current zoom",
category:
"2DSights")]
15 [
Attribute(
"1.4", UIWidgets.Slider,
"Scale mult. of scope when target recoil is applied.",
category:
"2DSights",
params:
"1 3 0.01")]
18 [
Attribute(
"0.12", UIWidgets.Slider,
"The amount of linear translation of recoil in meters that is deemed as target and applies the most scale, no scale is applied beyond this value.",
category:
"2DSights",
params:
"0.001 0.5 0.001")]
21 [
Attribute(
"10", UIWidgets.Slider,
"Scale mult. of scope movement when target recoil is applied.",
category:
"2DSights",
params:
"1 50 0.01")]
42 super.OnSightADSActivated();
57 IEntity parent = owner.GetParent();
58 if (m_bShouldHideParentObject)
60 owner.ClearFlags(EntityFlags.VISIBLE,
false);
61 if (parent && m_bShouldHideParentParentObject)
63 parent.ClearFlags(EntityFlags.VISIBLE,
false);
73 ChimeraCharacter character = ChimeraCharacter.Cast(slot.GetOccupant());
76 m_ParentCharacter = character;
82 IEntity parentParent = parent;
85 ChimeraCharacter character = ChimeraCharacter.Cast(parentParent);
88 m_ParentCharacter = character;
89 m_CharacterAiming = CharacterAimingComponent.Cast(character.FindComponent(CharacterAimingComponent));
93 parentParent = parentParent.GetParent();
102 GetGame().GetWorld().GetCurrentCamera(m);
112 if (m_bHasIllumination)
120 if (owner && m_bShouldHideParentObject)
122 owner.SetFlags(EntityFlags.VISIBLE,
true);
123 IEntity parent = owner.GetParent();
124 if (parent && m_bShouldHideParentParentObject)
126 parent.SetFlags(EntityFlags.VISIBLE,
true);
130 if (m_bShouldHideParentCharacter && m_ParentCharacter)
132 m_ParentCharacter.SetFlags(EntityFlags.VISIBLE,
false);
135 m_ParentCharacter =
null;
137 super.OnSightADSDeactivated();
143 if (m_bHasIllumination)
156 vector weaponAnglesMat[3];
157 Math3D.AnglesToMatrix(aimModAngles, weaponAnglesMat);
158 Math3D.MatrixMultiply3(pOutCameraTransform, weaponAnglesMat, pOutCameraTransform);
168 if (m_ParentCharacter)
170 AimingComponent aimingComponent;
182 vector aimingTranslation = aimingComponent.GetRawAimingTranslation();
183 float zAmount = aimingTranslation[2];
194 super.OnSightADSPostFrame(owner, timeSlice);
215 int zoomCount = zooms.Count();
217 for (
int i = 0; i < zoomCount; i++)
220 float zoom = zooms[i];
221 float fov = CalculateZoomFOV(zoom);
225 float initalZoom = zooms[0];
230 m_aReticleSizes.Insert(m_fDefaultSize);
236 float zoomProgress = zooms[i] / initalZoom;
237 float size = m_fDefaultSize * zoomProgress;
238 m_aReticleSizes.Insert(size);
264 m_fCurrentReticleSize = m_aReticleSizes[id];
276 SCR_ChimeraCharacter pParentCharacter =
null;
277 IEntity parent =
null;
281 parent = owner.GetParent();
283 IEntity parentParent = parent;
286 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(parentParent);
289 pParentCharacter = character;
293 parentParent = parentParent.GetParent();
298 if (value > 0 && m_iSelectedZoomLevel <
m_SightsFovInfo.GetStepsCount())
300 m_iSelectedZoomLevel++;
303 if (parent && pParentCharacter)
304 pParentCharacter.SetNewZoomLevel(m_iSelectedZoomLevel,
true, Replication.FindId(parent.FindComponent(WeaponComponent)));
308 if (value < 0 && m_iSelectedZoomLevel > 0)
310 m_iSelectedZoomLevel--;
313 if (parent && pParentCharacter)
314 pParentCharacter.SetNewZoomLevel(m_iSelectedZoomLevel,
false, Replication.FindId(parent.FindComponent(WeaponComponent)));
322 m_bIsIlluminationOn = !m_bIsIlluminationOn;
323 EnableReticleIllumination(m_bIsIlluminationOn);
330 IEntity parent = owner.GetParent();
331 SCR_ChimeraCharacter pParentCharacter =
null;
332 IEntity parentParent = parent;
335 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(parentParent);
338 pParentCharacter = character;
342 parentParent = parentParent.GetParent();
345 if (pParentCharacter)
347 pParentCharacter.SetIllumination(m_bIsIlluminationOn, Replication.FindId(WeaponComponent.Cast(parent.FindComponent(WeaponComponent))));
355 if (m_eZeroingType == SCR_EPIPZeroingType.EPZ_RETICLE_OFFSET)
358 return m_fReticleOffsetY;