Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
plugindayzplayerdebug_othercmds.c
Go to the documentation of this file.
1
// *************************************************************************************
2
// ! PluginDayzPlayerDebug_OtherCmds
3
// *************************************************************************************
4
5
class
PluginDayzPlayerDebug_OtherCmds
6
{
7
// widgets
8
Widget
m_MainWnd
;
9
10
XComboBoxWidget
m_DeathTypeCB
;
11
EditBoxWidget
m_DeathDirectionEdit
;
12
ButtonWidget
m_DeathStartButton
;
13
14
XComboBoxWidget
m_HitTypeCB
;
15
ButtonWidget
m_HitStartButton
;
16
17
XComboBoxWidget
m_UnconTypeCB
;
18
ButtonWidget
m_UnconStartButton
;
19
ButtonWidget
m_UnconEndButton
;
20
21
// command handler properties
22
bool
m_CH_DeathStart
=
false
;
23
bool
m_CH_HitStart
=
false
;
24
bool
m_CH_UnconStart
=
false
;
25
bool
m_CH_UnconEnd
=
false
;
26
27
28
//---------------------------------------------------
29
// gui stuff
30
31
void
PluginDayzPlayerDebug_OtherCmds
(
Widget
pMainWnd)
32
{
33
m_MainWnd
= pMainWnd;
34
CreateModuleWidgets
();
35
}
36
37
38
void
~PluginDayzPlayerDebug_OtherCmds
()
39
{
40
DestroyModuleWidgets
();
41
}
42
43
44
void
CreateModuleWidgets
()
45
{
46
m_DeathTypeCB
= XComboBoxWidget.Cast(
m_MainWnd
.FindAnyWidget(
"DeathTypeCB"
) );
47
m_DeathDirectionEdit
=
EditBoxWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"DeathDirectionEdit"
) );
48
m_DeathStartButton
= ButtonWidget.Cast(
m_MainWnd
.FindAnyWidget(
"DeathStartButton"
) );
49
50
m_HitTypeCB
= XComboBoxWidget.Cast(
m_MainWnd
.FindAnyWidget(
"HitTypeCB"
) );
51
m_HitStartButton
= ButtonWidget.Cast(
m_MainWnd
.FindAnyWidget(
"HitStartButton"
) );
52
53
m_UnconTypeCB
= XComboBoxWidget.Cast(
m_MainWnd
.FindAnyWidget(
"UnconTypeCB"
) );
54
m_UnconStartButton
= ButtonWidget.Cast(
m_MainWnd
.FindAnyWidget(
"UnconStartButton"
) );
55
m_UnconEndButton
= ButtonWidget.Cast(
m_MainWnd
.FindAnyWidget(
"UnconEndButton"
) );
56
}
57
58
void
DestroyModuleWidgets
()
59
{
60
}
61
62
//---------------------------------------------------
63
// window ui clicks
64
66
bool
OnClick
(
Widget
w,
int
x
,
int
y
,
int
button)
67
{
68
if
( w ==
m_DeathStartButton
)
69
{
70
Print
(
"PluginPlayerDebug: Death Start"
);
71
m_CH_DeathStart
=
true
;
72
return
true
;
73
}
74
else
if
( w ==
m_HitStartButton
)
75
{
76
Print
(
"PluginPlayerDebug: Uncon Start"
);
77
m_CH_HitStart
=
true
;
78
return
true
;
79
}
80
else
if
( w ==
m_UnconStartButton
)
81
{
82
Print
(
"PluginPlayerDebug: Uncon Start"
);
83
m_CH_UnconStart
=
true
;
84
return
true
;
85
}
86
else
if
( w ==
m_UnconEndButton
)
87
{
88
Print
(
"PluginPlayerDebug: Uncon End"
);
89
m_CH_UnconEnd
=
true
;
90
return
true
;
91
}
92
93
return
false
;
94
}
95
96
97
//---------------------------------------------------
98
// Global handler to handle commands from player
99
100
void
CommandHandler
()
101
{
102
if
(
m_CH_DeathStart
)
103
{
104
Death_Start
();
105
m_CH_DeathStart
=
false
;
106
}
107
if
(
m_CH_HitStart
)
108
{
109
Hit_Start
();
110
m_CH_HitStart
=
false
;
111
}
112
if
(
m_CH_UnconStart
)
113
{
114
Uncon_Start
();
115
m_CH_UnconStart
=
false
;
116
}
117
if
(
m_CH_UnconEnd
)
118
{
119
Uncon_End
();
120
m_CH_UnconEnd
=
false
;
121
}
122
}
123
124
//---------------------------------------------------
125
// Commands start functions
126
127
void
Death_Start
()
128
{
129
DayZPlayer
player =
DayZPlayer
.Cast(
g_Game
.GetPlayer() );
130
if
( !player )
131
return
;
132
133
int
deathType =
m_DeathTypeCB
.GetCurrentItem();
134
if
( deathType > 0 )
135
deathType += 9;
136
137
float
deathDirection =
m_DeathDirectionEdit
.GetText().ToInt();
138
139
140
player.StartCommand_Death(deathType, deathDirection,
HumanCommandDeathCallback
);
141
}
142
143
void
Hit_Start
()
144
{
145
DayZPlayer
player =
DayZPlayer
.Cast(
g_Game
.GetPlayer() );
146
if
( !player )
147
return
;
148
149
float
hitDirection =
m_DeathDirectionEdit
.GetText().ToInt();
150
int
hitType =
m_HitTypeCB
.GetCurrentItem();
151
if
( hitType == 0 )
152
{
153
player.AddCommandModifier_Damage(0, hitDirection);
154
}
155
else
156
{
157
player.StartCommand_Damage(0, hitDirection);
158
}
159
}
160
161
void
Uncon_Start
()
162
{
163
DayZPlayerImplement
player =
DayZPlayerImplement
.Cast(
g_Game
.GetPlayer() );
164
if
( !player )
165
return
;
166
167
int
type =
m_UnconTypeCB
.GetCurrentItem();
168
169
player.m_UnconsciousDebug =
true
;
170
player.StartCommand_Unconscious(type);
171
}
172
173
void
Uncon_End
()
174
{
175
DayZPlayerImplement
player =
DayZPlayerImplement
.Cast(
g_Game
.GetPlayer() );
176
if
( !player )
177
return
;
178
179
player.m_UnconsciousDebug =
false
;
180
HumanCommandUnconscious
hcu = player.GetCommand_Unconscious();
181
if
( hcu )
182
hcu.
WakeUp
();
183
}
184
}
DayZPlayer
Definition
dayzplayerimplement.c:87
DayZPlayerImplement
Definition
manbase.c:2
EditBoxWidget
Definition
enwidgets.c:354
HumanCommandDeathCallback
Definition
human.c:596
HumanCommandUnconscious
Definition
human.c:620
HumanCommandUnconscious::WakeUp
proto native void WakeUp(int targetStance=-1)
PluginDayzPlayerDebug_OtherCmds::Death_Start
void Death_Start()
Definition
plugindayzplayerdebug_othercmds.c:127
PluginDayzPlayerDebug_OtherCmds::m_DeathDirectionEdit
EditBoxWidget m_DeathDirectionEdit
Definition
plugindayzplayerdebug_othercmds.c:11
PluginDayzPlayerDebug_OtherCmds::m_HitStartButton
ButtonWidget m_HitStartButton
Definition
plugindayzplayerdebug_othercmds.c:15
PluginDayzPlayerDebug_OtherCmds::Uncon_End
void Uncon_End()
Definition
plugindayzplayerdebug_othercmds.c:173
PluginDayzPlayerDebug_OtherCmds::Uncon_Start
void Uncon_Start()
Definition
plugindayzplayerdebug_othercmds.c:161
PluginDayzPlayerDebug_OtherCmds::m_UnconTypeCB
XComboBoxWidget m_UnconTypeCB
Definition
plugindayzplayerdebug_othercmds.c:17
PluginDayzPlayerDebug_OtherCmds::~PluginDayzPlayerDebug_OtherCmds
void ~PluginDayzPlayerDebug_OtherCmds()
Definition
plugindayzplayerdebug_othercmds.c:38
PluginDayzPlayerDebug_OtherCmds::m_MainWnd
Widget m_MainWnd
Definition
plugindayzplayerdebug_othercmds.c:8
PluginDayzPlayerDebug_OtherCmds::m_DeathStartButton
ButtonWidget m_DeathStartButton
Definition
plugindayzplayerdebug_othercmds.c:12
PluginDayzPlayerDebug_OtherCmds::m_CH_DeathStart
bool m_CH_DeathStart
Definition
plugindayzplayerdebug_othercmds.c:22
PluginDayzPlayerDebug_OtherCmds::m_HitTypeCB
XComboBoxWidget m_HitTypeCB
Definition
plugindayzplayerdebug_othercmds.c:14
PluginDayzPlayerDebug_OtherCmds::m_CH_UnconEnd
bool m_CH_UnconEnd
Definition
plugindayzplayerdebug_othercmds.c:25
PluginDayzPlayerDebug_OtherCmds::m_UnconStartButton
ButtonWidget m_UnconStartButton
Definition
plugindayzplayerdebug_othercmds.c:18
PluginDayzPlayerDebug_OtherCmds::m_DeathTypeCB
XComboBoxWidget m_DeathTypeCB
Definition
plugindayzplayerdebug_othercmds.c:10
PluginDayzPlayerDebug_OtherCmds::m_CH_UnconStart
bool m_CH_UnconStart
Definition
plugindayzplayerdebug_othercmds.c:24
PluginDayzPlayerDebug_OtherCmds::OnClick
bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Definition
plugindayzplayerdebug_othercmds.c:66
PluginDayzPlayerDebug_OtherCmds::CommandHandler
void CommandHandler()
Definition
plugindayzplayerdebug_othercmds.c:100
PluginDayzPlayerDebug_OtherCmds::DestroyModuleWidgets
void DestroyModuleWidgets()
Definition
plugindayzplayerdebug_othercmds.c:58
PluginDayzPlayerDebug_OtherCmds::Hit_Start
void Hit_Start()
Definition
plugindayzplayerdebug_othercmds.c:143
PluginDayzPlayerDebug_OtherCmds::CreateModuleWidgets
void CreateModuleWidgets()
Definition
plugindayzplayerdebug_othercmds.c:44
PluginDayzPlayerDebug_OtherCmds::PluginDayzPlayerDebug_OtherCmds
void PluginDayzPlayerDebug_OtherCmds(Widget pMainWnd)
Definition
plugindayzplayerdebug_othercmds.c:31
PluginDayzPlayerDebug_OtherCmds::m_CH_HitStart
bool m_CH_HitStart
Definition
plugindayzplayerdebug_othercmds.c:23
PluginDayzPlayerDebug_OtherCmds::m_UnconEndButton
ButtonWidget m_UnconEndButton
Definition
plugindayzplayerdebug_othercmds.c:19
Widget
Definition
enwidgets.c:190
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
Print
proto void Print(void var)
Prints content of variable to console/log.
x
Icon x
y
Icon y
Games
Dayz
scripts
4_world
plugins
pluginbase
plugindayzplayerdebug_othercmds.c
Generated by
1.17.0