Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ItemOptics
+ Граф наследования:ItemOptics:

Защищенные члены

void SetPlayer (PlayerBase player)
 
PlayerBase GetPlayer ()
 

Защищенные данные

PlayerBase m_Player
 

Закрытые члены

void ItemOptics ()
 
proto native bool EnterOptics ()
 switches to optics mode if possible
 
proto native bool IsInOptics ()
 is weapon in optics mode or not
 
proto native bool ExitOptics ()
 switches out of optics mode (if possible)
 
proto native bool HasWeaponIronsightsOverride ()
 is weapon in optics mode or not
 
proto native bool UseWeaponIronsightsOverride (bool state)
 switches into ironsights override settings
 
proto native bool IsUsingWeaponIronsightsOverride ()
 is optics using ironsights override settings or not
 
proto native int GetStepFOVCount ()
 returns number of configured steps
 
proto native int GetStepFOVIndex ()
 returns index of currently used value in 'discretefov' config array
 
proto native bool SetStepFOVIndex (int step)
 sets zoom to fov value defined at given in 'discretefov' config array
 
proto native bool StepFOVUp ()
 sets zoom to next defined (respective to current) value in zoom fov config array
 
proto native bool StepFOVDown ()
 sets zoom to previous (respective to current) defined value in zoom fov config array
 
proto native float GetCurrentStepFOV ()
 returns fov value at current index, or 'OpticsInfo.opticsZoomInit' config value (non-zooming optics)
 
proto native int GetStepZeroing ()
 returns position of currently used value in zeroing config array
 
proto native bool SetStepZeroing (int step)
 
proto native bool StepZeroingUp ()
 sets zeroing to next defined (respective to current) value in zeroing config array
 
proto native bool StepZeroingDown ()
 sets zeroing to previous (respective to current) defined value in zeroing config array
 
proto native void GetCameraPoint (out vector pos, out vector dir)
 gets camera position & direction in model space of optics entity
 
proto native float GetZoomInit ()
 gets FOV value, when entering optics
 
proto native float GetZoomMin ()
 gets FOV minimum
 
proto native float GetZoomMax ()
 gets FOV maximum
 
proto native float GetZeroingDistanceZoomMin ()
 Gets Zeroing distance at opticsZoomMin.
 
proto native float GetZeroingDistanceZoomMax ()
 Gets Zeroing distance at opticsZoomMax.
 
proto native void SetZeroingClampDist (float dist)
 Sets zeroing clamp for the optics and updates the clamp if dist > 0. Used when attached to weapon.
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
bool IsWorking ()
 
void UpdateOpticsReddotVisibility ()
 
override void OnWasAttached (EntityAI parent, int slot_id)
 
override void OnWasDetached (EntityAI parent, int slot_id)
 
override void OnInventoryExit (Man player)
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void OnVariablesSynchronized ()
 
void InitReddotData ()
 
void ShowReddot (bool state)
 
void InitOpticsPPInfo ()
 
bool InitDOFAvailability ()
 optics with more than 1x zoom do not allow DOF changes
 
void InitOpticsPP (out array< float > mask_array, out array< float > lens_array, out float blur_float)
 initializes values for optics' post-processes
 
void InitCameraOverrideProperties ()
 
bool InitOpticsDOFProperties (out array< float > temp_array)
 Initializes DOF properties for optic's alternate ironsights (ACOG etc.)
 
bool AllowsDOF ()
 returns 'true' for non-magnifying optics
 
bool IsNVOptic ()
 
int GetCurrentNVType ()
 
void SetCurrentOpticMode (int mode)
 
int GetCurrentOpticMode ()
 
void OnOpticModeChange ()
 optic-specific behaviour to be defined here (override)
 
void OnOpticEnter ()
 
void OnOpticExit ()
 
ref array< floatGetOpticsDOF ()
 
ref array< floatGetOpticsPPMask ()
 
ref array< floatGetOpticsPPLens ()
 
float GetOpticsPPBlur ()
 
float GetNearPlaneValue ()
 
void Init2DPreloadType ()
 
void InitOpticMode ()
 
void UpdateSelectionVisibility ()
 
override void SetActions ()
 
override void OnDebugSpawn ()
 
override bool CanPutAsAttachment (EntityAI parent)
 
override bool CanPutAsAttachment (EntityAI parent)
 
void HuntingOptic ()
 
override void OnWasAttached (EntityAI parent, int slot_id)
 
override void OnWasDetached (EntityAI parent, int slot_id)
 
override void HideSelection (string selection_name)
 
override void ShowSelection (string selection_name)
 
bool ParentUsesWinchesterTypeMount ()
 
override bool CanPutAsAttachment (EntityAI parent)
 

Закрытые данные

bool m_data_set
 
bool m_allowsDOF
 
bool m_reddot_displayed bool m_isNVOptic = false
 
int m_CurrentOpticMode
 
int m_CurrentOpticModeLocal
 
int m_reddot_index
 
float m_blur_float
 
float m_nearplane_override
 
string m_optic_sight_texture
 
string m_optic_sight_material
 
string m_2D_preload_type
 
ref array< floatm_mask_array
 
ref array< floatm_lens_array
 
ref array< floatm_OpticsDOFProperties
 
EntityAI m_Parent
 

Подробное описание

Конструктор(ы)

◆ ItemOptics()

void ItemOptics ( )
inlineprivate
20 {
24
31
33 RegisterNetSyncVariableInt( "m_CurrentOpticMode", 0, 63 );
34 }
void InitReddotData()
Definition ItemOptics.c:298
ref array< float > m_mask_array
Definition ItemOptics.c:15
bool InitOpticsDOFProperties(out array< float > temp_array)
Initializes DOF properties for optic's alternate ironsights (ACOG etc.)
Definition ItemOptics.c:406
void InitOpticMode()
Definition ItemOptics.c:517
ref array< float > m_OpticsDOFProperties
Definition ItemOptics.c:17
void Init2DPreloadType()
Definition ItemOptics.c:505
int m_CurrentOpticModeLocal
Definition ItemOptics.c:8
ref array< float > m_lens_array
Definition ItemOptics.c:16
void InitCameraOverrideProperties()
Definition ItemOptics.c:392
void InitOpticsPPInfo()
Definition ItemOptics.c:356
Definition EntityAI.c:95

Перекрестные ссылки Init2DPreloadType(), InitCameraOverrideProperties(), InitOpticMode(), InitOpticsDOFProperties(), InitOpticsPPInfo(), InitReddotData(), m_CurrentOpticModeLocal, m_lens_array, m_mask_array и m_OpticsDOFProperties.

Методы

◆ AllowsDOF()

bool AllowsDOF ( )
inlineprivate

returns 'true' for non-magnifying optics

423 {
424 return m_allowsDOF;
425 }
bool m_allowsDOF
Definition ItemOptics.c:4

Перекрестные ссылки m_allowsDOF.

Используется в SetCameraPP().

◆ CanPutAsAttachment() [1/3]

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate
34 {
35 return true;
36 }

◆ CanPutAsAttachment() [2/3]

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate
4 {
5 if(!super.CanPutAsAttachment(parent)) {return false;}
6 if ( parent.IsKindOf("M4A1_Base") )
7 {
8 return true;
9 }
10
11 return false;
12 //return true;
13 }

◆ CanPutAsAttachment() [3/3]

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate
4 {
5 if(!super.CanPutAsAttachment(parent)) {return false;}
6 if ( parent.IsKindOf("M4A1_Base") )
7 {
8 return true;
9 }
10
11 return false;
12 }

◆ EnterOptics()

EnterOptics ( )
private

switches to optics mode if possible

Возвращает
true if success, false otherwise

◆ ExitOptics()

ExitOptics ( )
private

switches out of optics mode (if possible)

Возвращает
true if success, false otherwise

◆ GetCameraPoint()

GetCameraPoint ( out vector pos,
out vector dir )
private

gets camera position & direction in model space of optics entity

Используется в DayZPlayerCameraBase::GetCurrentSightInfo() и GetCurrentSightInfo().

◆ GetCurrentNVType()

int GetCurrentNVType ( )
inlineprivate
433 {
434 /*
435 //TODO - implement this into NV optics and modify (KazuarOptic example below)
436 if (IsWorking())
437 {
438 switch (m_CurrentOpticMode)
439 {
440 case GameConstants.OPTICS_STATE_DAY:
441 return NVTypes.NV_OPTICS_KAZUAR_DAY;
442
443 case GameConstants.OPTICS_STATE_NIGHTVISION:
444 return NVTypes.NV_OPTICS_KAZUAR_NIGHT;
445 }
446 }
447 else
448 {
449 return NVTypes.NV_OPTICS_OFF;
450 }
451 */
452 return NVTypes.NONE;
453 }
NVTypes
Definition DayZPlayerCamera_Base.c:55

Используется в SetCameraPP().

◆ GetCurrentOpticMode()

int GetCurrentOpticMode ( )
inlineprivate
462 {
463 return m_CurrentOpticMode;
464 }
int m_CurrentOpticMode
Definition ItemOptics.c:7

Перекрестные ссылки m_CurrentOpticMode.

Используется в KazuarOptic::UpdateSelectionVisibility() и StarlightOptic::UpdateSelectionVisibility().

◆ GetCurrentStepFOV()

GetCurrentStepFOV ( )
private

returns fov value at current index, or 'OpticsInfo.opticsZoomInit' config value (non-zooming optics)

◆ GetNearPlaneValue()

float GetNearPlaneValue ( )
inlineprivate
501 {
503 }
float m_nearplane_override
Definition ItemOptics.c:11

Перекрестные ссылки m_nearplane_override.

Используется в AdjustCameraParameters().

◆ GetOpticsDOF()

ref array< float > GetOpticsDOF ( )
inlineprivate
484 {
486 }

Перекрестные ссылки m_OpticsDOFProperties.

Используется в DayZPlayerCameraBase::SetCameraPP() и SetCameraPP().

◆ GetOpticsPPBlur()

float GetOpticsPPBlur ( )
inlineprivate
496 {
497 return m_blur_float;
498 }
float m_blur_float
Definition ItemOptics.c:10

Перекрестные ссылки m_blur_float.

Используется в SetCameraPP().

◆ GetOpticsPPLens()

ref array< float > GetOpticsPPLens ( )
inlineprivate
492 {
493 return m_lens_array;
494 }

Перекрестные ссылки m_lens_array.

Используется в SetCameraPP().

◆ GetOpticsPPMask()

ref array< float > GetOpticsPPMask ( )
inlineprivate
488 {
489 return m_mask_array;
490 }

Перекрестные ссылки m_mask_array.

Используется в SetCameraPP().

◆ GetPlayer()

PlayerBase GetPlayer ( )
inlineprotected
11 {
12 return m_Player;
13 }
PlayerBase m_Player
Definition PoweredOptic_Base.c:3

Перекрестные ссылки m_Player.

◆ GetStepFOVCount()

GetStepFOVCount ( )
private

returns number of configured steps

◆ GetStepFOVIndex()

GetStepFOVIndex ( )
private

returns index of currently used value in 'discretefov' config array

Возвращает
index of currently used value in 'discretefov' config array

◆ GetStepZeroing()

GetStepZeroing ( )
private

returns position of currently used value in zeroing config array

Возвращает
position of currently used value in zeroing config array

◆ GetZeroingDistanceZoomMax()

GetZeroingDistanceZoomMax ( )
private

Gets Zeroing distance at opticsZoomMax.

◆ GetZeroingDistanceZoomMin()

GetZeroingDistanceZoomMin ( )
private

Gets Zeroing distance at opticsZoomMin.

◆ GetZoomInit()

GetZoomInit ( )
private

gets FOV value, when entering optics

◆ GetZoomMax()

GetZoomMax ( )
private

gets FOV maximum

◆ GetZoomMin()

GetZoomMin ( )
private

gets FOV minimum

◆ HasWeaponIronsightsOverride()

HasWeaponIronsightsOverride ( )
private

is weapon in optics mode or not

Возвращает
true if optics has defined override optics info for weapon

Используется в DayZPlayerCameraBase::SetupSightEntities().

◆ HideSelection()

override void HideSelection ( string selection_name)
inlineprivate
35 {
36 super.HideSelection( selection_name );
37 if (selection_name == "hide") //hides pilotview selections in order not to obstruct view
38 {
39 HideSelection("rings_ris_pilot");
40 HideSelection("rings_winchester_pilot");
41 }
42 }
override void HideSelection(string selection_name)
Definition HuntingOptic.c:34

Перекрестные ссылки HideSelection().

Используется в HideSelection(), HuntingOptic(), OnOpticEnter(), KazuarOptic::OnOpticEnter(), StarlightOptic::OnOpticEnter(), OnWasAttached(), OnWasDetached(), ShowSelection(), KazuarOptic::UpdateSelectionVisibility() и StarlightOptic::UpdateSelectionVisibility().

◆ HuntingOptic()

void HuntingOptic ( )
inlineprivate
6 {
7 HideSelection("rings_ris");
8 HideSelection("rings_ris_pilot");
9 }

Перекрестные ссылки HideSelection().

◆ Init2DPreloadType()

void Init2DPreloadType ( )
inlineprivate
506 {
507 string path = "cfgVehicles " + GetType() + " OpticsInfo preloadOpticType";
508 string type_2d;
509
510 if ( GetGame().ConfigIsExisting(path) )
511 {
512 GetGame().ConfigGetText(path, type_2d);
514 }
515 }
eBleedingSourceType GetType()
Definition BleedingSource.c:63
string path
Definition OptionSelectorMultistate.c:135
string m_2D_preload_type
Definition ItemOptics.c:14
proto native CGame GetGame()

Перекрестные ссылки GetGame(), GetType(), m_2D_preload_type и path.

Используется в ItemOptics().

◆ InitCameraOverrideProperties()

void InitCameraOverrideProperties ( )
inlineprivate
393 {
394 string path = "cfgVehicles " + GetType() + " OpticsInfo";
395 if ( GetGame().ConfigIsExisting(path + " nearPlaneDistanceOverride") )
396 {
397 m_nearplane_override = Math.Max(GetGame().ConfigGetFloat(path + " nearPlaneDistanceOverride"),DayZPlayerCameraBase.CONST_NEARPLANE_OPTICS_MIN);
398 }
399 else
400 {
401 m_nearplane_override = DayZPlayerCameraOptics.CONST_NEARPLANE_OPTICS;
402 }
403 }
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
Definition DayZPlayerCameraIronsights.c:365
this is main camera class
Definition DayZPlayerCamera1stPerson.c:5
Definition EnMath.c:7
static proto float Max(float x, float y)
Returns bigger of two given values.

Перекрестные ссылки DayZPlayerCameraOptics(), GetGame(), GetType(), m_nearplane_override, Math::Max() и path.

Используется в ItemOptics().

◆ InitDOFAvailability()

bool InitDOFAvailability ( )
inlineprivate

optics with more than 1x zoom do not allow DOF changes

366 {
367 float fov_max;
368 string path = "cfgVehicles " + GetType() + " OpticsInfo";
369
370 /*
371 Weapon_Base weapon = Weapon_Base.Cast(GetHierarchyParent());
372 if (!weapon)
373 return false; // no DOF for handheld optics
374 */
375 fov_max = GetGame().ConfigGetFloat(path + " opticsZoomMax");
377 {
378 return true;
379 }
380 return false;
381 }
Definition constants.c:615
const float DZPLAYER_CAMERA_FOV_IRONSIGHTS
Definition constants.c:839

Перекрестные ссылки GameConstants::DZPLAYER_CAMERA_FOV_IRONSIGHTS, GetGame(), GetType() и path.

Используется в InitOpticsPPInfo().

◆ InitOpticMode()

void InitOpticMode ( )
inlineprivate
518 {
520 }
void SetCurrentOpticMode(int mode)
Definition ItemOptics.c:455
const int OPTICS_STATE_DAY
Definition constants.c:803

Перекрестные ссылки GameConstants::OPTICS_STATE_DAY и SetCurrentOpticMode().

Используется в ItemOptics().

◆ InitOpticsDOFProperties()

bool InitOpticsDOFProperties ( out array< float > temp_array)
inlineprivate

Initializes DOF properties for optic's alternate ironsights (ACOG etc.)

407 {
408 if (GetGame().ConfigIsExisting("cfgVehicles " + GetType() + " OpticsInfo PPDOFProperties"))
409 {
410 GetGame().ConfigGetFloatArray("cfgVehicles " + GetType() + " OpticsInfo PPDOFProperties", temp_array);
411 return true;
412 }
413 else if (GetGame().ConfigIsExisting("cfgVehicles " + GetType() + " OpticsInfoWeaponOverride PPDOFProperties"))
414 {
415 GetGame().ConfigGetFloatArray("cfgVehicles " + GetType() + " OpticsInfoWeaponOverride PPDOFProperties", temp_array);
416 return true;
417 }
418 return false;
419 }

Перекрестные ссылки GetGame() и GetType().

Используется в ItemOptics().

◆ InitOpticsPP()

void InitOpticsPP ( out array< float > mask_array,
out array< float > lens_array,
out float blur_float )
inlineprivate

initializes values for optics' post-processes

385 {
386 string path = "cfgVehicles " + GetType() + " OpticsInfo";
387 GetGame().ConfigGetFloatArray(path + " PPMaskProperties", mask_array);
388 GetGame().ConfigGetFloatArray(path + " PPLensProperties", lens_array);
389 blur_float = GetGame().ConfigGetFloat(path + " PPBlurProperties");
390 }

Перекрестные ссылки GetGame(), GetType() и path.

Используется в InitOpticsPPInfo().

◆ InitOpticsPPInfo()

void InitOpticsPPInfo ( )
inlineprivate
357 {
360
361 m_isNVOptic = ConfigGetBool("NVOptic");
362 }
void InitOpticsPP(out array< float > mask_array, out array< float > lens_array, out float blur_float)
initializes values for optics' post-processes
Definition ItemOptics.c:384
bool InitDOFAvailability()
optics with more than 1x zoom do not allow DOF changes
Definition ItemOptics.c:365
bool m_reddot_displayed bool m_isNVOptic
Definition ItemOptics.c:6

Перекрестные ссылки InitDOFAvailability(), InitOpticsPP(), m_allowsDOF, m_blur_float, m_isNVOptic, m_lens_array и m_mask_array.

Используется в ItemOptics().

◆ InitReddotData()

void InitReddotData ( )
inlineprivate
299 {
300 string path = "cfgVehicles " + GetType() + " OpticsInfo";
301 string temp;
302
303 if (GetGame().ConfigIsExisting(path))
304 {
305 m_reddot_index = GetHiddenSelectionIndex("reddot");
306 if (GetGame().ConfigIsExisting(path + " opticSightTexture"))
307 {
308 GetGame().ConfigGetText(path + " opticSightTexture", temp);
310 temp = "";
311 }
312 if (GetGame().ConfigIsExisting(path + " opticSightMaterial"))
313 {
314 GetGame().ConfigGetText(path + " opticSightMaterial", temp);
316 temp = "";
317 }
318 }
319 m_data_set = true;
320 }
bool m_data_set
Definition ItemOptics.c:3
string m_optic_sight_material
Definition ItemOptics.c:13
string m_optic_sight_texture
Definition ItemOptics.c:12
int m_reddot_index
Definition ItemOptics.c:9

Перекрестные ссылки GetGame(), GetType(), m_data_set, m_optic_sight_material, m_optic_sight_texture, m_reddot_index и path.

Используется в ItemOptics() и ShowReddot().

◆ IsInOptics()

IsInOptics ( )
private

is weapon in optics mode or not

Возвращает
true if in optics mode, false otherwise

Используется в KazuarOptic::UpdateSelectionVisibility() и StarlightOptic::UpdateSelectionVisibility().

◆ IsNVOptic()

bool IsNVOptic ( )
inlineprivate
428 {
429 return m_isNVOptic;
430 }

Перекрестные ссылки m_isNVOptic.

Используется в Init() и SetCameraPP().

◆ IsUsingWeaponIronsightsOverride()

IsUsingWeaponIronsightsOverride ( )
private

is optics using ironsights override settings or not

Возвращает
true if optics is using ironsights override settings

◆ IsWorking()

bool IsWorking ( )
inlineprivate
193 {
194 if (GetCompEM() && GetCompEM().CanWork())
195 return true;
196 return false;
197 }

Используется в KazuarOptic::GetCurrentNVType(), StarlightOptic::GetCurrentNVType(), Init() и UpdateOpticsReddotVisibility().

◆ OnDebugSpawn()

override void OnDebugSpawn ( )
inlineprivate
532 {
533 GetInventory().CreateAttachment("Battery9V");
534 }

◆ OnInventoryExit()

override void OnInventoryExit ( Man player)
inlineprivate
244 {
245 super.OnInventoryExit(player);
246
248 if (PlayerBase.CastTo(playerPB, player))
249 {
250 playerPB.SetReturnToOptics(false);
251 }
252
253 SetTakeable(true);
254 }
override void SetTakeable(bool pState)
Definition ItemBase.c:8971
Definition PlayerBaseClient.c:2

Перекрестные ссылки SetTakeable().

◆ OnOpticEnter()

void OnOpticEnter ( )
inlineprivate
469 {
470 if ( GetGame() && !GetGame().IsDedicatedServer() )
471 {
472 HideSelection("hide");
473 }
474 }

Перекрестные ссылки GetGame() и HideSelection().

◆ OnOpticExit()

void OnOpticExit ( )
inlineprivate
476 {
477 if ( GetGame() && !GetGame().IsDedicatedServer() )
478 {
479 ShowSelection("hide");
480 }
481 }
override void ShowSelection(string selection_name)
Definition HuntingOptic.c:44

Перекрестные ссылки GetGame() и ShowSelection().

◆ OnOpticModeChange()

void OnOpticModeChange ( )
inlineprivate

optic-specific behaviour to be defined here (override)

467{}

Используется в OnStoreLoad(), OnVariablesSynchronized() и SetCurrentOpticMode().

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprivate
264 {
265 if ( !super.OnStoreLoad(ctx,version) )
266 {
267 return false;
268 }
269 m_IsStoreLoad = true;
270
271 if ( version >= 126 )
272 {
273 if ( !ctx.Read(m_CurrentOpticMode) )
274 {
275 m_IsStoreLoad = false;
276 return false;
277 }
278 }
279
281 SetSynchDirty();
282
283 m_IsStoreLoad = false;
284 return true;
285 }
bool m_IsStoreLoad
Definition ItemBase.c:4776
void OnOpticModeChange()
optic-specific behaviour to be defined here (override)
Definition ItemOptics.c:467

Перекрестные ссылки m_CurrentOpticMode, m_IsStoreLoad и OnOpticModeChange().

◆ OnStoreSave()

override void OnStoreSave ( ParamsWriteContext ctx)
inlineprivate
257 {
258 super.OnStoreSave(ctx);
259
260 ctx.Write(m_CurrentOpticMode);
261 }

Перекрестные ссылки m_CurrentOpticMode.

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
inlineprivate
288 {
289 super.OnVariablesSynchronized();
290
292 {
295 }
296 }

Перекрестные ссылки m_CurrentOpticMode, m_CurrentOpticModeLocal и OnOpticModeChange().

◆ OnWasAttached() [1/2]

override void OnWasAttached ( EntityAI parent,
int slot_id )
inlineprivate
212 {
213 super.OnWasAttached(parent, slot_id);
214
215 SetTakeable(false);
216
217 Weapon wep;
218 if (Class.CastTo(wep,parent))
219 {
220 SetZeroingClampDist(wep.GetZeroingClamp(wep.GetCurrentMuzzle()));
221 }
222 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
proto native void SetZeroingClampDist(float dist)
Sets zeroing clamp for the optics and updates the clamp if dist > 0. Used when attached to weapon.
script counterpart to engine's class Weapon
Definition InventoryItem.c:49
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), SetTakeable() и SetZeroingClampDist().

◆ OnWasAttached() [2/2]

override void OnWasAttached ( EntityAI parent,
int slot_id )
inlineprivate
12 {
13 super.OnWasAttached(parent, slot_id);
14 m_Parent = parent;
16 {
17 HideSelection("rings_winchester");
18 HideSelection("rings_winchester_pilot");
19 ShowSelection("rings_ris");
20 ShowSelection("rings_ris_pilot");
21 }
22 }
bool ParentUsesWinchesterTypeMount()
Definition HuntingOptic.c:66
EntityAI m_Parent
Definition HuntingOptic.c:3

Перекрестные ссылки HideSelection(), m_Parent, ParentUsesWinchesterTypeMount() и ShowSelection().

◆ OnWasDetached() [1/2]

override void OnWasDetached ( EntityAI parent,
int slot_id )
inlineprivate
225 {
226 super.OnWasDetached(parent, slot_id);
227
229 if (PlayerBase.CastTo(player, GetHierarchyRootPlayer()))
230 {
231 player.SetReturnToOptics(false);
232 }
233
234 SetTakeable(true);
235
236 Weapon wep;
237 if (Class.CastTo(wep,parent))
238 {
240 }
241 }

Перекрестные ссылки Class::CastTo(), SetTakeable() и SetZeroingClampDist().

◆ OnWasDetached() [2/2]

override void OnWasDetached ( EntityAI parent,
int slot_id )
inlineprivate
25 {
26 super.OnWasDetached(parent, slot_id);
27 m_Parent = null;
28 HideSelection("rings_ris");
29 HideSelection("rings_ris_pilot");
30 ShowSelection("rings_winchester");
31 ShowSelection("rings_winchester_pilot");
32 }

Перекрестные ссылки HideSelection(), m_Parent и ShowSelection().

◆ OnWorkStart()

override void OnWorkStart ( )
inlineprivate
177 {
178 if (!GetGame().IsDedicatedServer())
179 {
180 ShowReddot(true);
181 }
182 }
void ShowReddot(bool state)
Definition ItemOptics.c:322

Перекрестные ссылки GetGame() и ShowReddot().

◆ OnWorkStop()

override void OnWorkStop ( )
inlineprivate
185 {
186 if (!GetGame().IsDedicatedServer())
187 {
188 ShowReddot(false);
189 }
190 }

Перекрестные ссылки GetGame() и ShowReddot().

◆ ParentUsesWinchesterTypeMount()

bool ParentUsesWinchesterTypeMount ( )
inlineprivate
67 {
68 if (m_Parent && m_Parent.ConfigIsExisting("winchesterTypeOpticsMount"))
69 return m_Parent.ConfigGetBool("winchesterTypeOpticsMount");
70
71 return false;
72 }

Перекрестные ссылки m_Parent.

Используется в OnWasAttached() и ShowSelection().

◆ SetActions()

override void SetActions ( )
inlineprivate
525 {
526 super.SetActions();
527
529 }
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
Definition ActionViewOptics.c:2

Перекрестные ссылки AddAction().

◆ SetCurrentOpticMode()

void SetCurrentOpticMode ( int mode)
inlineprivate
456 {
459 }

Перекрестные ссылки m_CurrentOpticMode и OnOpticModeChange().

Используется в InitOpticMode(), KazuarOptic::InitOpticMode() и StarlightOptic::InitOpticMode().

◆ SetPlayer()

void SetPlayer ( PlayerBase player)
inlineprotected
6 {
8 }

Перекрестные ссылки m_Player.

◆ SetStepFOVIndex()

SetStepFOVIndex ( int step)
private

sets zoom to fov value defined at given in 'discretefov' config array

Аргументы
[in]indexof configured step, range [0..cfg_max]
Возвращает
true if zoom set

◆ SetStepZeroing()

proto native bool SetStepZeroing ( int step)
private

◆ SetZeroingClampDist()

SetZeroingClampDist ( float dist)
private

Sets zeroing clamp for the optics and updates the clamp if dist > 0. Used when attached to weapon.

Используется в OnWasAttached() и OnWasDetached().

◆ ShowReddot()

void ShowReddot ( bool state)
inlineprivate
323 {
324 if (GetGame().IsDedicatedServer())
325 {
326 ErrorEx("should not be called on the server!",ErrorExSeverity.INFO);
327 return;
328 }
329
330 if (!m_data_set)
331 {
333 }
334
335 // does not have reddot
336 if (m_reddot_index == -1)
337 {
338 return;
339 }
340
341 if (state)
342 {
343 if (m_optic_sight_texture != "")
344 SetObjectTexture(m_reddot_index, m_optic_sight_texture);
345 if (m_optic_sight_material != "")
346 SetObjectMaterial(m_reddot_index, m_optic_sight_material);
347 }
348 else
349 {
350 SetObjectTexture(m_reddot_index, "");
351 SetObjectMaterial(m_reddot_index, "");
352 }
354 }
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx, GetGame(), InitReddotData(), m_data_set, m_optic_sight_material, m_optic_sight_texture и m_reddot_index.

Используется в OnWorkStart(), OnWorkStop() и UpdateOpticsReddotVisibility().

◆ ShowSelection()

override void ShowSelection ( string selection_name)
inlineprivate
45 {
46 super.ShowSelection( selection_name );
47 if (selection_name == "hide")
48 {
50 {
51 HideSelection("rings_winchester");
52 HideSelection("rings_winchester_pilot");
53 ShowSelection("rings_ris");
54 ShowSelection("rings_ris_pilot");
55 }
56 else
57 {
58 HideSelection("rings_ris");
59 HideSelection("rings_ris_pilot");
60 ShowSelection("rings_winchester");
61 ShowSelection("rings_winchester_pilot");
62 }
63 }
64 }

Перекрестные ссылки HideSelection(), ParentUsesWinchesterTypeMount() и ShowSelection().

Используется в OnOpticExit(), OnWasAttached(), OnWasDetached(), ShowSelection(), KazuarOptic::UpdateSelectionVisibility() и StarlightOptic::UpdateSelectionVisibility().

◆ StepFOVDown()

StepFOVDown ( )
private

sets zoom to previous (respective to current) defined value in zoom fov config array

Возвращает
true if zoom set

◆ StepFOVUp()

StepFOVUp ( )
private

sets zoom to next defined (respective to current) value in zoom fov config array

Возвращает
true if zoom set

◆ StepZeroingDown()

StepZeroingDown ( )
private

sets zeroing to previous (respective to current) defined value in zeroing config array

Возвращает
true if zeroing set

◆ StepZeroingUp()

StepZeroingUp ( )
private

sets zeroing to next defined (respective to current) value in zeroing config array

Возвращает
true if zeroing set

◆ UpdateOpticsReddotVisibility()

void UpdateOpticsReddotVisibility ( )
inlineprivate
200 {
202 {
203 ShowReddot(true);
204 }
205 else if (!IsWorking() && m_reddot_displayed)
206 {
207 ShowReddot(false);
208 }
209 }
bool IsWorking()
Definition ItemOptics.c:192

Перекрестные ссылки IsWorking() и ShowReddot().

◆ UpdateSelectionVisibility()

void UpdateSelectionVisibility ( )
inlineprivate
522{}

◆ UseWeaponIronsightsOverride()

UseWeaponIronsightsOverride ( bool state)
private

switches into ironsights override settings

Возвращает
true if switching was successful

Используется в DayZPlayerCameraBase::GetCurrentSightInfo() и GetCurrentSightInfo().

Поля

◆ m_2D_preload_type

string m_2D_preload_type
private

Используется в Init2DPreloadType().

◆ m_allowsDOF

bool m_allowsDOF
private

Используется в AllowsDOF() и InitOpticsPPInfo().

◆ m_blur_float

float m_blur_float
private

Используется в GetOpticsPPBlur() и InitOpticsPPInfo().

◆ m_CurrentOpticMode

◆ m_CurrentOpticModeLocal

int m_CurrentOpticModeLocal
private

Используется в ItemOptics() и OnVariablesSynchronized().

◆ m_data_set

bool m_data_set
private

Используется в InitReddotData() и ShowReddot().

◆ m_isNVOptic

bool m_reddot_displayed bool m_isNVOptic = false
private

Используется в InitOpticsPPInfo() и IsNVOptic().

◆ m_lens_array

ref array<float> m_lens_array
private

Используется в GetOpticsPPLens(), InitOpticsPPInfo() и ItemOptics().

◆ m_mask_array

ref array<float> m_mask_array
private

Используется в GetOpticsPPMask(), InitOpticsPPInfo() и ItemOptics().

◆ m_nearplane_override

float m_nearplane_override
private

Используется в GetNearPlaneValue() и InitCameraOverrideProperties().

◆ m_optic_sight_material

string m_optic_sight_material
private

Используется в InitReddotData() и ShowReddot().

◆ m_optic_sight_texture

string m_optic_sight_texture
private

Используется в InitReddotData() и ShowReddot().

◆ m_OpticsDOFProperties

ref array<float> m_OpticsDOFProperties
private

Используется в GetOpticsDOF() и ItemOptics().

◆ m_Parent

EntityAI m_Parent
private

◆ m_Player

PlayerBase m_Player
protected

◆ m_reddot_index

int m_reddot_index
private

Используется в InitReddotData() и ShowReddot().


Объявления и описания членов классов находятся в файлах: