DayZ 1.24
Loading...
Searching...
No Matches
StarlightOptic Class Reference
Inheritance diagram for StarlightOptic:
[legend]
Collaboration diagram for StarlightOptic:
[legend]

Private Member Functions

override void InitOpticMode ()
 
override int GetCurrentNVType ()
 
override void OnOpticModeChange ()
 
override void OnOpticEnter ()
 
override void UpdateSelectionVisibility ()
 
override void SetActions ()
 
- Private Member Functions inherited from ItemOptics
void SetPlayer (PlayerBase player)
 
PlayerBase GetPlayer ()
 

Additional Inherited Members

- Private Attributes inherited from ItemOptics
PlayerBase m_Player
 

Detailed Description

Definition at line 83 of file Optics.c.

Member Function Documentation

◆ GetCurrentNVType()

override int StarlightOptic::GetCurrentNVType ( )
inlineprivate

Definition at line 92 of file Optics.c.

93 {
94 if (IsWorking())
95 {
96 switch (m_CurrentOpticMode)
97 {
99 return NVTypes.NV_OPTICS_STARLIGHT_DAY;
100
102 return NVTypes.NV_OPTICS_STARLIGHT_NIGHT;
103 }
104 Error("Undefined optic mode of " + this);
105 return NVTypes.NONE;
106 }
107 else
108 return NVTypes.NV_OPTICS_OFF;
109 }
bool IsWorking()
Definition ItemOptics.c:188
int m_CurrentOpticMode
Definition ItemOptics.c:7
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
const int OPTICS_STATE_DAY
Definition constants.c:800
const int OPTICS_STATE_NIGHTVISION
Definition constants.c:801

References Error(), ItemOptics::IsWorking(), ItemOptics::m_CurrentOpticMode, GameConstants::OPTICS_STATE_DAY, and GameConstants::OPTICS_STATE_NIGHTVISION.

◆ InitOpticMode()

override void StarlightOptic::InitOpticMode ( )
inlineprivate

Definition at line 85 of file Optics.c.

86 {
87 super.InitOpticMode();
88
90 }
void SetCurrentOpticMode(int mode)
Definition ItemOptics.c:427

References GameConstants::OPTICS_STATE_NIGHTVISION, and ItemOptics::SetCurrentOpticMode().

◆ OnOpticEnter()

override void StarlightOptic::OnOpticEnter ( )
inlineprivate

Definition at line 118 of file Optics.c.

119 {
120 super.OnOpticEnter();
121
122 HideSelection("hide_cover_pilot");
123 }
override void HideSelection(string selection_name)

References ItemOptics::HideSelection().

◆ OnOpticModeChange()

override void StarlightOptic::OnOpticModeChange ( )
inlineprivate

Definition at line 111 of file Optics.c.

112 {
113 super.OnOpticModeChange();
114
116 }
override void UpdateSelectionVisibility()
Definition Optics.c:125

References UpdateSelectionVisibility().

◆ SetActions()

override void StarlightOptic::SetActions ( )
inlineprivate

Definition at line 144 of file Optics.c.

145 {
146 super.SetActions();
147
149 }
void AddAction(typename actionName)

References AddAction().

◆ UpdateSelectionVisibility()

override void StarlightOptic::UpdateSelectionVisibility ( )
inlineprivate

Definition at line 125 of file Optics.c.

126 {
127 super.UpdateSelectionVisibility();
128
129 switch (GetCurrentOpticMode())
130 {
132 HideSelection("hide_cover");
133 HideSelection("hide_cover_pilot");
134 break;
135
137 ShowSelection("hide_cover");
138 if (!GetGame().IsDedicatedServer() && !IsInOptics()) //quick sanity check, just in case
139 ShowSelection("hide_cover_pilot");
140 break;
141 }
142 }
int GetCurrentOpticMode()
Definition ItemOptics.c:433
proto native bool IsInOptics()
is weapon in optics mode or not
override void ShowSelection(string selection_name)
proto native CGame GetGame()

References ItemOptics::GetCurrentOpticMode(), GetGame(), ItemOptics::HideSelection(), ItemOptics::IsInOptics(), GameConstants::OPTICS_STATE_DAY, GameConstants::OPTICS_STATE_NIGHTVISION, and ItemOptics::ShowSelection().

Referenced by OnOpticModeChange().


The documentation for this class was generated from the following file: