10 vector m_vReticleColor;
18 const string ACTION_ILLUMINATION =
"WeaponToggleSightsIllumination";
22 protected float m_fDaylightBrightness;
25 protected float m_fNightBrightness;
44 bool m_bReticleDaylight =
true;
45 int m_iColorIndex = -1;
48 override void OnPostInit(IEntity owner)
51 if (!m_managerComponent)
53 Print(
"Warning: No Collimator Controller on this sight", LogLevel.WARNING);
56 if (m_managerComponent)
58 m_managerComponent.SetReticleBrightness(m_fDaylightBrightness);
63 override void OnSightADSActivate()
65 GetGame().GetInputManager().AddActionListener(ACTION_ILLUMINATION, EActionTrigger.DOWN, ToggleIllumination);
68 override void OnSightADSDeactivated()
70 GetGame().GetInputManager().RemoveActionListener(ACTION_ILLUMINATION, EActionTrigger.DOWN, ToggleIllumination);
75 protected void ToggleIllumination(
float value, EActionTrigger trigger)
77 ReticleToggleIllumination();
82 void ReticleToggleIllumination()
84 m_bReticleDaylight = !m_bReticleDaylight;
86 if (m_managerComponent)
88 if (m_bReticleDaylight)
89 m_managerComponent.SetReticleBrightness(m_fDaylightBrightness);
91 m_managerComponent.SetReticleBrightness(m_fNightBrightness);
96 override void UpdateReticlePosition(
float u,
float v,
float uScale,
float vScale)
98 if (m_managerComponent)
99 m_managerComponent.UpdateUVCoordinates(u, v, uScale, vScale);
102 override void UpdateReticleShapeIndex(
int index)
104 if (m_managerComponent)
105 m_managerComponent.SetReticleIndex(
index);
108 override void UpdateReticleColor(vector inner, vector glow)
110 if (m_managerComponent && inner && glow)
111 m_managerComponent.SetReticleColors(inner, glow);