Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
radialmenu.c
Go to the documentation of this file.
1
enum
RadialMenuControlType
2
{
3
MOUSE
,
4
CONTROLLER
5
}
6
7
class
RadialMenu
:
ScriptedWidgetEventHandler
8
{
9
protected
Widget
m_Parent
;
10
protected
Widget
m_ItemCardsContainer
;
11
protected
Widget
m_RadialSelector
;
12
protected
ImageWidget
m_RadialSelectorImage
;
13
protected
ImageWidget
m_RadialSelectorPointerImage
;
14
protected
int
m_RadialSelectorOriginalColor
;
15
protected
int
m_RadialSelectorDisabledColor
;
16
protected
Widget
m_SelectedObject
;
17
protected
ref
map<Widget, float>
m_RadialItemCards
;
18
19
protected
float
m_AngleRadOffset
;
20
protected
ref
Timer
m_UpdateTimer
;
21
22
//widget
23
static
const
string
RADIAL_SELECTOR
=
"RadialSelector"
;
24
static
const
string
RADIAL_SELECTOR_IMAGE
=
"SelectorImage"
;
25
static
const
string
RADIAL_SELECTOR_POINTER
=
"SelectorPointer"
;
26
static
const
string
RADIAL_DELIMITER_CONTAINER
=
"RadialDelimiterContainer"
;
27
static
const
string
RADIAL_ITEM_CARD_CONTAINER
=
"RadialItemCardContainer"
;
28
29
//controls
30
protected
RadialMenuControlType
m_ControlType
;
31
private
UAIDWrapper
m_SelectInputWrapper
;
32
private
UAIDWrapper
m_BackInputWrapper
;
33
protected
float
m_ControllerAngle
;
34
protected
float
m_ControllerTilt
;
35
36
//controller
37
protected
int
m_ControllerTimout
;
38
protected
bool
m_IsControllerTimoutEnabled
=
true
;
//enables/disables controller deselect timeout reset
39
protected
const
float
CONTROLLER_DESELECT_TIMEOUT
= 1000;
//timeout [ms] after which selection is automatically deselect when controller is not active
40
protected
const
float
CONTROLLER_TILT_TRESHOLD_SELECT
= 0.8;
//tilt value (0.0-1.0) for controller sticks after which the selection will be selected
41
protected
const
float
CONTROLLER_TILT_TRESHOLD_EXECUTE
= 1.0;
//tilt value (0.0-1.0) for controller sticks after which the selection will be executed
42
43
//mouse
44
protected
bool
m_WidgetInitialized
;
45
protected
const
float
MOUSE_SAFE_ZONE_RADIUS
= 120;
//Radius [px] of safe zone where every previous selection is deselected
46
47
//References
48
protected
float
m_RadiusOffset
;
//Radius [% of the main container size]
49
protected
float
m_ExecuteDistanceOffset
;
//Distance offset [% of the main container size] after which the selection will be automatically executed
50
protected
float
m_OffsetFromTop
;
//first item in the menu won't be directly on top but offset by a rad angle value (clock-wise)
51
protected
float
m_ItemCardRadiusOffset
;
//Radius [% of the main container size] for item cards
52
protected
string
m_DelimiterLayout
;
//layout file name with path
53
54
ref
UIScriptedMenu
m_RegisteredClass
;
55
ref
static
RadialMenu
m_Instance
;
56
57
/*
58
59
RADIAL MENU EVENTS
60
61
Mouse:
62
OnMouseSelect
63
OnMouseDeselect
64
OnMouseExecute - unused, press events used instead
65
OnMousePressLeft
66
OnMousePressRight
67
68
Controller:
69
OnControllerSelect
70
OnControllerDeselect
71
OnControllerExecute - unused, press events used instead
72
OnControllerPressSelect
73
OnControllerPressBack
74
75
Common:
76
OnControlsChanged - controls has been changed (mouse<->controller)
77
78
*/
79
80
81
//============================================
82
// RadialMenu
83
//============================================
84
void
RadialMenu
()
85
{
86
m_Instance
=
this
;
87
88
//set default control type
89
#ifdef PLATFORM_CONSOLE
90
Input
inp =
g_Game
.GetInput();
91
if
(inp && inp.
IsEnabledMouseAndKeyboardEvenOnServer
())
92
{
93
m_ControlType
=
RadialMenuControlType
.MOUSE;
94
}
95
else
96
{
97
m_ControlType
=
RadialMenuControlType
.CONTROLLER;
98
}
99
#endif
100
#ifdef PLATFORM_WINDOWS
101
m_ControlType
=
RadialMenuControlType
.MOUSE;
102
#endif
103
104
m_SelectInputWrapper
=
GetUApi
().
GetInputByID
(UAUISelect).
GetPersistentWrapper
();
105
m_BackInputWrapper
=
GetUApi
().
GetInputByID
(UAUIBack).
GetPersistentWrapper
();
106
107
//radial cards
108
m_RadialItemCards
=
new
map<Widget, float>
;
109
m_UpdateTimer
=
new
Timer
();
110
m_UpdateTimer
.Run(0.01,
this
,
"Update"
, NULL,
true
);
111
}
112
113
void
~RadialMenu
()
114
{
115
}
116
117
static
RadialMenu
GetInstance
()
118
{
119
return
m_Instance
;
120
}
121
122
//Set handler
123
void
OnWidgetScriptInit
(
Widget
w)
124
{
125
m_ItemCardsContainer
= w.FindAnyWidget(
RADIAL_ITEM_CARD_CONTAINER
);
126
m_RadialSelector
= w.FindAnyWidget(
RADIAL_SELECTOR
);
127
m_RadialSelectorImage
= ImageWidget.Cast(
m_RadialSelector
.FindAnyWidget(
RADIAL_SELECTOR_IMAGE
));
128
m_RadialSelectorPointerImage
= ImageWidget.Cast(
m_RadialSelector
.FindAnyWidget(
RADIAL_SELECTOR_POINTER
));
129
130
m_RadialSelectorOriginalColor
=
m_RadialSelectorImage
.GetColor();
131
m_RadialSelectorDisabledColor
=
ARGB
(255,150,150,150);
132
133
//parent
134
m_Parent
= w;
135
m_Parent
.SetHandler(
this
);
136
}
137
138
//controls
139
void
SetControlType
(
RadialMenuControlType
type)
140
{
141
if
(
m_ControlType
!= type)
142
{
143
m_ControlType
= type;
144
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnControlsChanged"
, NULL, type);
145
}
146
}
147
148
bool
IsUsingMouse
()
149
{
150
if
(
m_ControlType
==
RadialMenuControlType
.MOUSE)
151
{
152
return
true
;
153
}
154
155
return
false
;
156
}
157
158
bool
IsUsingController
()
159
{
160
if
(
m_ControlType
==
RadialMenuControlType
.CONTROLLER)
161
{
162
return
true
;
163
}
164
165
return
false
;
166
}
167
168
void
SetWidgetInitialized
(
bool
state)
169
{
170
m_WidgetInitialized
= state;
171
}
172
173
bool
IsWidgetInitialized
()
174
{
175
return
m_WidgetInitialized
;
176
}
177
178
//============================================
179
// Setup
180
//============================================
181
void
RegisterClass
(
UIScriptedMenu
class_name
)
182
{
183
m_RegisteredClass
=
class_name
;
184
if
(
m_UpdateTimer
&& !
m_UpdateTimer
.IsRunning())
185
m_UpdateTimer
.Run(0.01,
this
,
"Update"
, NULL,
true
);
186
}
187
188
//Set radial menu parameters
189
//Radius offset [% of the main container size]
190
void
SetRadiusOffset
(
float
radius_offset)
191
{
192
m_RadiusOffset
= radius_offset;
193
}
194
195
//Distance offset [% of the main container size] after which the selection will be automatically executed
196
void
SetExecuteDistOffset
(
float
execute_dist_offset)
197
{
198
m_ExecuteDistanceOffset
= execute_dist_offset;
199
}
200
201
//First item in the menu won't be directly on top but offset by a rad angle value (clock-wise)
202
void
SetOffsetFromTop
(
float
offset_from_top)
203
{
204
m_OffsetFromTop
= offset_from_top;
205
}
206
207
//Radius [% of the main container size] for item cards
208
void
SetItemCardRadiusOffset
(
float
item_card_radius_offset)
209
{
210
m_ItemCardRadiusOffset
= item_card_radius_offset;
211
}
212
213
//Enable/Disable controller timeout
214
void
ActivateControllerTimeout
(
bool
state)
215
{
216
m_IsControllerTimoutEnabled
= state;
217
}
218
219
void
SetWidgetProperties
(
string
delimiter_layout)
220
{
221
m_DelimiterLayout
= delimiter_layout;
222
}
223
224
//============================================
225
// Visual
226
//============================================
227
//hide_selector => shows/hides radial selector when refreshing radial menu
228
void
Refresh
(
bool
hide_selector =
true
)
229
{
230
int
item_cards_count =
GetItemCardsCount
();
231
if
(item_cards_count > 0)
232
m_AngleRadOffset
= 2 *
Math
.
PI
/ item_cards_count;
233
float
angle_rad = -
Math
.
PI
/ 2;
234
235
//--PARAM top offset--
236
if
(
m_OffsetFromTop
!= 0)
237
{
238
angle_rad = angle_rad +
m_OffsetFromTop
;
239
}
240
//--------------------
241
242
//delete all delimiters
243
Widget
delimiters_panel =
m_Parent
.FindAnyWidget(
RADIAL_DELIMITER_CONTAINER
);
244
if
(delimiters_panel)
245
{
246
Widget
del_child = delimiters_panel.GetChildren();
247
while
(del_child)
248
{
249
Widget
child_to_destroy1 = del_child;
250
del_child = del_child.GetSibling();
251
252
delete
child_to_destroy1;
253
}
254
}
255
256
//Position item cards, crate radial delimiters
257
Widget
item_cards_panel =
m_Parent
.FindAnyWidget(
RADIAL_ITEM_CARD_CONTAINER
);
258
Widget
item_card = item_cards_panel.GetChildren();
259
260
//get radius
261
float
original_r =
GetRadius
();
262
float
item_cards_r = original_r;
263
264
//--PARAM top offset--....
265
if
(
m_ItemCardRadiusOffset
!= 0)
266
{
267
item_cards_r = item_cards_r *
m_ItemCardRadiusOffset
;
268
if
(item_cards_r < 0) item_cards_r = 0;
//min radius is 0
269
}
270
271
m_RadialItemCards
.Clear();
272
for
(
int
i = 0; i < item_cards_count; ++i)
273
{
274
//position item cards
275
if
(item_card)
276
{
277
//creates circle from simple widget items
278
float
pos_x = item_cards_r *
Math
.
Cos
(angle_rad);
279
float
pos_y = item_cards_r *
Math
.
Sin
(angle_rad);
280
281
pos_x = pos_x / original_r;
282
pos_y = pos_y / original_r;
283
284
item_card.SetPos(pos_x, pos_y);
285
286
//store item card
287
m_RadialItemCards
.Insert(item_card, angle_rad);
288
289
//get next child
290
item_card = item_card.GetSibling();
291
}
292
//-------------------------
293
294
//create delimiter
295
if
(item_cards_count > 1 && delimiters_panel &&
m_DelimiterLayout
)
296
{
297
Widget
delimiter_widget =
g_Game
.GetWorkspace().CreateWidgets(
m_DelimiterLayout
, delimiters_panel);
298
float
delim_angle_rad = angle_rad + (
m_AngleRadOffset
/ 2);
299
delimiter_widget.SetPos(0, 0);
300
delimiter_widget.SetRotation(0, 0,
GetAngleInDegrees
(delim_angle_rad) + 90);
301
}
302
303
//calculate next angle
304
angle_rad +=
m_AngleRadOffset
;
305
}
306
307
//hide selector on refresh
308
if
(hide_selector)
309
{
310
HideRadialSelector
();
311
}
312
}
313
314
//Radial selector
315
protected
void
ShowRadialSelector
(
Widget
selected_item)
316
{
317
if
(
m_RadialSelector
&& selected_item)
318
{
319
int
item_count =
m_RadialItemCards
.Count();
320
if
(item_count > 1)
321
{
322
int
angle_deg =
GetAngleInDegrees
(
m_RadialItemCards
.Get(selected_item));
323
m_RadialSelector
.SetRotation(0, 0, angle_deg + 90);
//rotate widget according to its desired rotation
324
325
//set radial selector size
326
float
progress = (1 / item_count) * 2;
327
m_RadialSelectorImage
.SetMaskProgress(progress);
328
329
m_RadialSelector
.Show(
true
);
330
331
bool
grey_selector = selected_item.GetFlags() &
WidgetFlags
.DISABLED;
332
if
(!grey_selector)
333
{
334
m_RadialSelectorImage
.SetColor(
m_RadialSelectorDisabledColor
);
335
m_RadialSelectorPointerImage
.SetColor(
m_RadialSelectorDisabledColor
);
336
}
337
else
338
{
339
m_RadialSelectorImage
.SetColor(
m_RadialSelectorOriginalColor
);
340
m_RadialSelectorPointerImage
.SetColor(
m_RadialSelectorOriginalColor
);
341
}
342
}
343
}
344
}
345
346
protected
void
HideRadialSelector
()
347
{
348
if
(
m_RadialSelector
)
349
{
350
m_RadialSelector
.Show(
false
);
351
}
352
}
353
354
//============================================
355
// Widget size calculations
356
//============================================
357
protected
int
GetItemCardsCount
()
358
{
359
Widget
child =
m_ItemCardsContainer
.GetChildren();
360
int
count = 0;
361
362
while
(child)
363
{
364
++count;
365
366
child = child.GetSibling();
367
}
368
369
return
count;
370
}
371
372
protected
float
GetRadius
()
373
{
374
float
radius =
Math
.
AbsFloat
(
GetParentMinSize
() * 0.5);
375
376
//PARAM --radius--
377
if
(
m_RadiusOffset
> 0)
378
{
379
return
radius *
m_RadiusOffset
;
380
}
381
//----------------
382
383
return
radius;
384
}
385
386
protected
void
GetParentCenter
(out
float
center_x, out
float
center_y)
387
{
388
if
(
m_Parent
)
389
{
390
float
wx;
391
float
wy;
392
m_Parent
.GetScreenPos(wx, wy);
393
394
float
ww;
395
float
wh;
396
m_Parent
.GetScreenSize(ww, wh);
397
398
center_x = wx + ww / 2;
//center
399
center_y = wy + wh / 2;
400
}
401
}
402
403
protected
float
GetParentMinSize
()
404
{
405
if
(
m_Parent
)
406
{
407
float
size_x;
408
float
size_y;
409
m_Parent
.GetScreenSize(size_x, size_y);
410
411
return
Math
.
Min
(size_x, size_y);
412
}
413
414
return
0;
415
}
416
417
//============================================
418
// Angle calculations
419
//============================================
420
//get object by angle (degrees)
421
protected
Widget
GetObjectByDegAngle
(
float
deg_angle)
422
{
423
for
(
int
i = 0; i <
m_RadialItemCards
.Count(); ++i)
424
{
425
Widget
w =
m_RadialItemCards
.GetKey(i);
426
float
w_angle =
GetAngleInDegrees
(
m_RadialItemCards
.Get(w));
427
float
offset =
GetAngleInDegrees
(
m_AngleRadOffset
) / 2;
428
float
min_angle = w_angle - offset;
429
float
max_angle = w_angle + offset;
430
431
if
(min_angle < 0) min_angle += 360;
//clamp 0-360
432
if
(max_angle > 360) max_angle -= 360;
433
434
if
(min_angle > max_angle)
//angle radius is in the cycling point 360->
435
{
436
if
(min_angle <= deg_angle)
//is cursor position also before this point
437
{
438
if
(deg_angle > max_angle)
439
{
440
return
w;
441
}
442
}
443
else
//is cursor position after this point
444
{
445
if
(deg_angle < max_angle)
446
{
447
return
w;
448
}
449
}
450
}
451
else
452
{
453
if
(deg_angle >= min_angle && deg_angle < max_angle)
//min, max angles are within 0-360 radius
454
{
455
return
w;
456
}
457
}
458
}
459
460
return
NULL;
461
}
462
463
//returns GUI compatible mouse-to-parent angle
464
protected
float
GetMousePointerAngle
()
465
{
466
int
mouse_x;
467
int
mouse_y;
468
GetMousePos
(mouse_x, mouse_y);
469
470
float
center_x;
471
float
center_y;
472
GetParentCenter
(center_x, center_y);
473
474
float
tan_x = mouse_x - center_x;
475
float
tan_y = mouse_y - center_y;
476
float
angle =
Math
.
Atan2
(tan_y, tan_x);
477
478
return
angle;
479
}
480
481
//returns distance from parent center
482
protected
float
GetMouseDistance
()
483
{
484
int
mouse_x;
485
int
mouse_y;
486
GetMousePos
(mouse_x, mouse_y);
487
488
float
center_x;
489
float
center_y;
490
GetParentCenter
(center_x, center_y);
491
492
float
distance =
vector
.
Distance
(
Vector
(mouse_x, mouse_y, 0),
Vector
(center_x, center_y, 0));
493
494
return
distance;
495
}
496
497
//return angle 0-360 deg
498
protected
float
GetAngleInDegrees
(
float
rad_angle)
499
{
500
float
rad_deg = rad_angle *
Math
.
RAD2DEG
;
501
502
int
angle_mp = rad_deg / 360;
503
504
if
(rad_deg < 0)
505
{
506
rad_deg = rad_deg - (360 * angle_mp);
507
rad_deg += 360;
508
}
509
510
return
rad_deg;
511
}
512
513
//============================================
514
// Update
515
//============================================
516
//mouse
517
int
last_time
= -1;
518
protected
void
Update
()
519
{
520
if
(
this
&& !
m_RegisteredClass
)
521
{
522
m_UpdateTimer
.Stop();
523
return
;
524
}
525
526
int
currentTime =
g_Game
.GetTime();
527
//get delta time
528
if
(
last_time
< 0)
529
{
530
last_time
= currentTime;
531
}
532
int
delta_time = currentTime -
last_time
;
533
last_time
= currentTime;
534
535
//controls
536
if
(
this
&&
m_RegisteredClass
&&
m_RegisteredClass
.IsVisible())
537
{
538
//mouse controls
539
if
(
IsUsingMouse
() &&
m_WidgetInitialized
)
540
{
541
float
mouse_angle =
GetMousePointerAngle
();
542
float
mouse_distance =
GetMouseDistance
();
543
544
//--PARAM --safe zone radius--
545
if
(mouse_distance <=
MOUSE_SAFE_ZONE_RADIUS
)
546
{
547
//Deselect
548
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnMouseDeselect"
, NULL,
m_SelectedObject
);
549
m_SelectedObject
= NULL;
550
//hide selector
551
HideRadialSelector
();
552
}
553
else
554
{
555
//Deselect
556
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnMouseDeselect"
, NULL,
m_SelectedObject
);
557
558
//Select
559
m_SelectedObject
=
GetObjectByDegAngle
(
GetAngleInDegrees
(mouse_angle));
560
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnMouseSelect"
, NULL,
m_SelectedObject
);
561
//show selector
562
ShowRadialSelector
(
m_SelectedObject
);
563
}
564
}
565
//controller controls
566
else
if
(
IsUsingController
())
567
{
568
UpdataControllerInput
();
569
570
//Controller tilt
571
if
(
m_ControllerAngle
> -1 &&
m_ControllerTilt
> -1)
572
{
573
//Right analogue stick
574
Widget
w_selected =
GetObjectByDegAngle
(
m_ControllerAngle
);
575
//Select
576
if
(w_selected)
577
{
578
if
(w_selected !=
m_SelectedObject
)
579
{
580
if
(
m_ControllerTilt
>=
CONTROLLER_TILT_TRESHOLD_SELECT
)
581
{
582
//Deselect
583
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnControllerDeselect"
, NULL,
m_SelectedObject
);
584
585
//Select new object
586
m_SelectedObject
= w_selected;
587
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnControllerSelect"
, NULL,
m_SelectedObject
);
588
//show selector
589
ShowRadialSelector
(
m_SelectedObject
);
590
}
591
}
592
}
593
else
594
{
595
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnControllerDeselect"
, NULL,
m_SelectedObject
);
596
m_SelectedObject
= NULL;
597
//hide selector
598
HideRadialSelector
();
599
}
600
}
601
//if controller is giving no feedback
602
else
603
{
604
if
(
m_IsControllerTimoutEnabled
)
605
{
606
m_ControllerTimout
+= delta_time;
607
608
if
(
m_ControllerTimout
>=
CONTROLLER_DESELECT_TIMEOUT
)
609
{
610
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnControllerDeselect"
, NULL,
m_SelectedObject
);
611
m_SelectedObject
= NULL;
612
//hide selector
613
HideRadialSelector
();
614
615
m_ControllerTimout
= 0;
//reset controller timeout
616
}
617
}
618
}
619
620
m_ControllerAngle
= -1;
//reset angle and tilt
621
m_ControllerTilt
= -1;
622
}
623
624
m_WidgetInitialized
=
true
;
625
}
626
}
627
628
float
NormalizeInvertAngle
(
float
angle)
629
{
630
float
new_angle = 360 - angle;
631
int
angle_mp = new_angle / 360;
632
633
new_angle = new_angle - (360 * angle_mp);
634
635
return
new_angle;
636
}
637
638
//============================================
639
// Controls
640
//============================================
641
void
UpdataControllerInput
()
642
{
643
Input
input =
g_Game
.GetInput();
644
645
//Controller radial
646
float
angle;
647
float
tilt;
648
input.
GetGamepadThumbDirection
(
GamepadButton
.THUMB_RIGHT, angle, tilt);
649
angle =
NormalizeInvertAngle
(angle *
Math
.
RAD2DEG
);
650
651
m_ControllerAngle
= angle;
652
m_ControllerTilt
= tilt;
653
m_ControllerTimout
= 0;
//reset controller timeout
654
655
//Controller buttons
656
//Select (A,cross)
657
if
(
m_SelectInputWrapper
.InputP().LocalPress())
658
{
659
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnControllerPressSelect"
, NULL,
m_SelectedObject
);
660
}
661
662
//Back (B,circle)
663
if
(
m_BackInputWrapper
.InputP().LocalPress())
664
{
665
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnControllerPressBack"
, NULL,
m_SelectedObject
);
666
}
667
}
668
669
override
bool
OnMouseButtonUp
(
Widget
w,
int
x
,
int
y
,
int
button)
670
{
671
if
(button ==
MouseState
.LEFT &&
m_SelectedObject
/* && w == m_SelectedObject*/
)
672
{
673
//Execute
674
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnMousePressLeft"
, NULL,
m_SelectedObject
);
675
676
return
true
;
677
}
678
679
if
(button ==
MouseState
.RIGHT)
680
{
681
//Back one level
682
g_Game
.GameScript.CallFunction(
m_RegisteredClass
,
"OnMousePressRight"
, NULL, NULL);
683
684
return
true
;
685
}
686
687
return
false
;
688
}
689
}
m_Parent
Entity m_Parent
Definition
cachedequipmentstoragebase.c:15
Input
Definition
input.c:11
Input::GetGamepadThumbDirection
proto bool GetGamepadThumbDirection(GamepadButton thumbButton, out float angle, out float value)
return true if was deflected button.
Input::IsEnabledMouseAndKeyboardEvenOnServer
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
Math
Definition
enmath.c:7
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition
enwidgets.c:657
ScriptedWidgetEventHandler::Refresh
void Refresh()
Definition
layoutholder.c:202
ScriptedWidgetEventHandler::OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Definition
sizetochild.c:14
ScriptedWidgetEventHandler::Update
void Update()
Definition
continuousactionprogress.c:56
Timer
Definition
dayzplayerimplement.c:39
UAIDWrapper
Definition
uainput.c:15
UAInputAPI::GetInputByID
proto native UAInput GetInputByID(int iID)
returns list of all bindable (i.e. visible) inputs from the active group ('core' by default)
UAInput::GetPersistentWrapper
proto native UAIDWrapper GetPersistentWrapper()
UIScriptedMenu
Xbox menu.
Definition
dayzgame.c:64
Widget
Definition
enwidgets.c:190
map
Definition
cachedequipmentstorage.c:4
vector
Definition
enconvert.c:119
vector::Distance
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
GetInstance
static AnimSoundObjectBuilderBank GetInstance()
Definition
dayzanimeventmaps.c:186
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
GamepadButton
GamepadButton
Definition
ensystem.c:341
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
Math::Cos
static proto float Cos(float angle)
Returns cosinus of angle in radians.
Math::Atan2
static proto float Atan2(float y, float x)
Returns angle in radians from tangent.
Math::PI
static const float PI
Definition
enmath.c:12
Math::Min
static proto float Min(float x, float y)
Returns smaller of two given values.
Math::AbsFloat
static proto float AbsFloat(float f)
Returns absolute value.
Math::RAD2DEG
static const float RAD2DEG
Definition
enmath.c:16
Math::Sin
static proto float Sin(float angle)
Returns sinus of angle in radians.
MouseState
MouseState
Definition
ensystem.c:311
GetMousePos
proto void GetMousePos(out int x, out int y)
WidgetFlags
WidgetFlags
Definition
enwidgets.c:58
ScriptedWidgetEventHandler::OnMouseButtonUp
bool OnMouseButtonUp(Widget w, int x, int y, int button)
x
Icon x
y
Icon y
class_name
class OptionSelectorMultistate extends OptionSelector class_name
ARGB
int ARGB(int a, int r, int g, int b)
Definition
proto.c:322
m_RadialItemCards
ref map< Widget, float > m_RadialItemCards
Definition
radialmenu.c:17
RADIAL_ITEM_CARD_CONTAINER
static const string RADIAL_ITEM_CARD_CONTAINER
Definition
radialmenu.c:27
m_AngleRadOffset
float m_AngleRadOffset
Definition
radialmenu.c:19
m_SelectInputWrapper
UAIDWrapper m_SelectInputWrapper
Definition
radialmenu.c:31
m_BackInputWrapper
UAIDWrapper m_BackInputWrapper
Definition
radialmenu.c:32
GetMousePointerAngle
float GetMousePointerAngle()
Definition
radialmenu.c:464
IsUsingController
bool IsUsingController()
Definition
radialmenu.c:158
m_RadiusOffset
float m_RadiusOffset
Definition
radialmenu.c:48
RegisterClass
void RegisterClass(UIScriptedMenu class_name)
Definition
radialmenu.c:181
m_WidgetInitialized
bool m_WidgetInitialized
Definition
radialmenu.c:44
CONTROLLER_DESELECT_TIMEOUT
const float CONTROLLER_DESELECT_TIMEOUT
Definition
radialmenu.c:39
RADIAL_SELECTOR
static const string RADIAL_SELECTOR
Definition
radialmenu.c:23
HideRadialSelector
void HideRadialSelector()
Definition
radialmenu.c:346
m_SelectedObject
Widget m_SelectedObject
Definition
radialmenu.c:16
m_ItemCardsContainer
Widget m_ItemCardsContainer
Definition
radialmenu.c:10
UpdataControllerInput
void UpdataControllerInput()
Definition
radialmenu.c:641
m_RadialSelectorImage
ImageWidget m_RadialSelectorImage
Definition
radialmenu.c:12
SetExecuteDistOffset
void SetExecuteDistOffset(float execute_dist_offset)
Definition
radialmenu.c:196
m_DelimiterLayout
string m_DelimiterLayout
Definition
radialmenu.c:52
m_ItemCardRadiusOffset
float m_ItemCardRadiusOffset
Definition
radialmenu.c:51
m_ControlType
RadialMenuControlType m_ControlType
Definition
radialmenu.c:30
m_IsControllerTimoutEnabled
bool m_IsControllerTimoutEnabled
Definition
radialmenu.c:38
SetWidgetInitialized
void SetWidgetInitialized(bool state)
Definition
radialmenu.c:168
NormalizeInvertAngle
float NormalizeInvertAngle(float angle)
Definition
radialmenu.c:628
SetOffsetFromTop
void SetOffsetFromTop(float offset_from_top)
Definition
radialmenu.c:202
SetRadiusOffset
void SetRadiusOffset(float radius_offset)
Definition
radialmenu.c:190
GetParentCenter
void GetParentCenter(out float center_x, out float center_y)
Definition
radialmenu.c:386
ShowRadialSelector
void ShowRadialSelector(Widget selected_item)
Definition
radialmenu.c:315
RADIAL_SELECTOR_POINTER
static const string RADIAL_SELECTOR_POINTER
Definition
radialmenu.c:25
GetMouseDistance
float GetMouseDistance()
Definition
radialmenu.c:482
m_RadialSelector
Widget m_RadialSelector
Definition
radialmenu.c:11
m_RegisteredClass
ref UIScriptedMenu m_RegisteredClass
Definition
radialmenu.c:54
RadialMenuControlType
RadialMenuControlType
Definition
radialmenu.c:2
CONTROLLER
@ CONTROLLER
Definition
radialmenu.c:4
MOUSE
@ MOUSE
Definition
radialmenu.c:3
m_OffsetFromTop
float m_OffsetFromTop
Definition
radialmenu.c:50
MOUSE_SAFE_ZONE_RADIUS
const float MOUSE_SAFE_ZONE_RADIUS
Definition
radialmenu.c:45
m_RadialSelectorPointerImage
ImageWidget m_RadialSelectorPointerImage
Definition
radialmenu.c:13
m_RadialSelectorDisabledColor
int m_RadialSelectorDisabledColor
Definition
radialmenu.c:15
m_ControllerTilt
float m_ControllerTilt
Definition
radialmenu.c:34
GetItemCardsCount
int GetItemCardsCount()
Definition
radialmenu.c:357
m_Instance
static ref RadialMenu m_Instance
Definition
radialmenu.c:55
IsUsingMouse
bool IsUsingMouse()
Definition
radialmenu.c:148
SetControlType
void SetControlType(RadialMenuControlType type)
Definition
radialmenu.c:139
GetRadius
float GetRadius()
Definition
radialmenu.c:372
CONTROLLER_TILT_TRESHOLD_SELECT
const float CONTROLLER_TILT_TRESHOLD_SELECT
Definition
radialmenu.c:40
IsWidgetInitialized
bool IsWidgetInitialized()
Definition
radialmenu.c:173
CONTROLLER_TILT_TRESHOLD_EXECUTE
const float CONTROLLER_TILT_TRESHOLD_EXECUTE
Definition
radialmenu.c:41
RADIAL_SELECTOR_IMAGE
static const string RADIAL_SELECTOR_IMAGE
Definition
radialmenu.c:24
last_time
int last_time
Definition
radialmenu.c:517
m_ControllerAngle
float m_ControllerAngle
Definition
radialmenu.c:33
m_RadialSelectorOriginalColor
int m_RadialSelectorOriginalColor
Definition
radialmenu.c:14
SetWidgetProperties
void SetWidgetProperties(string delimiter_layout)
Definition
radialmenu.c:219
RADIAL_DELIMITER_CONTAINER
static const string RADIAL_DELIMITER_CONTAINER
Definition
radialmenu.c:26
m_ControllerTimout
int m_ControllerTimout
Definition
radialmenu.c:37
ActivateControllerTimeout
void ActivateControllerTimeout(bool state)
Definition
radialmenu.c:214
SetItemCardRadiusOffset
void SetItemCardRadiusOffset(float item_card_radius_offset)
Definition
radialmenu.c:208
GetParentMinSize
float GetParentMinSize()
Definition
radialmenu.c:403
~RadialMenu
void ~RadialMenu()
Definition
radialmenu.c:113
RadialMenu
void RadialMenu()
Definition
radialmenu.c:84
GetAngleInDegrees
float GetAngleInDegrees(float rad_angle)
Definition
radialmenu.c:498
GetObjectByDegAngle
Widget GetObjectByDegAngle(float deg_angle)
Definition
radialmenu.c:421
m_UpdateTimer
ref Timer m_UpdateTimer
Definition
radialmenu.c:20
m_ExecuteDistanceOffset
float m_ExecuteDistanceOffset
Definition
radialmenu.c:49
GetUApi
proto native UAInputAPI GetUApi()
Games
Dayz
scripts
3_game
gui
effects
radialmenu.c
Generated by
1.17.0