mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-05 15:11:16 +00:00
Fix bug where you sometimes couldn't type to change player name
This commit is contained in:
parent
c2eac34c4c
commit
cea235648d
3 changed files with 6 additions and 3 deletions
|
@ -292,13 +292,13 @@ void djui_inputbox_on_key_up(UNUSED struct DjuiBase *base, int scancode) {
|
|||
}
|
||||
}
|
||||
|
||||
static void djui_inputbox_on_focus_begin(UNUSED struct DjuiBase* base) {
|
||||
void djui_inputbox_on_focus_begin(UNUSED struct DjuiBase* base) {
|
||||
sHeldControl = 0;
|
||||
sHeldShift = 0;
|
||||
wm_api->start_text_input();
|
||||
}
|
||||
|
||||
static void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base) {
|
||||
void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base) {
|
||||
wm_api->stop_text_input();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ struct DjuiInputbox {
|
|||
void (*on_escape_press)(struct DjuiInputbox*);
|
||||
};
|
||||
|
||||
void djui_inputbox_on_focus_begin(UNUSED struct DjuiBase* base);
|
||||
void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base);
|
||||
void djui_inputbox_set_text_color(struct DjuiInputbox* inputbox, u8 r, u8 g, u8 b, u8 a);
|
||||
void djui_inputbox_set_text(struct DjuiInputbox* inputbox, char* text);
|
||||
void djui_inputbox_select_all(struct DjuiInputbox* inputbox);
|
||||
|
|
|
@ -196,6 +196,7 @@ static void djui_panel_player_name_on_focus_end(struct DjuiBase* caller) {
|
|||
if (gNetworkType != NT_NONE) {
|
||||
network_send_player_settings();
|
||||
}
|
||||
djui_inputbox_on_focus_end(&inputbox1->base);
|
||||
}
|
||||
|
||||
static void djui_panel_player_value_changed(UNUSED struct DjuiBase* caller) {
|
||||
|
@ -255,7 +256,7 @@ void djui_panel_player_create(struct DjuiBase* caller) {
|
|||
djui_inputbox_set_text(inputbox1, DLANG(PLAYER, PLAYER));
|
||||
}
|
||||
djui_interactable_hook_value_change(&inputbox1->base, djui_panel_player_name_text_change);
|
||||
djui_interactable_hook_focus(&inputbox1->base, NULL, NULL, djui_panel_player_name_on_focus_end);
|
||||
djui_interactable_hook_focus(&inputbox1->base, djui_inputbox_on_focus_begin, NULL, djui_panel_player_name_on_focus_end);
|
||||
}
|
||||
|
||||
char* modelChoices[CT_MAX] = { 0 };
|
||||
|
|
Loading…
Reference in a new issue