DayZ
1.24
Loading...
Searching...
No Matches
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
hud_stance_id
= 2;
22
if
(
player_stance
==
DayZPlayerConstants
.STANCEIDX_PRONE ||
player_stance
==
DayZPlayerConstants
.STANCEIDX_RAISEDPRONE)
23
hud_stance_id
= 3;
24
DisplayStance
(
hud_stance_id
);
25
//Debug
26
//m_Player.MessageStatus(ToString(player) + "StanceIndicator.c || stance: " + ToString(player_stance));
27
}
28
}
29
30
void
DisplayStance
(
int
stance
)
31
{
32
if
(
m_Player
)
33
{
34
DisplayElementBase
stance_element
=
m_Player
.GetVirtualHud().GetElement(
eDisplayElements
.DELM_STANCE);
35
if
(
stance_element
)
36
stance_element
.SetValue(
stance
);
37
//m_Player.GetVirtualHud().SetValue(eDisplayElements.DELM_STANCE, stance);
38
}
39
}
40
};
DisplayElementBase
Definition
DisplayElementBadge.c:2
HumanMovementState
Definition
human.c:1113
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
StanceIndicator
Definition
StanceIndicator.c:2
StanceIndicator::StanceIndicator
void StanceIndicator(PlayerBase player)
Definition
StanceIndicator.c:6
StanceIndicator::Update
void Update()
Definition
StanceIndicator.c:12
StanceIndicator::m_Player
PlayerBase m_Player
Definition
StanceIndicator.c:4
StanceIndicator::m_State
ref HumanMovementState m_State
Definition
StanceIndicator.c:3
StanceIndicator::DisplayStance
void DisplayStance(int stance)
Definition
StanceIndicator.c:30
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:597
scripts
4_World
Classes
StanceIndicator.c
Generated by
1.10.0