18 m_IsActionActive =
false;
27 if (
GetGame().ConfigIsExisting(
path +
" rangeFinderLayout"))
32 if (layout !=
"" && layout.
Length() > 0)
38 m_LayoutPath =
"gui/layouts/gameplay/rangefinder_hud.layout";
51 if (
GetGame().IsServer() && !m_IsActionActive)
54 if( !
GetGame().IsDedicatedServer())
59 if ( player_this == player_owner )
68 if( !
GetGame().IsDedicatedServer())
73 if ( player_this == player_owner )
117 text.SetText(
"00" + dist.
ToString() );
118 else if( dist < 100 )
119 text.SetText(
"0" + dist.
ToString() );
131 text.SetText(
"---" );
146 int contactComponent;
148 bool hit =
DayZPhysics.
RaycastRV( from, to, contact_pos, contact_dir, contactComponent, NULL , NULL, player,
false,
false, ObjIntersectIFire);
167 vector horizontalTo =
Vector( contact_pos[0], from[1], contact_pos[2] );
171 float heightDiff = contact_pos[1] - from[1];
178 angleText.SetText(
string.Format(
"%1", angle));
203 GetInventory().CreateInInventory(
"Battery9V" );
eBleedingSourceType GetType()
void AddAction(typename actionName)
void RemoveAction(typename actionName)
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native WorkspaceWidget GetWorkspace()
proto native vector GetCurrentCameraPosition()
proto native vector GetCurrentCameraDirection()
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
override void SetActions()
static const float RANGEFINDER_MAX_DISTANCE
void SetDistanceText(TextWidget text, float dist)
void SetInvalidText(TextWidget text)
void StopPeriodicMeasurement()
void InitRangeFinderData()
void StartPeriodicMeasurement()
override void OnDebugSpawn()
float GetMeasurementUpdateInterval()
override void OnWorkStop()
override void OnWorkStart()
proto string ToString(bool simple=true)
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Atan(float x)
Returns angle in radians from tangent.
static proto float Round(float f)
Returns mathematical round of value.
static const float RAD2DEG
proto native int Length()
Returns length of string.