Dayz Explorer
1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
stanceindicator.c
Go to the documentation of this file.
1
class
StanceIndicator
2
{
3
protected
ref
HumanMovementState
m_State;
4
protected
PlayerBase
m_Player;
5
6
void
StanceIndicator
(
PlayerBase
player)
7
{
8
m_State
=
new
HumanMovementState
();
9
m_Player
= player;
10
}
11
12
void
Update()
13
{
14
if
(
m_Player
)
15
{
16
m_Player
.GetMovementState(
m_State
);
17
int
player_stance =
m_State
.m_iStanceIdx;
18
int
hud_stance_id = 1;
19
//if ( player_stance == DayZPlayerConstants.STANCEIDX_ERECT || player_stance == DayZPlayerConstants.STANCEIDX_RAISEDERECT) hud_stance_id = 1;
20
if
( player_stance ==
DayZPlayerConstants
.STANCEIDX_CROUCH || player_stance ==
DayZPlayerConstants
.STANCEIDX_RAISEDCROUCH)
21
{
22
hud_stance_id = 2;
23
}
24
if
( player_stance ==
DayZPlayerConstants
.STANCEIDX_PRONE || player_stance ==
DayZPlayerConstants
.STANCEIDX_RAISEDPRONE)
25
{
26
hud_stance_id = 3;
27
}
28
DisplayStance(hud_stance_id);
29
//Debug
30
//m_Player.MessageStatus(ToString(player) + "StanceIndicator.c || stance: " + ToString(player_stance));
31
}
32
}
33
34
void
DisplayStance(
int
stance)
35
{
36
if
(
m_Player
)
37
{
38
DisplayElementBase
stance_element =
m_Player
.GetVirtualHud().GetElement(eDisplayElements.DELM_STANCE);
39
if
(stance_element)
40
{
41
stance_element.SetValue(stance);
42
}
43
//m_Player.GetVirtualHud().SetValue(eDisplayElements.DELM_STANCE, stance);
44
}
45
}
46
};
StanceIndicator
Definition:
stanceindicator.c:1
HumanMovementState
Definition:
human.c:1125
PlayerBase
Definition:
playerbaseclient.c:1
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition:
dayzplayer.c:601
DisplayElementBase
Definition:
displayelementbadge.c:1
m_Player
DayZPlayer m_Player
Definition:
hand_events.c:42
m_State
protected float m_DrainThreshold protected bool m_State
Definition:
staminahandler.c:20
DAYZ
scripts_v1.24.157551
scripts
world
classes
stanceindicator.c
Generated by
1.8.17