DJUI interactable crash fix

This commit is contained in:
Agent X 2024-07-17 12:25:16 -04:00
parent b015468728
commit 78d287406d

View file

@ -406,14 +406,16 @@ void djui_interactable_update(void) {
u16 mainButtons = PAD_BUTTON_A | PAD_BUTTON_B;
if ((mouseButtons & MOUSE_BUTTON_1) && !(sLastMouseButtons && MOUSE_BUTTON_1) && !djui_cursor_inside_base(gInteractableFocus)) {
// clicked outside of focused
if (!gDjuiChatBoxFocus && gInteractableFocus != &gDjuiChatBox->chatInput->base) {
djui_interactable_set_input_focus(NULL);
}
// if (!gDjuiChatBoxFocus && gDjuiChatBox != NULL && gInteractableFocus != &gDjuiChatBox->chatInput->base) {
// djui_interactable_set_input_focus(NULL);
// }
djui_interactable_set_input_focus(NULL);
} else if ((padButtons & mainButtons) && !(sLastInteractablePad.button & mainButtons)) {
// pressed main face button
if (!gDjuiChatBoxFocus && gInteractableFocus != &gDjuiChatBox->chatInput->base) {
djui_interactable_set_input_focus(NULL);
}
// if (!gDjuiChatBoxFocus && gDjuiChatBox != NULL && gInteractableFocus != &gDjuiChatBox->chatInput->base) {
// djui_interactable_set_input_focus(NULL);
// }
djui_interactable_set_input_focus(NULL);
} else {
djui_interactable_on_focus(gInteractableFocus);
}