mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-28 04:51:40 +00:00
Prevent keys from typing when bound to chat
This commit is contained in:
parent
33579b1a65
commit
26bd3d67c5
1 changed files with 7 additions and 0 deletions
|
|
@ -7,11 +7,17 @@
|
||||||
|
|
||||||
struct DjuiChatBox* gDjuiChatBox = NULL;
|
struct DjuiChatBox* gDjuiChatBox = NULL;
|
||||||
bool gDjuiChatBoxFocus = false;
|
bool gDjuiChatBoxFocus = false;
|
||||||
|
static bool sDjuiChatBoxClearText = false;
|
||||||
|
|
||||||
bool djui_chat_box_render(struct DjuiBase* base) {
|
bool djui_chat_box_render(struct DjuiBase* base) {
|
||||||
struct DjuiChatBox* chatBox = (struct DjuiChatBox*)base;
|
struct DjuiChatBox* chatBox = (struct DjuiChatBox*)base;
|
||||||
struct DjuiBase* ccBase = &chatBox->chatContainer->base;
|
struct DjuiBase* ccBase = &chatBox->chatContainer->base;
|
||||||
djui_base_set_size(ccBase, 1.0f, chatBox->base.comp.height - 32 - 8);
|
djui_base_set_size(ccBase, 1.0f, chatBox->base.comp.height - 32 - 8);
|
||||||
|
if (sDjuiChatBoxClearText) {
|
||||||
|
sDjuiChatBoxClearText = false;
|
||||||
|
djui_inputbox_set_text(gDjuiChatBox->chatInput, "");
|
||||||
|
djui_inputbox_select_all(gDjuiChatBox->chatInput);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,6 +96,7 @@ static bool djui_chat_box_input_on_key_down(struct DjuiBase* base, int scancode)
|
||||||
|
|
||||||
void djui_chat_box_toggle(void) {
|
void djui_chat_box_toggle(void) {
|
||||||
if (gDjuiChatBox == NULL) { return; }
|
if (gDjuiChatBox == NULL) { return; }
|
||||||
|
if (!gDjuiChatBoxFocus) { sDjuiChatBoxClearText = true; }
|
||||||
gDjuiChatBoxFocus = !gDjuiChatBoxFocus;
|
gDjuiChatBoxFocus = !gDjuiChatBoxFocus;
|
||||||
djui_chat_box_set_focus_style();
|
djui_chat_box_set_focus_style();
|
||||||
gDjuiChatBox->scrolling = false;
|
gDjuiChatBox->scrolling = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue