-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaud_playerbutton_manager.c
More file actions
34 lines (29 loc) · 1.07 KB
/
Copy pathmaud_playerbutton_manager.c
File metadata and controls
34 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "maud_playerbutton_manager.h"
bool maud_buttonmanager_ibutton_hover(maud_t* maud, ibtn_t button) {
return maud_rect_hover(maud, button.btn_canvas);
}
bool maud_buttonmanager_tbutton_hover(maud_t* maud, tbtn_t button) {
return maud_rect_hover(maud, button.btn_canvas);
}
bool maud_buttonmanager_ibuttons_hover(maud_t* maud, ibtn_t* buttons, int* btn_id, size_t button_count) {
for(size_t i=0;i<button_count;i++) {
if(maud_buttonmanager_ibutton_hover(maud, buttons[i])) {
if(btn_id != NULL) {
*btn_id = buttons[i].id;
}
buttons[i].hover = true; return true;
}
}
return false;
}
bool maud_buttonmanager_tbuttons_hover(maud_t* maud, tbtn_t* buttons, int* btn_id, size_t button_count) {
for(size_t i=0;i<button_count;i++) {
if(maud_buttonmanager_tbutton_hover(maud, buttons[i])) {
if(btn_id != NULL) {
*btn_id = buttons[i].id;
}
buttons[i].hover = true; return true;
}
}
return false;
}