Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
ItemOptics Class Reference
Inheritance diagram for ItemOptics:
InventoryItemSuper ACOGOptic ACOGOptic_6x AugOptic BUISOptic Binoculars FNP45_MRDSOptic GrozaOptic KashtanOptic KobraOptic LongrangeOptic M68Optic PistolOptic SSG82Optic SportingOptic StarlightOptic

Protected Member Functions

bool AllowsDOF ()
 returns 'true' for non-magnifying optics
int GetCurrentNVType ()
int GetCurrentOpticMode ()
ItemOpticsType GetItemOpticsType ()
 Returns the ItemOpticsType of this ItemOptics instance.
float GetNearPlaneValue ()
ref array< floatGetOpticsDOF ()
float GetOpticsPPBlur ()
ref array< floatGetOpticsPPLens ()
ref array< floatGetOpticsPPMask ()
PlayerBase GetPlayer ()
void Init2DPreloadType ()
void InitCameraOverrideProperties ()
bool InitDOFAvailability ()
 optics with more than 1x zoom do not allow DOF changes
void InitOpticMode ()
bool InitOpticsDOFProperties (out array< float > temp_array)
 Initializes DOF properties for optic's alternate ironsights (ACOG etc.).
void InitOpticsPP (out array< float > mask_array, out array< float > lens_array, out float blur_float)
 initializes values for optics' post-processes
void InitOpticsPPInfo ()
void InitReddotData ()
bool IsNVOptic ()
bool IsSightOnly ()
bool IsUsableWithNV ()
bool IsUsingOptics2DModel ()
 Returns whether this ItemOptics uses the 2D optics model.
bool IsWorking ()
override void OnDebugSpawn ()
void OnDrawOptics2D ()
override void OnInventoryExit (Man player)
void OnOpticEnter ()
void OnOpticExit ()
void OnOpticModeChange ()
 optic-specific behaviour to be defined here (override)
override bool OnStoreLoad (ParamsReadContext ctx, int version)
override void OnStoreSave (ParamsWriteContext ctx)
override void OnVariablesSynchronized ()
override void OnWasAttached (EntityAI parent, int slot_id)
override void OnWasDetached (EntityAI parent, int slot_id)
override void OnWorkStart ()
override void OnWorkStop ()
override void SetActions ()
void SetCurrentOpticMode (int mode)
void SetPlayer (PlayerBase player)
void ShowReddot (bool state)
void StartWorkServer ()
void StopWorkServer ()
void UpdateOpticsReddotVisibility ()
void UpdateSelectionVisibility ()

Protected Attributes

bool m_IsActionActive
PlayerBase m_Player

Private Member Functions

void ItemOptics ()
override bool CanPutAsAttachment (EntityAI parent)
override bool CanPutAsAttachment (EntityAI parent)
proto native bool EnterOptics ()
 switches to optics mode if possible
proto native bool ExitOptics ()
 switches out of optics mode (if possible)
proto native void GetCameraPoint (out vector pos, out vector dir)
proto native float GetCurrentStepFOV ()
 returns fov value at current index, or 'OpticsInfo.opticsZoomInit' config value (non-zooming optics)
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 int GetStepZeroing ()
 returns position of currently used value in zeroing config array
proto native float GetZeroingDistanceZoomMax ()
 Gets Zeroing distance at opticsZoomMax.
proto native float GetZeroingDistanceZoomMin ()
 Gets Zeroing distance at opticsZoomMin.
proto native float GetZoomInit ()
 gets FOV value, when entering optics
proto native float GetZoomMax ()
 gets FOV maximum
proto native float GetZoomMin ()
 gets FOV minimum
proto native bool HasWeaponIronsightsOverride ()
 is weapon in optics mode or not
override void HideSelection (string selection_name)
void HuntingOptic ()
proto native bool IsInOptics ()
 is weapon in optics mode or not
override bool IsSightOnly ()
proto native bool IsUsingWeaponIronsightsOverride ()
 is optics using ironsights override settings or not
override void OnWasAttached (EntityAI parent, int slot_id)
override void OnWasDetached (EntityAI parent, int slot_id)
bool ParentUsesWinchesterTypeMount ()
proto native bool SetStepFOVIndex (int step)
proto native bool SetStepZeroing (int step)
proto native void SetZeroingClampDist (float dist)
override void ShowSelection (string selection_name)
proto native bool StepFOVDown ()
 sets zoom to previous (respective to current) defined value in zoom fov config array
proto native bool StepFOVUp ()
 sets zoom to next defined (respective to current) value in zoom fov config array
proto native bool StepZeroingDown ()
 sets zeroing to previous (respective to current) defined value in zeroing config array
proto native bool StepZeroingUp ()
 sets zeroing to next defined (respective to current) value in zeroing config array
proto native bool UseWeaponIronsightsOverride (bool state)
Private Member Functions inherited from InventoryItemSuper
override bool DescriptionOverride (out string output)
override bool DisplayNameRuinAttach ()
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
bool GetMapStateAnimation ()
array< ref MapMarkerGetMarkerArray ()
override int GetMeleeTargetType ()
proto native float GetRadius ()
 Returns current wheel radius.
string GetRuinedReplacement ()
proto native float GetWidth ()
 Returns wheel width.
void InitMapState ()
void InsertMarker (vector pos, string text, int color, int idx)
void ItemMap ()
override bool NameOverride (out string output)
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool OnStoreLoad (ParamsReadContext ctx, int version)
override void OnStoreSave (ParamsWriteContext ctx)
override void OnWasAttached (EntityAI parent, int slot_id)
override void OnWasDetached (EntityAI parent, int slot_id)
override void SetActions ()
void SetMapStateOpen (bool state, PlayerBase player)
 displays open/closed selections; 1 == opened
override bool ShowZonesHealth ()
void SyncMapMarkers ()

Private Attributes

string m_2D_preload_type
bool m_allowsDOF
float m_blur_float
int m_CurrentOpticMode
int m_CurrentOpticModeLocal
bool m_data_set
bool m_reddot_displayed bool m_isNVOptic = false
ref array< floatm_lens_array
ref array< floatm_mask_array
float m_nearplane_override
string m_optic_sight_material
string m_optic_sight_texture
ref array< floatm_OpticsDOFProperties
EntityAI m_Parent
int m_reddot_index
Private Attributes inherited from InventoryItemSuper
string m_AttachSound = "Offroad_Wheel_Attach_SoundSet"
string m_Description
string m_DetachSound = "Offroad_Wheel_Remove_SoundSet"
string m_DisplayName
ref array< ref MapMarkerm_MapMarkerArray
string m_TextureClosed
string m_TextureLegend
string m_TextureOpened

Detailed Description

Definition at line 1 of file itemoptics.c.

Constructor & Destructor Documentation

◆ ItemOptics()

Member Function Documentation

◆ AllowsDOF()

bool AllowsDOF ( )
inlineprotected

returns 'true' for non-magnifying optics

Definition at line 487 of file itemoptics.c.

References m_allowsDOF.

Referenced by Weapon::HideWeaponBarrel().

◆ CanPutAsAttachment() [1/2]

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate

Definition at line 49 of file m79.c.

◆ CanPutAsAttachment() [2/2]

override bool CanPutAsAttachment ( EntityAI parent)
inlineprivate

Definition at line 3 of file m4_carryhandleoptic.c.

◆ EnterOptics()

proto native bool EnterOptics ( )
private

switches to optics mode if possible

Returns
true if success, false otherwise

Referenced by ActionViewBinoculars::EnterOptics(), ActionViewOptics::EnterOptics(), ActionZoomIn::OnEndServer(), and DayZPlayer::SwitchOptics().

◆ ExitOptics()

proto native bool ExitOptics ( )
private

switches out of optics mode (if possible)

Returns
true if success, false otherwise

Referenced by ActionViewOptics::ExitOptics(), ActionZoomOut::OnEndServer(), and DayZPlayer::SwitchOptics().

◆ GetCameraPoint()

proto native void GetCameraPoint ( out vector pos,
out vector dir )
private

◆ GetCurrentNVType()

int GetCurrentNVType ( )
inlineprotected

Definition at line 497 of file itemoptics.c.

◆ GetCurrentOpticMode()

int GetCurrentOpticMode ( )
inlineprotected

◆ GetCurrentStepFOV()

proto native float GetCurrentStepFOV ( )
private

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

Referenced by ManBase::HideClothing(), and HoldBreathFOVEffect().

◆ GetItemOpticsType()

ItemOpticsType GetItemOpticsType ( )
inlineprotected

Returns the ItemOpticsType of this ItemOptics instance.

Definition at line 201 of file itemoptics.c.

Referenced by InitReddotData(), IsUsingOptics2DModel(), and OnDrawOptics2D().

◆ GetNearPlaneValue()

float GetNearPlaneValue ( )
inlineprotected

Definition at line 565 of file itemoptics.c.

References m_nearplane_override.

◆ GetOpticsDOF()

ref array< float > GetOpticsDOF ( )
inlineprotected

Definition at line 548 of file itemoptics.c.

References m_OpticsDOFProperties.

◆ GetOpticsPPBlur()

float GetOpticsPPBlur ( )
inlineprotected

Definition at line 560 of file itemoptics.c.

References m_blur_float.

◆ GetOpticsPPLens()

ref array< float > GetOpticsPPLens ( )
inlineprotected

Definition at line 556 of file itemoptics.c.

References m_lens_array.

◆ GetOpticsPPMask()

ref array< float > GetOpticsPPMask ( )
inlineprotected

Definition at line 552 of file itemoptics.c.

References m_mask_array.

◆ GetPlayer()

PlayerBase GetPlayer ( )
inlineprotected

Definition at line 11 of file poweredoptic_base.c.

References m_Player.

◆ GetStepFOVCount()

proto native int GetStepFOVCount ( )
private

returns number of configured steps

◆ GetStepFOVIndex()

proto native int GetStepFOVIndex ( )
private

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

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

◆ GetStepZeroing()

proto native int GetStepZeroing ( )
private

returns position of currently used value in zeroing config array

Returns
position of currently used value in zeroing config array

◆ GetZeroingDistanceZoomMax()

proto native float GetZeroingDistanceZoomMax ( )
private

Gets Zeroing distance at opticsZoomMax.

◆ GetZeroingDistanceZoomMin()

proto native float GetZeroingDistanceZoomMin ( )
private

Gets Zeroing distance at opticsZoomMin.

◆ GetZoomInit()

proto native float GetZoomInit ( )
private

gets FOV value, when entering optics

◆ GetZoomMax()

proto native float GetZoomMax ( )
private

gets FOV maximum

◆ GetZoomMin()

proto native float GetZoomMin ( )
private

gets FOV minimum

◆ HasWeaponIronsightsOverride()

proto native bool HasWeaponIronsightsOverride ( )
private

is weapon in optics mode or not

Returns
true if optics has defined override optics info for weapon

Referenced by Weapon::CanEnterIronsights().

◆ HideSelection()

◆ HuntingOptic()

void HuntingOptic ( )
inlineprivate

Definition at line 5 of file huntingoptic.c.

References HideSelection().

◆ Init2DPreloadType()

void Init2DPreloadType ( )
inlineprotected

Definition at line 570 of file itemoptics.c.

References g_Game, GetType(), m_2D_preload_type, and path.

Referenced by ItemOptics().

◆ InitCameraOverrideProperties()

void InitCameraOverrideProperties ( )
inlineprotected

Definition at line 457 of file itemoptics.c.

References DayZPlayerCameraOptics(), g_Game, GetType(), m_nearplane_override, Math::Max(), and path.

Referenced by ItemOptics().

◆ InitDOFAvailability()

bool InitDOFAvailability ( )
inlineprotected

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

Definition at line 430 of file itemoptics.c.

References GameConstants::DZPLAYER_CAMERA_FOV_IRONSIGHTS, g_Game, GetType(), and path.

Referenced by InitOpticsPPInfo().

◆ InitOpticMode()

void InitOpticMode ( )
inlineprotected

Definition at line 582 of file itemoptics.c.

References GameConstants::OPTICS_STATE_DAY, and SetCurrentOpticMode().

Referenced by ItemOptics(), and IsSightOnly().

◆ InitOpticsDOFProperties()

bool InitOpticsDOFProperties ( out array< float > temp_array)
inlineprotected

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

Definition at line 471 of file itemoptics.c.

References g_Game, and GetType().

Referenced by ItemOptics().

◆ InitOpticsPP()

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

initializes values for optics' post-processes

Definition at line 449 of file itemoptics.c.

References g_Game, GetType(), and path.

Referenced by InitOpticsPPInfo().

◆ InitOpticsPPInfo()

void InitOpticsPPInfo ( )
inlineprotected

◆ InitReddotData()

◆ IsInOptics()

◆ IsNVOptic()

bool IsNVOptic ( )
inlineprotected

Definition at line 492 of file itemoptics.c.

References m_isNVOptic.

Referenced by ActionToggleNVMode::ActionCondition().

◆ IsSightOnly() [1/2]

bool IsSightOnly ( )
inlineprotected

Definition at line 213 of file itemoptics.c.

Referenced by DayZPlayer::SwitchOptics().

◆ IsSightOnly() [2/2]

override bool IsSightOnly ( )
inlineprivate

Definition at line 54 of file m79.c.

◆ IsUsableWithNV()

bool IsUsableWithNV ( )
inlineprotected

Definition at line 218 of file itemoptics.c.

Referenced by DayZPlayer::OnDrawOptics2D().

◆ IsUsingOptics2DModel()

bool IsUsingOptics2DModel ( )
inlineprotected

Returns whether this ItemOptics uses the 2D optics model.

Definition at line 207 of file itemoptics.c.

References GetItemOpticsType(), and ItemOpticsType::IsUsingOptics2DModel().

Referenced by InitReddotData(), DayZPlayer::OnDrawOptics2D(), and ShowReddot().

◆ IsUsingWeaponIronsightsOverride()

proto native bool IsUsingWeaponIronsightsOverride ( )
private

is optics using ironsights override settings or not

Returns
true if optics is using ironsights override settings

Referenced by DayZPlayer::HandleWeapons().

◆ IsWorking()

bool IsWorking ( )
inlineprotected

◆ OnDebugSpawn()

override void OnDebugSpawn ( )
inlineprotected

Definition at line 596 of file itemoptics.c.

◆ OnDrawOptics2D()

◆ OnInventoryExit()

override void OnInventoryExit ( Man player)
inlineprotected

Definition at line 290 of file itemoptics.c.

References SetTakeable().

◆ OnOpticEnter()

void OnOpticEnter ( )
inlineprotected

Definition at line 533 of file itemoptics.c.

References g_Game, and HideSelection().

Referenced by DayZPlayer::SwitchOptics().

◆ OnOpticExit()

void OnOpticExit ( )
inlineprotected

Definition at line 540 of file itemoptics.c.

References g_Game, and ShowSelection().

Referenced by DayZPlayer::SwitchOptics().

◆ OnOpticModeChange()

void OnOpticModeChange ( )
inlineprotected

optic-specific behaviour to be defined here (override)

Definition at line 532 of file itemoptics.c.

Referenced by OnStoreLoad(), OnVariablesSynchronized(), and SetCurrentOpticMode().

◆ OnStoreLoad()

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected

◆ OnStoreSave()

override void OnStoreSave ( ParamsWriteContext ctx)
inlineprotected

Definition at line 303 of file itemoptics.c.

References m_CurrentOpticMode, and Serializer::Write().

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
inlineprotected

Definition at line 334 of file itemoptics.c.

References m_CurrentOpticMode, m_CurrentOpticModeLocal, and OnOpticModeChange().

◆ OnWasAttached() [1/2]

override void OnWasAttached ( EntityAI parent,
int slot_id )
inlineprotected

Definition at line 258 of file itemoptics.c.

References Class::CastTo(), SetTakeable(), and SetZeroingClampDist().

◆ OnWasAttached() [2/2]

override void OnWasAttached ( EntityAI parent,
int slot_id )
inlineprivate

◆ OnWasDetached() [1/2]

override void OnWasDetached ( EntityAI parent,
int slot_id )
inlineprotected

Definition at line 271 of file itemoptics.c.

References Class::CastTo(), SetTakeable(), and SetZeroingClampDist().

◆ OnWasDetached() [2/2]

override void OnWasDetached ( EntityAI parent,
int slot_id )
inlineprivate

Definition at line 24 of file huntingoptic.c.

References HideSelection(), m_Parent, and ShowSelection().

◆ OnWorkStart()

override void OnWorkStart ( )
inlineprotected

Definition at line 223 of file itemoptics.c.

References g_Game, and ShowReddot().

◆ OnWorkStop()

override void OnWorkStop ( )
inlineprotected

Definition at line 231 of file itemoptics.c.

References g_Game, and ShowReddot().

◆ ParentUsesWinchesterTypeMount()

bool ParentUsesWinchesterTypeMount ( )
inlineprivate

Definition at line 66 of file huntingoptic.c.

References m_Parent.

Referenced by OnWasAttached(), and ShowSelection().

◆ SetActions()

override void SetActions ( )
inlineprotected

Definition at line 589 of file itemoptics.c.

References AddAction().

◆ SetCurrentOpticMode()

void SetCurrentOpticMode ( int mode)
inlineprotected

◆ SetPlayer()

void SetPlayer ( PlayerBase player)
inlineprotected

Definition at line 6 of file poweredoptic_base.c.

References m_Player.

◆ SetStepFOVIndex()

proto native bool SetStepFOVIndex ( int step)
private

◆ SetStepZeroing()

proto native bool SetStepZeroing ( int step)
private

◆ SetZeroingClampDist()

proto native void SetZeroingClampDist ( float dist)
private

Referenced by OnWasAttached(), and OnWasDetached().

◆ ShowReddot()

void ShowReddot ( bool state)
inlineprotected

◆ ShowSelection()

◆ StartWorkServer()

void StartWorkServer ( )
inlineprotected

Definition at line 16 of file poweredoptic_base.c.

References m_IsActionActive.

◆ StepFOVDown()

proto native bool StepFOVDown ( )
private

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

Returns
true if zoom set

◆ StepFOVUp()

proto native bool StepFOVUp ( )
private

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

Returns
true if zoom set

◆ StepZeroingDown()

proto native bool StepZeroingDown ( )
private

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

Returns
true if zeroing set

Referenced by DayZPlayer::HandleWeapons().

◆ StepZeroingUp()

proto native bool StepZeroingUp ( )
private

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

Returns
true if zeroing set

Referenced by DayZPlayer::HandleWeapons().

◆ StopWorkServer()

void StopWorkServer ( )
inlineprotected

Definition at line 22 of file poweredoptic_base.c.

References m_IsActionActive.

◆ UpdateOpticsReddotVisibility()

void UpdateOpticsReddotVisibility ( )
inlineprotected

Definition at line 246 of file itemoptics.c.

References IsWorking(), and ShowReddot().

Referenced by DayZPlayerCameraBase::UpdateBatteryOptics().

◆ UpdateSelectionVisibility()

void UpdateSelectionVisibility ( )
inlineprotected

Definition at line 587 of file itemoptics.c.

Referenced by OnOpticModeChange().

◆ UseWeaponIronsightsOverride()

proto native bool UseWeaponIronsightsOverride ( bool state)
private

Field Documentation

◆ m_2D_preload_type

string m_2D_preload_type
private

Definition at line 14 of file itemoptics.c.

Referenced by Init2DPreloadType().

◆ m_allowsDOF

bool m_allowsDOF
private

Definition at line 4 of file itemoptics.c.

Referenced by AllowsDOF(), and InitOpticsPPInfo().

◆ m_blur_float

float m_blur_float
private

Definition at line 10 of file itemoptics.c.

Referenced by GetOpticsPPBlur(), and InitOpticsPPInfo().

◆ m_CurrentOpticMode

◆ m_CurrentOpticModeLocal

int m_CurrentOpticModeLocal
private

Definition at line 8 of file itemoptics.c.

Referenced by ItemOptics(), and OnVariablesSynchronized().

◆ m_data_set

bool m_data_set
private

Definition at line 3 of file itemoptics.c.

Referenced by InitReddotData(), and ShowReddot().

◆ m_IsActionActive

bool m_IsActionActive
protected

Definition at line 4 of file poweredoptic_base.c.

Referenced by StartWorkServer(), and StopWorkServer().

◆ m_isNVOptic

bool m_reddot_displayed bool m_isNVOptic = false
private

Definition at line 6 of file itemoptics.c.

Referenced by InitOpticsPPInfo(), and IsNVOptic().

◆ m_lens_array

ref array<float> m_lens_array
private

Definition at line 16 of file itemoptics.c.

Referenced by ItemOptics(), GetOpticsPPLens(), and InitOpticsPPInfo().

◆ m_mask_array

ref array<float> m_mask_array
private

Definition at line 15 of file itemoptics.c.

Referenced by ItemOptics(), GetOpticsPPMask(), and InitOpticsPPInfo().

◆ m_nearplane_override

float m_nearplane_override
private

Definition at line 11 of file itemoptics.c.

Referenced by GetNearPlaneValue(), and InitCameraOverrideProperties().

◆ m_optic_sight_material

string m_optic_sight_material
private

Definition at line 13 of file itemoptics.c.

Referenced by InitReddotData(), OnDrawOptics2D(), and ShowReddot().

◆ m_optic_sight_texture

string m_optic_sight_texture
private

Definition at line 12 of file itemoptics.c.

Referenced by InitReddotData(), OnDrawOptics2D(), and ShowReddot().

◆ m_OpticsDOFProperties

ref array<float> m_OpticsDOFProperties
private

Definition at line 17 of file itemoptics.c.

Referenced by ItemOptics(), and GetOpticsDOF().

◆ m_Parent

EntityAI m_Parent
private

Definition at line 3 of file huntingoptic.c.

Referenced by OnWasAttached(), OnWasDetached(), and ParentUsesWinchesterTypeMount().

◆ m_Player

PlayerBase m_Player
protected

Definition at line 3 of file poweredoptic_base.c.

Referenced by GetPlayer(), and SetPlayer().

◆ m_reddot_index

int m_reddot_index
private

Definition at line 9 of file itemoptics.c.

Referenced by InitReddotData(), OnDrawOptics2D(), and ShowReddot().


The documentation for this class was generated from the following files:
  • F:/Games/Dayz/scripts/4_world/entities/core/inherited/itemoptics.c
  • F:/Games/Dayz/scripts/4_world/entities/itembase/inventory_base/huntingoptic.c
  • F:/Games/Dayz/scripts/4_world/entities/itembase/poweredoptic_base.c
  • F:/Games/Dayz/scripts/4_world/entities/firearms/launcher/m79.c
  • F:/Games/Dayz/scripts/4_world/entities/itembase/inventory_base/m4_carryhandleoptic.c