DJUI interactable crash fix

This commit is contained in:
Agent X 2024-07-17 12:25:16 -04:00
parent b015468728
commit 78d287406d
1 changed files with 8 additions and 6 deletions

View File

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