Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CollimatorSightsComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
5
8{
9 [Attribute("1 1 1", UIWidgets.ColorPicker, desc: "Reticle Color", category: "Reticle")]
10 vector m_vReticleColor;
11 [Attribute("1 1 1", UIWidgets.ColorPicker, desc: "Reticle Glow Color", category: "Reticle")]
12 vector m_vGlowColor;
13};
14
16{
17 // For the Input manager
18 const string ACTION_ILLUMINATION = "WeaponToggleSightsIllumination";
19
20 // Attributes
21 [Attribute("9", UIWidgets.Slider, "Reticle Daylight Brightness", params: "0 15 0.1", category: "Collimator")]
22 protected float m_fDaylightBrightness;
23
24 [Attribute("2", UIWidgets.Slider, "Reticle Night Brightness", params: "0 15 0.1", category: "Collimator")]
25 protected float m_fNightBrightness;
26
27 //------------------------------------------------------------------------------------------------
29 bool m_bReticleDaylight = true;
30 int m_iColorIndex = -1;
31 //------------------------------------------------------------------------------------------------
32 override float GetReticleBrightnessDay()
33 {
35 }
36
38 {
39 return m_fNightBrightness;
40 }
41 //------------------------------------------------------------------------------------------------
42 override void OnPostInit(IEntity owner)
43 {
46 {
47 Print("Warning: No Collimator Controller on this sight", LogLevel.WARNING);
48 }
49
51 {
52 m_managerComponent.SetReticleBrightness(m_fDaylightBrightness);
53 }
54 }
55
56 override void OnSightADSActivate()
57 {
58 GetGame().GetInputManager().AddActionListener(ACTION_ILLUMINATION, EActionTrigger.DOWN, ToggleIllumination);
59 }
60
61 override void OnSightADSDeactivated()
62 {
63 GetGame().GetInputManager().RemoveActionListener(ACTION_ILLUMINATION, EActionTrigger.DOWN, ToggleIllumination);
64 }
65
66 //------------------------------------------------------------------------------------------------
67
68 protected void ToggleIllumination(float value, EActionTrigger trigger)
69 {
71 }
72
73 //------------------------------------------------------------------------------------------------
74
76 {
78
80 {
82 m_managerComponent.SetReticleBrightness(m_fDaylightBrightness);
83 else
84 m_managerComponent.SetReticleBrightness(m_fNightBrightness);
85 }
86 }
87
88 //------------------------------------------------------------------------------------------------
89 override void UpdateReticlePosition(float u, float v, float uScale, float vScale)
90 {
92 m_managerComponent.UpdateUVCoordinates(u, v, uScale, vScale);
93 }
94
95 override void UpdateReticleShapeIndex(int index)
96 {
98 m_managerComponent.SetReticleIndex(index);
99 }
100
101 override void UpdateReticleColor(vector inner, vector glow)
102 {
103 if (m_managerComponent && inner && glow)
104 m_managerComponent.SetReticleColors(inner, glow);
105 }
106
108 {
110 m_managerComponent.SetReticleBrightnessScale(scale);
111 }
112
113 override void UpdateReticleBrightness(float lvFactor, bool useOwn)
114 {
116 {
117 if (useOwn)
118 {
120 m_managerComponent.SetReticleBrightness(m_fDaylightBrightness);
121 else
122 m_managerComponent.SetReticleBrightness(m_fNightBrightness);
123 }
124 else
125 m_managerComponent.SetReticleBrightness(lvFactor);
126 }
127 }
128};
vector scale
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
override void UpdateReticleColor(vector inner, vector glow)
SCR_CollimatorControllerComponent m_managerComponent
override void UpdateReticleBrightness(float lvFactor, bool useOwn)
override void UpdateReticleBrightnessScale(float scale)
void ToggleIllumination(float value, EActionTrigger trigger)
override void UpdateReticlePosition(float u, float v, float uScale, float vScale)
override void UpdateReticleShapeIndex(int index)
override void OnPostInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
EActionTrigger