Untitled
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_callbacks.c
Go to the documentation of this file.
1
2
#include "
load/init.h
"
3
#include "
utilities/types.h
"
4
#include "
ui/ui.h
"
5
#include "
ui/ui_callbacks.h
"
6
7
8
9
10
UICallback
ACTION_CALLBACKS
[
MAX_CALLBACKS
] = {0};
11
UICallback
HOVER_CALLBACKS
[
MAX_CALLBACKS
] = {0};
12
int
ACTION_CALLBACK_COUNT
= 0;
13
int
HOVER_CALLBACK_COUNT
= 0;
14
15
16
17
18
19
20
21
22
void
init_action_callbacks
()
23
{
24
25
UICallback
* ac = &
ACTION_CALLBACKS
[
ACTION_CALLBACK_COUNT
];
26
sprintf(ac->
id
,
"none"
);
27
ac->
val
.
type
=
UIVAL_NONE
;
28
ACTION_CALLBACK_COUNT
++;
29
30
ac = &
ACTION_CALLBACKS
[
ACTION_CALLBACK_COUNT
];
31
sprintf(ac->
id
,
"test"
);
32
ac->
val
.
type
=
UIVAL_BOOL
;
33
ac->
val
.
data
= &
EDITOR_SETTINGS
.
LUT
;
34
ac->
one_shot
=
false
;
35
ACTION_CALLBACK_COUNT
++;
36
37
ac = &
ACTION_CALLBACKS
[
ACTION_CALLBACK_COUNT
];
38
sprintf(ac->
id
,
"pos"
);
39
ac->
val
.
type
=
UIVAL_FLOAT
;
40
ac->
val
.
data
= &
player
.
pos
.
z
;
41
ac->
val
.
behavior
=
UIVALBEHAVIOR_NONE
;
42
ac->
val
.
inc_val
.inc_flt = 0.2f;
43
ACTION_CALLBACK_COUNT
++;
44
45
}
46
47
void
init_hover_callbacks
()
48
{
49
50
UICallback
* hc = &
HOVER_CALLBACKS
[
HOVER_CALLBACK_COUNT
];
51
52
sprintf(hc->
id
,
"none"
);
53
hc->
val
.
type
=
UIVAL_NONE
;
54
HOVER_CALLBACK_COUNT
++;
55
56
hc = &
HOVER_CALLBACKS
[
HOVER_CALLBACK_COUNT
];
57
sprintf(hc->
id
,
"test"
);
58
hc->
val
.
type
=
UIVAL_BOOL
;
59
hc->
val
.
data
= &
EDITOR_SETTINGS
.
DOF
;
60
hc->
one_shot
=
false
;
61
HOVER_CALLBACK_COUNT
++;
62
}
Player::pos
vec3 pos
Currently anchors the Skeleton.
Definition
engine_types.h:3055
EditorSettings::LUT
bool LUT
Definition
engine_types.h:723
EditorSettings::DOF
bool DOF
Definition
engine_types.h:716
UIValue::type
UIValueType type
The type of value that is inside of data.
Definition
ui.h:345
UIValue::inc_val
union UIValue::@033233014044001351273032017075321074265046133265 inc_val
UICallback::one_shot
bool one_shot
If this event only occurs on initial event.
Definition
ui.h:385
UIValue::behavior
UIValueBehavior behavior
The control upon reaching min or max.
Definition
ui.h:346
UICallback::val
UIValue val
The value to change.
Definition
ui.h:386
UICallback::id
char id[256]
The name of this UICallback inside of its registry.
Definition
ui.h:392
UIValue::data
void * data
The data, which may be simply a pointer that is passed into a function instead of manipulated directl...
Definition
ui.h:372
UIVAL_NONE
@ UIVAL_NONE
Definition
ui.h:315
UIVAL_FLOAT
@ UIVAL_FLOAT
Definition
ui.h:318
UIVAL_BOOL
@ UIVAL_BOOL
Definition
ui.h:316
UIVALBEHAVIOR_NONE
@ UIVALBEHAVIOR_NONE
Definition
ui.h:331
UICallback
Describes function pointers for UIElements that determine behavior on events.
Definition
ui.h:382
init.h
Important globals for the entire engine and initialization functions that are mainly called on engine...
EDITOR_SETTINGS
EditorSettings EDITOR_SETTINGS
Definition
main.c:330
player
Player player
The Player data.
Definition
main.c:287
types.h
vec3::z
float z
Definition
types.h:12
ui.h
The standalone UI library that controls text rendering, ui rendering, and events.
HOVER_CALLBACKS
UICallback HOVER_CALLBACKS[MAX_CALLBACKS]
Definition
ui_callbacks.c:11
HOVER_CALLBACK_COUNT
int HOVER_CALLBACK_COUNT
Definition
ui_callbacks.c:13
init_action_callbacks
void init_action_callbacks()
Definition
ui_callbacks.c:22
ACTION_CALLBACK_COUNT
int ACTION_CALLBACK_COUNT
Definition
ui_callbacks.c:12
init_hover_callbacks
void init_hover_callbacks()
Definition
ui_callbacks.c:47
ACTION_CALLBACKS
UICallback ACTION_CALLBACKS[MAX_CALLBACKS]
Definition
ui_callbacks.c:10
ui_callbacks.h
MAX_CALLBACKS
#define MAX_CALLBACKS
Definition
ui_callbacks.h:6
src
ui
ui_callbacks.c
Generated by
1.18.0