DayZ
1.24
Loading...
Searching...
No Matches
PluginDayzPlayerDebug_Weapons.c
Go to the documentation of this file.
1
2
// *************************************************************************************
3
// ! PluginDayzPlayerWeaponsDebugUserData
4
// *************************************************************************************
5
class
PluginDayzPlayerWeaponsDebugUserData
6
{
7
void
PluginDayzPlayerWeaponsDebugUserData
(
int
pAction
,
int
pActionType
)
8
{
9
m_iAction
=
pAction
;
10
m_iActionT
=
pActionType
;
11
}
12
13
14
int
GetAction
()
15
{
16
return
m_iAction
;
17
}
18
19
int
GetActionType
()
20
{
21
return
m_iActionT
;
22
}
23
24
25
protected
int
m_iAction
;
26
protected
int
m_iActionT
;
27
}
28
29
30
// *************************************************************************************
31
// ! PluginDayzPlayerDebug_AbilityConfig
32
// *************************************************************************************
33
class
PluginDayzPlayerDebug_AbilityConfig
34
{
35
void
PluginDayzPlayerDebug_AbilityConfig
(
string
pName
,
int
pAction
,
int
pActionT
)
36
{
37
m_Name
=
pName
;
38
m_iAction
=
pAction
;
39
m_iActionT
=
pActionT
;
40
}
41
42
string
m_Name
;
43
int
m_iAction
;
44
int
m_iActionT
;
45
};
46
47
48
// *************************************************************************************
49
// ! PluginDayzPlayerDebug
50
// *************************************************************************************
51
class
PluginDayzPlayerDebug_Weapons
52
{
53
Widget
m_MainWnd
;
54
55
TextListboxWidget
m_Selector
;
56
ButtonWidget
m_ButtonStart
;
57
TextWidget
m_WidgetActionRunning
;
58
TextWidget
m_WidgetActionEvents
;
59
Weapon_Base
m_CurrentWeapon
;
60
EditBoxWidget
m_SetInitStateI
;
61
ButtonWidget
m_SetInitStateB
;
62
ButtonWidget
m_WeaponChange
;
63
ButtonWidget
m_WeaponHide
;
64
EditBoxWidget
m_WeaponSlotH
;
65
EditBoxWidget
m_WeaponSlotS
;
66
EditBoxWidget
m_WeaponActionProgressStart
;
67
EditBoxWidget
m_WeaponActionProgressEnd
;
68
69
// command handler properties
70
int
m_CH_WeapAction
= -1;
71
int
m_CH_WeapActionType
= -1;
72
int
m_CH_LastWeapAction
= -1;
73
int
m_CH_LastWeapActionType
= -1;
74
float
m_CH_WeapActionProgressStart
= 0;
75
float
m_CH_WeapActionProgressEnd
= 1;
76
77
string
m_CH_WeaponChangeI
;
78
int
m_CH_WeaponChangeSlotH
= -1;
79
int
m_CH_WeaponChangeSlotS
= -1;
80
81
//---------------------------------------------------
82
//
83
85
ref
array<ref PluginDayzPlayerDebug_AbilityConfig>
m_AbilityConfig
= {
86
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload Mag Bullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADRIFLE_MAGAZINE_BULLET),
87
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload NoMag Buller"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADRIFLE_NOMAGAZINE_BULLET),
88
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload Mag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADRIFLE_MAGAZINE_NOBULLET),
89
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload NoMag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADRIFLE_NOMAGAZINE_NOBULLET),
90
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload Mag NoBullet lock"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADRIFLE_MAGAZINE_NOBULLET_OPEN),
91
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload NoMag NoBullet lock"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADRIFLE_NOMAGAZINE_NOBULLET_OPEN),
92
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload Clip NoBullet"
,
WeaponActions
.RELOAD_CLIP,
WeaponActionReloadClipTypes
.RELOADRIFLE_CLIP_NOBULLET),
93
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle - Reload Clip Bullet"
,
WeaponActions
.RELOAD_CLIP,
WeaponActionReloadClipTypes
.RELOADRIFLE_CLIP_BULLET),
94
95
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Closed - Reload Mag Bullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_MAGAZINE_BULLET_CLOSED),
96
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Closed - Reload NoMag Bullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_NOMAGAZINE_BULLET_CLOSED),
97
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Closed Charged - Reload Mag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_COCKED),
98
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Closed Charged - Reload NoMag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_COCKED),
99
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Closed Discharged - Reload Mag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_UNCOCKED),
100
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Closed Discharged - Reload NoMag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_UNCOCKED),
101
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Opened - Reload NoMag "
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_NOMAGAZINE_NOBULLET_OPENED),
102
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Opened - Reload Mag "
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADPISTOL_MAGAZINE_NOBULLET_OPENED),
103
104
PluginDayzPlayerDebug_AbilityConfig
(
"Pistol Detach Magazine"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOAD_MAGAZINE_DETACH),
105
PluginDayzPlayerDebug_AbilityConfig
(
"Rifle Detach Magazine"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADRIFLE_MAGAZINE_DETACH),
106
107
PluginDayzPlayerDebug_AbilityConfig
(
"Sp Rifle - Reload Mag Bullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADSRIFLE_MAGAZINE_BULLET),
108
PluginDayzPlayerDebug_AbilityConfig
(
"Sp Rifle - Reload NoMag Buller"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADSRIFLE_NOMAGAZINE_BULLET),
109
PluginDayzPlayerDebug_AbilityConfig
(
"Sp Rifle - Reload Mag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADSRIFLE_MAGAZINE_NOBULLET),
110
PluginDayzPlayerDebug_AbilityConfig
(
"Sp Rifle - Reload NoMag NoBullet"
,
WeaponActions
.RELOAD,
WeaponActionReloadTypes
.RELOADSRIFLE_NOMAGAZINE_NOBULLET),
111
112
PluginDayzPlayerDebug_AbilityConfig
(
"Mechanism Opened"
,
WeaponActions
.MECHANISM,
WeaponActionMechanismTypes
.MECHANISM_OPENED),
113
PluginDayzPlayerDebug_AbilityConfig
(
"Mechanism Closed"
,
WeaponActions
.MECHANISM,
WeaponActionMechanismTypes
.MECHANISM_CLOSED),
114
PluginDayzPlayerDebug_AbilityConfig
(
"Mechanism Spec"
,
WeaponActions
.MECHANISM,
WeaponActionMechanismTypes
.MECHANISM_SPECIAL),
115
PluginDayzPlayerDebug_AbilityConfig
(
"Mechanism Closed Uncocked"
,
WeaponActions
.MECHANISM,
WeaponActionMechanismTypes
.MECHANISM_CLOSED_UNCOCKED),
116
117
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 1 Bullet Opened"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_ONEBULLET_OPENED),
118
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 1 Bullet Closed"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_ONEBULLET_CLOSED),
119
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 1 Bullet Unique Opened"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_ONEBULLET_UNIQUE_OPENED),
120
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 1 Bullet Unique Closed"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_ONEBULLET_UNIQUE_CLOSED),
121
122
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 2 Bullets Start"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_TWOBULLETS_START),
123
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 2 Bullets End"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_TWOBULLETS_END),
124
125
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loopable Start Closed"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_STARTLOOPABLE_CLOSED),
126
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loopable Start Closed keep bullet"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_STARTLOOPABLE_CLOSED_KEEP),
127
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loopable Start Opened"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_STARTLOOPABLE_OPENED),
128
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loopable End"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_ENDLOOPABLE),
129
130
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loopable Shotgun Start Uncocked"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_STARTLOOPABLE_SHOTGUN_UNCOCKED),
131
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loopable Shotgun Start Cocked"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_STARTLOOPABLE_SHOTGUN_COCKED),
132
133
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 1"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_DOUBLE_1),
134
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 2"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_DOUBLE_2),
135
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 3"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_DOUBLE_3),
136
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb 4"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_DOUBLE_4),
137
138
PluginDayzPlayerDebug_AbilityConfig
(
"Crossbow Opened"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_CROSSBOW_OPENED),
139
PluginDayzPlayerDebug_AbilityConfig
(
"Crossbow Close"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_CROSSBOW_CLOSED),
140
PluginDayzPlayerDebug_AbilityConfig
(
"Crossbow Full"
,
WeaponActions
.CHAMBERING,
WeaponActionChamberingTypes
.CHAMBERING_CROSSBOW_FULL),
141
142
PluginDayzPlayerDebug_AbilityConfig
(
"INTERRUPT"
,
WeaponActions
.INTERRUPT, -1),
143
144
145
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loader 1 Bullet Opened"
,
WeaponActions
.CHAMBERING_LOADER,
WeaponActionChamberingLoaderTypes
.CHAMBERINGLOADER_OPENED),
146
PluginDayzPlayerDebug_AbilityConfig
(
"Chamb Loader 1 Bullet Closed"
,
WeaponActions
.CHAMBERING_LOADER,
WeaponActionChamberingLoaderTypes
.CHAMBERINGLOADER_CLOSED),
147
148
PluginDayzPlayerDebug_AbilityConfig
(
"Unjamming Start"
,
WeaponActions
.UNJAMMING,
WeaponActionUnjammingTypes
.UNJAMMING_START),
149
PluginDayzPlayerDebug_AbilityConfig
(
"Unjamming End"
,
WeaponActions
.UNJAMMING,
WeaponActionUnjammingTypes
.UNJAMMING_END),
150
PluginDayzPlayerDebug_AbilityConfig
(
"Unjamming Interrupt"
,
WeaponActions
.UNJAMMING,
WeaponActionUnjammingTypes
.UNJAMMING_INTERRUPT),
151
152
PluginDayzPlayerDebug_AbilityConfig
(
"Fire Normal"
,
WeaponActions
.FIRE,
WeaponActionFireTypes
.FIRE_NORMAL),
153
PluginDayzPlayerDebug_AbilityConfig
(
"Fire Last"
,
WeaponActions
.FIRE,
WeaponActionFireTypes
.FIRE_LAST),
154
PluginDayzPlayerDebug_AbilityConfig
(
"Fire Empty Cocked"
,
WeaponActions
.FIRE,
WeaponActionFireTypes
.FIRE_COCKED),
155
PluginDayzPlayerDebug_AbilityConfig
(
"Fire Empty Uncocked"
,
WeaponActions
.FIRE,
WeaponActionFireTypes
.FIRE_UNCOCKED),
156
PluginDayzPlayerDebug_AbilityConfig
(
"Fire and Jam"
,
WeaponActions
.FIRE,
WeaponActionFireTypes
.FIRE_JAM),
157
PluginDayzPlayerDebug_AbilityConfig
(
"Fire Dry"
,
WeaponActions
.FIRE,
WeaponActionFireTypes
.FIRE_DRY),
158
159
};
160
161
162
int
FindAbilityConfig
(
int
pAction
,
int
pActionT
)
163
{
164
int
l
=
m_AbilityConfig
.Count();
165
for
(
int
i
= 0;
i
<
l
;
i
++)
166
{
167
if
(
m_AbilityConfig
[
i
].
m_iAction
==
pAction
&&
m_AbilityConfig
[
i
].
m_iActionT
==
pActionT
)
168
return
i
;
169
}
170
return
-1;
171
}
172
173
174
//---------------------------------------------------
175
// gui stuff
176
177
void
PluginDayzPlayerDebug_Weapons
(
Widget
pMainWnd
)
178
{
179
m_MainWnd
=
pMainWnd
;
180
181
CreateModuleWidgets
();
182
184
DayZPlayer
player
=
DayZPlayer
.Cast(
GetGame
().
GetPlayer
());
185
if
(
player
)
186
{
187
HumanCommandWeapons
hcw
=
player
.GetCommandModifier_Weapons();
188
hcw
.DebugResetEvents();
189
}
190
}
191
192
193
void
~PluginDayzPlayerDebug_Weapons
()
194
{
195
DestroyModuleWidgets
();
196
}
197
198
199
void
CreateModuleWidgets
()
200
{
201
m_Selector
=
TextListboxWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapActionSelector"
));
202
m_ButtonStart
=
ButtonWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapActionStart"
));
203
204
m_WidgetActionRunning
=
TextWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapActionRunning"
));
205
m_WidgetActionEvents
=
TextWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapActionEvents"
));
206
207
m_SetInitStateI
=
EditBoxWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapInitStateI"
));
208
m_SetInitStateB
=
ButtonWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapInitStateB"
));
209
210
m_WeaponChange
=
ButtonWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapChange"
));
211
m_WeaponHide
=
ButtonWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapHide"
));
212
m_WeaponSlotH
=
EditBoxWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeaponChangeSlotH"
));
213
m_WeaponSlotS
=
EditBoxWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeaponChangeSlotS"
));
214
m_WeaponActionProgressStart
=
EditBoxWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapActionProgressStart"
));
215
m_WeaponActionProgressEnd
=
EditBoxWidget
.Cast(
m_MainWnd
.FindAnyWidget(
"WeapActionProgressEnd"
));
216
217
218
m_WidgetActionEvents
.SetText(
"Events:"
);
219
220
}
221
222
void
DestroyModuleWidgets
()
223
{
224
}
225
226
227
//---------------------------------------------------
228
// main update
229
230
231
void
Tick
()
232
{
233
DayZPlayer
player
=
DayZPlayer
.Cast(
GetGame
().
GetPlayer
());
234
if
(!
player
)
235
return
;
236
237
if
(
player
)
238
{
239
EntityAI
entityInHands
=
player
.GetHumanInventory().GetEntityInHands();
240
Weapon_Base
w
;
241
if
(
Class
.
CastTo
(
w
,
entityInHands
))
242
{
243
if
(
m_CurrentWeapon
!=
w
)
244
WeaponsInit
(
w
);
245
}
246
else
247
m_Selector
.ClearItems();
248
}
249
251
HumanCommandWeapons
hcw
=
player
.GetCommandModifier_Weapons();
252
253
string
text
=
"Action: "
+
hcw
.GetRunningAction().ToString() +
" "
+
hcw
.GetRunningActionType().ToString();
254
m_WidgetActionRunning
.SetText(
text
);
255
256
257
int
aEvent
=
hcw
.DebugIsEvent();
258
if
(
aEvent
!= -1)
259
{
260
string
eventStr
=
"Event: "
;
261
eventStr
=
eventStr
+
aEvent
.ToString() +
" "
;
262
while
(
true
)
263
{
264
aEvent
=
hcw
.DebugIsEvent();
265
if
(
aEvent
== -1)
266
break
;
267
268
Print
(
"Event: "
+
aEvent
.ToString());
269
270
eventStr
+=
aEvent
.ToString();
271
eventStr
+=
" "
;
272
}
273
274
m_WidgetActionEvents
.SetText(
eventStr
);
275
}
276
}
277
278
279
//---------------------------------------------------
280
// Actions
281
282
void
WeaponsInit
(
Weapon_Base
w
)
283
{
284
285
m_Selector
.ClearItems();
286
288
int
abilityCount
=
w
.GetAbilityCount();
289
290
for
(
int
i
= 0;
i
<
abilityCount
; ++
i
)
291
{
292
AbilityRecord
rec
=
w
.GetAbility(
i
);
293
int
abConfigIndex
=
FindAbilityConfig
(
rec
.m_action,
rec
.m_actionType);
294
if
(
abConfigIndex
!= -1)
295
m_Selector
.AddItem(
m_AbilityConfig
[
abConfigIndex
].
m_Name
,
new
PluginDayzPlayerWeaponsDebugUserData
(
rec
.m_action,
rec
.m_actionType), 0);
296
}
297
298
m_Selector
.AddItem(
"=========== All - not safe ========="
,
NULL
, 0);
299
300
301
// if (abilityCount == 0)
302
{
303
int
l
=
m_AbilityConfig
.Count();
304
for
(
int
a = 0; a <
l
; a++)
305
m_Selector
.AddItem(
m_AbilityConfig
[a].m_Name,
new
PluginDayzPlayerWeaponsDebugUserData
(
m_AbilityConfig
[a].
m_iAction
,
m_AbilityConfig
[a].
m_iActionT
), 0);
306
}
307
308
m_CurrentWeapon
=
w
;
309
}
310
311
313
void
WeaponsStartAction
()
314
{
315
int
row
=
m_Selector
.GetSelectedRow();
316
if
(
row
== -1)
317
return
;
318
319
PluginDayzPlayerWeaponsDebugUserData
userData
;
320
m_Selector
.GetItemData(
row
, 0,
userData
);
321
if
(
userData
)
322
{
323
m_CH_WeapAction
=
userData
.GetAction();
324
m_CH_WeapActionType
=
userData
.GetActionType();
325
m_CH_WeapActionProgressStart
=
m_WeaponActionProgressStart
.GetText().ToFloat();
326
m_CH_WeapActionProgressEnd
=
m_WeaponActionProgressEnd
.GetText().ToFloat();
327
328
Print
(
"DayzPlayerImplement_Weapons::WeaponsStartAction"
);
329
}
330
}
331
332
333
//---------------------------------------------------
334
// window ui clicks
335
337
bool
OnClick
(
Widget
w
,
int
x
,
int
y
,
int
button
)
338
{
339
if
(
w
==
m_ButtonStart
)
340
{
341
WeaponsStartAction
();
342
return
true
;
343
}
344
else
if
(
w
==
m_SetInitStateB
)
345
{
346
int
frameI
=
m_SetInitStateI
.GetText().ToInt();
347
348
DayZPlayer
player
=
DayZPlayer
.Cast(
GetGame
().
GetPlayer
());
349
350
HumanCommandWeapons
hcw
=
player
.GetCommandModifier_Weapons();
351
hcw
.SetInitState(
frameI
);
352
}
353
else
if
(
w
==
m_WeaponChange
)
354
{
355
Print
(
"Weapon Change pressed"
);
356
357
Dispatcher
d
=
GetDispatcher
();
358
if
(
d
==
null
)
359
{
360
Print
(
"No dispatcher - cannot get selected weapon"
);
361
return
false
;
362
}
363
364
Param
p
=
d
.CallMethod(
CALL_ID_SCR_CNSL_GETSELECTEDITEM
,
null
);
365
if
(
p
==
null
)
366
{
367
Print
(
"No selected object"
);
368
return
false
;
369
}
370
371
Param1<string>
p1
=
Param1<string>
.Cast(
p
);
372
Print
(
p1
.param1);
373
374
m_CH_WeaponChangeI
=
p1
.param1;
375
m_CH_WeaponChangeSlotH
=
m_WeaponSlotH
.GetText().ToInt();
376
m_CH_WeaponChangeSlotS
=
m_WeaponSlotS
.GetText().ToInt();
377
}
378
else
if
(
w
==
m_WeaponHide
)
379
{
380
m_CH_WeaponChangeI
=
""
;
381
m_CH_WeaponChangeSlotH
=
m_WeaponSlotH
.GetText().ToInt();
382
m_CH_WeaponChangeSlotS
=
m_WeaponSlotS
.GetText().ToInt();
383
}
384
385
386
return
false
;
387
}
388
389
//---------------------------------------------------
390
// Global handler to handle commands from player
391
392
bool
IsWeaponChange
(
out
string
pNewWeapon
,
out
int
pHideSlot
,
out
int
pShowSlot
)
393
{
394
if
(
m_CH_WeaponChangeSlotH
== -1)
395
return
false
;
396
397
pNewWeapon
=
m_CH_WeaponChangeI
;
398
pHideSlot
=
m_CH_WeaponChangeSlotH
;
399
pShowSlot
=
m_CH_WeaponChangeSlotS
;
400
401
m_CH_WeaponChangeSlotH
= -1;
402
m_CH_WeaponChangeSlotS
= -1;
403
404
return
true
;
405
}
406
407
408
//---------------------------------------------------
409
// Global handler to handle commands from player
410
411
void
CommandHandler
()
412
{
413
414
// last action again
415
if
(
KeyState
(
KeyCode
.KC_MULTIPLY) == 1)
416
{
417
ClearKey
(
KeyCode
.KC_MULTIPLY);
418
m_CH_WeapAction
=
m_CH_LastWeapAction
;
419
m_CH_WeapActionType
=
m_CH_LastWeapActionType
;
420
421
Print
(
"DayzPlayerImplement_Weapons OnKC_MULTIPLY"
);
422
}
423
424
425
if
(
m_CH_WeapAction
>= 0)
426
{
427
m_CH_LastWeapAction
=
m_CH_WeapAction
;
428
m_CH_LastWeapActionType
=
m_CH_WeapActionType
;
429
431
DayZPlayer
player
=
DayZPlayer
.Cast(
GetGame
().
GetPlayer
());
432
if
(
player
!=
NULL
)
433
{
434
HumanCommandWeapons
hcw
=
player
.GetCommandModifier_Weapons();
435
hcw
.SetActionProgressParams(
m_CH_WeapActionProgressStart
,
m_CH_WeapActionProgressEnd
);
436
hcw
.StartAction(
m_CH_WeapAction
,
m_CH_WeapActionType
);
437
438
Print
(
"DayzPlayerImplement_Weapons::WeaponsStartAction2"
);
439
440
}
441
442
m_CH_WeapAction
= -1;
443
}
444
445
}
446
}
m_Name
string m_Name
Definition
BiosLobbyService.c:35
GetDispatcher
Dispatcher GetDispatcher()
Definition
Dispatcher.c:20
CALL_ID_SCR_CNSL_GETSELECTEDITEM
const CallID CALL_ID_SCR_CNSL_GETSELECTEDITEM
Definition
Dispatcher.c:11
x
Icon x
y
Icon y
GetPlayer
PlayerBase GetPlayer()
Definition
ModifierBase.c:47
m_iAction
int m_iAction
Definition
PluginDayzPlayerDebug_Weapons.c:54
PluginDayzPlayerWeaponsDebugUserData
void PluginDayzPlayerWeaponsDebugUserData(int pAction, int pActionType)
Definition
PluginDayzPlayerDebug_Weapons.c:36
m_Name
string m_Name
Definition
PluginDayzPlayerDebug_Weapons.c:42
m_iActionT
int m_iActionT
Definition
PluginDayzPlayerDebug_Weapons.c:55
PluginDayzPlayerDebug_AbilityConfig
class PluginDayzPlayerWeaponsDebugUserData PluginDayzPlayerDebug_AbilityConfig(string pName, int pAction, int pActionT)
Definition
PluginDayzPlayerDebug_Weapons.c:35
AbilityRecord
pair ( action, actionType )
Definition
Weapon_Base.c:5
Class
Super root of all classes in Enforce script.
Definition
EnScript.c:11
DayZPlayer
Definition
DayZPlayerImplement.c:71
Dispatcher
Definition
Dispatcher.c:14
EditBoxWidget
Definition
EnWidgets.c:354
EntityAI
Definition
Building.c:6
HumanCommandWeapons
Definition
human.c:974
Param3
Definition
EntityAI.c:95
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition
param.c:12
PluginDayzPlayerDebug_Weapons
Definition
PluginDayzPlayerDebug_Weapons.c:52
PluginDayzPlayerDebug_Weapons::m_ButtonStart
ButtonWidget m_ButtonStart
Definition
PluginDayzPlayerDebug_Weapons.c:56
PluginDayzPlayerDebug_Weapons::WeaponsInit
void WeaponsInit(Weapon_Base w)
Definition
PluginDayzPlayerDebug_Weapons.c:282
PluginDayzPlayerDebug_Weapons::m_WeaponSlotS
EditBoxWidget m_WeaponSlotS
Definition
PluginDayzPlayerDebug_Weapons.c:65
PluginDayzPlayerDebug_Weapons::WeaponsStartAction
void WeaponsStartAction()
Definition
PluginDayzPlayerDebug_Weapons.c:313
PluginDayzPlayerDebug_Weapons::m_CH_WeapActionProgressStart
float m_CH_WeapActionProgressStart
Definition
PluginDayzPlayerDebug_Weapons.c:74
PluginDayzPlayerDebug_Weapons::m_WidgetActionRunning
TextWidget m_WidgetActionRunning
Definition
PluginDayzPlayerDebug_Weapons.c:57
PluginDayzPlayerDebug_Weapons::m_CH_WeaponChangeI
string m_CH_WeaponChangeI
Definition
PluginDayzPlayerDebug_Weapons.c:77
PluginDayzPlayerDebug_Weapons::m_CurrentWeapon
Weapon_Base m_CurrentWeapon
Definition
PluginDayzPlayerDebug_Weapons.c:59
PluginDayzPlayerDebug_Weapons::m_WeaponActionProgressStart
EditBoxWidget m_WeaponActionProgressStart
Definition
PluginDayzPlayerDebug_Weapons.c:66
PluginDayzPlayerDebug_Weapons::FindAbilityConfig
int FindAbilityConfig(int pAction, int pActionT)
Definition
PluginDayzPlayerDebug_Weapons.c:162
PluginDayzPlayerDebug_Weapons::m_CH_WeapAction
int m_CH_WeapAction
Definition
PluginDayzPlayerDebug_Weapons.c:70
PluginDayzPlayerDebug_Weapons::~PluginDayzPlayerDebug_Weapons
void ~PluginDayzPlayerDebug_Weapons()
Definition
PluginDayzPlayerDebug_Weapons.c:193
PluginDayzPlayerDebug_Weapons::m_CH_WeapActionProgressEnd
float m_CH_WeapActionProgressEnd
Definition
PluginDayzPlayerDebug_Weapons.c:75
PluginDayzPlayerDebug_Weapons::m_MainWnd
Widget m_MainWnd
Definition
PluginDayzPlayerDebug_Weapons.c:53
PluginDayzPlayerDebug_Weapons::m_WidgetActionEvents
TextWidget m_WidgetActionEvents
Definition
PluginDayzPlayerDebug_Weapons.c:58
PluginDayzPlayerDebug_Weapons::OnClick
bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Definition
PluginDayzPlayerDebug_Weapons.c:337
PluginDayzPlayerDebug_Weapons::m_AbilityConfig
ref array< ref PluginDayzPlayerDebug_AbilityConfig > m_AbilityConfig
Definition
PluginDayzPlayerDebug_Weapons.c:85
PluginDayzPlayerDebug_Weapons::IsWeaponChange
bool IsWeaponChange(out string pNewWeapon, out int pHideSlot, out int pShowSlot)
Definition
PluginDayzPlayerDebug_Weapons.c:392
PluginDayzPlayerDebug_Weapons::m_SetInitStateI
EditBoxWidget m_SetInitStateI
Definition
PluginDayzPlayerDebug_Weapons.c:60
PluginDayzPlayerDebug_Weapons::m_CH_WeapActionType
int m_CH_WeapActionType
Definition
PluginDayzPlayerDebug_Weapons.c:71
PluginDayzPlayerDebug_Weapons::m_Selector
TextListboxWidget m_Selector
Definition
PluginDayzPlayerDebug_Weapons.c:55
PluginDayzPlayerDebug_Weapons::m_CH_LastWeapActionType
int m_CH_LastWeapActionType
Definition
PluginDayzPlayerDebug_Weapons.c:73
PluginDayzPlayerDebug_Weapons::m_CH_LastWeapAction
int m_CH_LastWeapAction
Definition
PluginDayzPlayerDebug_Weapons.c:72
PluginDayzPlayerDebug_Weapons::m_WeaponActionProgressEnd
EditBoxWidget m_WeaponActionProgressEnd
Definition
PluginDayzPlayerDebug_Weapons.c:67
PluginDayzPlayerDebug_Weapons::m_SetInitStateB
ButtonWidget m_SetInitStateB
Definition
PluginDayzPlayerDebug_Weapons.c:61
PluginDayzPlayerDebug_Weapons::Tick
void Tick()
Definition
PluginDayzPlayerDebug_Weapons.c:231
PluginDayzPlayerDebug_Weapons::m_WeaponChange
ButtonWidget m_WeaponChange
Definition
PluginDayzPlayerDebug_Weapons.c:62
PluginDayzPlayerDebug_Weapons::CreateModuleWidgets
void CreateModuleWidgets()
Definition
PluginDayzPlayerDebug_Weapons.c:199
PluginDayzPlayerDebug_Weapons::m_CH_WeaponChangeSlotS
int m_CH_WeaponChangeSlotS
Definition
PluginDayzPlayerDebug_Weapons.c:79
PluginDayzPlayerDebug_Weapons::DestroyModuleWidgets
void DestroyModuleWidgets()
Definition
PluginDayzPlayerDebug_Weapons.c:222
PluginDayzPlayerDebug_Weapons::m_WeaponHide
ButtonWidget m_WeaponHide
Definition
PluginDayzPlayerDebug_Weapons.c:63
PluginDayzPlayerDebug_Weapons::m_CH_WeaponChangeSlotH
int m_CH_WeaponChangeSlotH
Definition
PluginDayzPlayerDebug_Weapons.c:78
PluginDayzPlayerDebug_Weapons::m_WeaponSlotH
EditBoxWidget m_WeaponSlotH
Definition
PluginDayzPlayerDebug_Weapons.c:64
PluginDayzPlayerDebug_Weapons::CommandHandler
void CommandHandler()
Definition
PluginDayzPlayerDebug_Weapons.c:411
PluginDayzPlayerDebug_Weapons::PluginDayzPlayerDebug_Weapons
void PluginDayzPlayerDebug_Weapons(Widget pMainWnd)
Definition
PluginDayzPlayerDebug_Weapons.c:177
PluginDayzPlayerWeaponsDebugUserData
Definition
PluginDayzPlayerDebug_Weapons.c:6
PluginDayzPlayerWeaponsDebugUserData::m_iActionT
int m_iActionT
Definition
PluginDayzPlayerDebug_Weapons.c:26
PluginDayzPlayerWeaponsDebugUserData::PluginDayzPlayerWeaponsDebugUserData
void PluginDayzPlayerWeaponsDebugUserData(int pAction, int pActionType)
Definition
PluginDayzPlayerDebug_Weapons.c:7
PluginDayzPlayerWeaponsDebugUserData::m_iAction
int m_iAction
Definition
PluginDayzPlayerDebug_Weapons.c:25
PluginDayzPlayerWeaponsDebugUserData::GetAction
int GetAction()
Definition
PluginDayzPlayerDebug_Weapons.c:14
PluginDayzPlayerWeaponsDebugUserData::GetActionType
int GetActionType()
Definition
PluginDayzPlayerDebug_Weapons.c:19
TextWidget
Definition
EnWidgets.c:220
Weapon_Base
shorthand
Definition
BoltActionRifle_Base.c:6
Widget
Definition
EnWidgets.c:190
GetGame
proto native CGame GetGame()
Print
proto void Print(void var)
Prints content of variable to console/log.
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
ClearKey
proto native void ClearKey(KeyCode key)
KeyCode
KeyCode
Definition
EnSystem.c:157
KeyState
proto native int KeyState(KeyCode key)
WeaponActionReloadClipTypes
WeaponActionReloadClipTypes
Definition
human.c:841
WeaponActionChamberingTypes
WeaponActionChamberingTypes
Definition
human.c:856
WeaponActions
WeaponActions
actions
Definition
human.c:796
WeaponActionChamberingLoaderTypes
WeaponActionChamberingLoaderTypes
Definition
human.c:886
WeaponActionReloadTypes
WeaponActionReloadTypes
Definition
human.c:812
WeaponActionUnjammingTypes
WeaponActionUnjammingTypes
Definition
human.c:892
WeaponActionFireTypes
WeaponActionFireTypes
Definition
human.c:900
scripts
4_World
Plugins
PluginBase
PluginDayzPlayerDebug_Weapons.c
Generated by
1.10.0