DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
GEWidgetsMetaDataSquinting.c
См. документацию.
1
3{
4 protected const float TOP_LID_OPEN_Y_POSITION = -512;
5 protected const float TOP_LID_CLOSED_Y_POSITION = 0;
6 protected const float BOTTOM_LID_OPEN_Y_POSITION = -512;
7 protected const float BOTTOM_LID_CLOSED_Y_POSITION = 0;
8
9 protected bool m_Initialized;
10 protected bool m_Visible;
12 protected ImageWidget m_TopLid;
13 protected ImageWidget m_BottomLid;
14
15 // Passed from modifier -> symptom -> effect
16 protected float m_SquintAmount; // How much to close the eye <0.0, 1.0>
17
19
20 // Squint parameter:
21 float m_SquintCloseSpeed = 0.5; // seconds
22
23 protected float m_SquintTargetAmount = 0.0;
24 protected float m_SquintCurrentAmount = 0.0;
25 protected bool m_IsSquinting;
26
27 protected static float m_SmoothVelArray[1];
28
29 void GameplayEffectsMetaDataSquinting(array<ref Widget> input, int type, int user_override = -1)
30 {
31 m_RequesterSquint = PPERequester_SquintEffects.Cast(PPERequesterBank.GetRequester(PPERequesterBank.REQ_SQUINT));
32 }
33
34 override void Init(array<ref Widget> input, int type, Widget layout_root, int user_override = -1)
35 {
36 super.Init(input, type, layout_root, user_override);
37
38 m_EyeLidFrame = m_LayoutRoot.FindAnyWidgetById(EffectWidgetsTypes.SQUINTING);
40 m_TopLid = ImageWidget.Cast(m_EyeLidFrame.FindWidget("topLid"));
41 m_TopLid.Show(true);
42 m_BottomLid = ImageWidget.Cast(m_EyeLidFrame.FindWidget("bottomLid"));
43 m_BottomLid.Show(true);
44
45 m_Initialized = true;
46 m_Visible = true;
47 }
48
49 override bool HasDefinedHandle()
50 {
51 return true;
52 }
53
54 override bool DataInitialized()
55 {
56 return m_Initialized;
57 }
58
59 override void Update(float timeSlice = 0, Param p = null, int handle = -1)
60 {
61 if (p)
62 {
63 Param1<float> params;
64 if (Class.CastTo(params, p))
65 {
66 m_SquintAmount = params.param1;
70 UpdateSquint(timeSlice);
71 }
72 }
73 }
74
75 protected void UpdateSquint(float dt)
76 {
77 if (!m_IsSquinting)
78 {
79 m_SmoothVelArray[0] = 0.0;
80 return;
81 }
82
83 float speed = m_SquintCloseSpeed;
85
87
89 {
91 m_IsSquinting = false;
92 m_SmoothVelArray[0] = 0.0;
93 }
94 }
95
96 protected void SetEyelidAmount(float amount, float timeslice)
97 {
98 if (m_TopLid)
100
101 if (m_BottomLid)
103 }
104
105 override void UpdateVisibility(bool state)
106 {
108 while (w && w != m_LayoutRoot && m_Visible == state && w.IsVisibleHierarchy() != state)
109 {
110 w.Show(state);
111 w = w.GetParent();
112 }
113 }
114
116 override void ForceStop()
117 {
118 super.ForceStop();
119
120 Update();
121 }
122}
Super root of all classes in Enforce script.
Определения EnScript.c:11
Manages all bleeding indicators and their updates.
Определения GEWidgetsMetaDataBleeding.c:4
Widget m_EyeLidFrame
overall visibility
Определения GEWidgetsMetaDataSquinting.c:11
void GameplayEffectsMetaDataSquinting(array< ref Widget > input, int type, int user_override=-1)
Определения GEWidgetsMetaDataSquinting.c:29
override void Init(array< ref Widget > input, int type, Widget layout_root, int user_override=-1)
Определения GEWidgetsMetaDataSquinting.c:34
override bool DataInitialized()
Определения GEWidgetsMetaDataSquinting.c:54
const float TOP_LID_CLOSED_Y_POSITION
[px]
Определения GEWidgetsMetaDataSquinting.c:5
ref PPERequester_SquintEffects m_RequesterSquint
Определения GEWidgetsMetaDataSquinting.c:18
override bool HasDefinedHandle()
Определения GEWidgetsMetaDataSquinting.c:49
override void UpdateVisibility(bool state)
Определения GEWidgetsMetaDataSquinting.c:105
static float m_SmoothVelArray[1]
Определения GEWidgetsMetaDataSquinting.c:27
const float TOP_LID_OPEN_Y_POSITION
Определения GEWidgetsMetaDataSquinting.c:4
override void ForceStop()
stops and re-sets indicators and images even out of sequence. Should still be tied to the 'player' up...
Определения GEWidgetsMetaDataSquinting.c:116
void SetEyelidAmount(float amount, float timeslice)
Определения GEWidgetsMetaDataSquinting.c:96
override void Update(float timeSlice=0, Param p=null, int handle=-1)
Определения GEWidgetsMetaDataSquinting.c:59
const float BOTTOM_LID_CLOSED_Y_POSITION
[px]
Определения GEWidgetsMetaDataSquinting.c:7
const float BOTTOM_LID_OPEN_Y_POSITION
[px]
Определения GEWidgetsMetaDataSquinting.c:6
Определения EnMath.c:7
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:106
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto float SmoothCD(float val, float target, inout float velocity[], float smoothTime, float maxVelocity, float dt)
Does the CD smoothing function - easy in | easy out / S shaped smoothing.
proto native volatile void Update()
Определения PlayerSoundManager.c:125