5 bool m_reddot_displayed
33 RegisterNetSyncVariableInt(
"m_CurrentOpticMode", 0, 63 );
178 if (!
GetGame().IsDedicatedServer())
186 if (!
GetGame().IsDedicatedServer())
194 if (GetCompEM() && GetCompEM().CanWork())
205 else if (!
IsWorking() && m_reddot_displayed)
213 super.OnWasAttached(parent, slot_id);
226 super.OnWasDetached(parent, slot_id);
229 if (
PlayerBase.CastTo(player, GetHierarchyRootPlayer()))
231 player.SetReturnToOptics(
false);
245 super.OnInventoryExit(player);
250 playerPB.SetReturnToOptics(
false);
258 super.OnStoreSave(ctx);
265 if ( !super.OnStoreLoad(ctx,version) )
271 if ( version >= 126 )
289 super.OnVariablesSynchronized();
300 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
306 if (
GetGame().ConfigIsExisting(
path +
" opticSightTexture"))
312 if (
GetGame().ConfigIsExisting(
path +
" opticSightMaterial"))
324 if (
GetGame().IsDedicatedServer())
353 m_reddot_displayed = state;
368 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
386 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
394 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
395 if (
GetGame().ConfigIsExisting(
path +
" nearPlaneDistanceOverride") )
408 if (
GetGame().ConfigIsExisting(
"cfgVehicles " +
GetType() +
" OpticsInfo PPDOFProperties"))
413 else if (
GetGame().ConfigIsExisting(
"cfgVehicles " +
GetType() +
" OpticsInfoWeaponOverride PPDOFProperties"))
507 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo preloadOpticType";
533 GetInventory().CreateAttachment(
"Battery9V");
eBleedingSourceType GetType()
void AddAction(typename actionName)
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
override void SetTakeable(bool pState)
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native void ConfigGetFloatArray(string path, out TFloatArray values)
Get array of floats from config on path.
Super root of all classes in Enforce script.
this is main camera class
proto native bool SetStepZeroing(int step)
proto native bool StepFOVDown()
sets zoom to previous (respective to current) defined value in zoom fov config array
void OnOpticModeChange()
optic-specific behaviour to be defined here (override)
proto native float GetZeroingDistanceZoomMax()
Gets Zeroing distance at opticsZoomMax.
void InitOpticsPP(out array< float > mask_array, out array< float > lens_array, out float blur_float)
initializes values for optics' post-processes
proto native bool StepZeroingUp()
sets zeroing to next defined (respective to current) value in zeroing config array
proto native bool ExitOptics()
switches out of optics mode (if possible)
override void OnDebugSpawn()
int m_CurrentOpticModeLocal
proto native bool StepFOVUp()
sets zoom to next defined (respective to current) value in zoom fov config array
override void OnWorkStart()
int GetCurrentOpticMode()
ref array< float > GetOpticsPPLens()
bool m_reddot_displayed bool m_isNVOptic
override void OnStoreSave(ParamsWriteContext ctx)
proto native bool IsInOptics()
is weapon in optics mode or not
proto native void SetZeroingClampDist(float dist)
Sets zeroing clamp for the optics and updates the clamp if dist > 0. Used when attached to weapon.
proto native int GetStepFOVIndex()
returns index of currently used value in 'discretefov' config array
bool AllowsDOF()
returns 'true' for non-magnifying optics
proto native void GetCameraPoint(out vector pos, out vector dir)
gets camera position & direction in model space of optics entity
ref array< float > GetOpticsPPMask()
float GetNearPlaneValue()
proto native bool IsUsingWeaponIronsightsOverride()
is optics using ironsights override settings or not
proto native bool EnterOptics()
switches to optics mode if possible
ref array< float > m_mask_array
proto native bool UseWeaponIronsightsOverride(bool state)
switches into ironsights override settings
override void ShowSelection(string selection_name)
void UpdateOpticsReddotVisibility()
void UpdateSelectionVisibility()
override void HideSelection(string selection_name)
bool InitDOFAvailability()
optics with more than 1x zoom do not allow DOF changes
override void OnVariablesSynchronized()
proto native bool StepZeroingDown()
sets zeroing to previous (respective to current) defined value in zeroing config array
override void SetActions()
ref array< float > m_OpticsDOFProperties
proto native float GetZoomMax()
gets FOV maximum
bool InitOpticsDOFProperties(out array< float > temp_array)
Initializes DOF properties for optic's alternate ironsights (ACOG etc.)
proto native bool HasWeaponIronsightsOverride()
is weapon in optics mode or not
ref array< float > GetOpticsDOF()
proto native float GetZeroingDistanceZoomMin()
Gets Zeroing distance at opticsZoomMin.
proto native float GetZoomInit()
gets FOV value, when entering optics
void SetCurrentOpticMode(int mode)
override void OnWasAttached(EntityAI parent, int slot_id)
proto native int GetStepFOVCount()
returns number of configured steps
string m_optic_sight_material
override void OnInventoryExit(Man player)
float m_nearplane_override
void InitCameraOverrideProperties()
proto native int GetStepZeroing()
returns position of currently used value in zeroing config array
void ShowReddot(bool state)
proto native float GetZoomMin()
gets FOV minimum
proto native bool SetStepFOVIndex(int step)
sets zoom to fov value defined at given in 'discretefov' config array
ref array< float > m_lens_array
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWorkStop()
proto native float GetCurrentStepFOV()
returns fov value at current index, or 'OpticsInfo.opticsZoomInit' config value (non-zooming optics)
string m_optic_sight_texture
override void OnWasDetached(EntityAI parent, int slot_id)
proto bool Write(void value_out)
proto bool Read(void value_in)
script counterpart to engine's class Weapon
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
const float DZPLAYER_CAMERA_FOV_IRONSIGHTS
const int OPTICS_STATE_DAY
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Max(float x, float y)
Returns bigger of two given values.