mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 20:15:17 +00:00
Fixed clicking your cursor on the rightmost letter of inputbox
This commit is contained in:
parent
bc079903a7
commit
bff3dc74fe
2 changed files with 7 additions and 7 deletions
|
@ -71,7 +71,7 @@ static u16 djui_inputbox_get_cursor_index(struct DjuiInputbox* inputbox) {
|
||||||
u16 index = 0;
|
u16 index = 0;
|
||||||
u16 i = 0;
|
u16 i = 0;
|
||||||
char* c = inputbox->buffer;
|
char* c = inputbox->buffer;
|
||||||
while (*c != '\0') {
|
while (true) {
|
||||||
if (x < cX) {
|
if (x < cX) {
|
||||||
index = i;
|
index = i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "djui.h"
|
#include "djui.h"
|
||||||
#include "djui_panel.h"
|
#include "djui_panel.h"
|
||||||
#include "djui_panel_menu.h"
|
#include "djui_panel_menu.h"
|
||||||
|
#include "djui_unicode.h"
|
||||||
#include "pc/configfile.h"
|
#include "pc/configfile.h"
|
||||||
#include "pc/network/network_player.h"
|
#include "pc/network/network_player.h"
|
||||||
#include "game/level_update.h"
|
#include "game/level_update.h"
|
||||||
|
@ -166,12 +167,11 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) {
|
||||||
|
|
||||||
static bool djui_panel_player_name_valid(char* buffer) {
|
static bool djui_panel_player_name_valid(char* buffer) {
|
||||||
if (buffer[0] == '\0') { return false; }
|
if (buffer[0] == '\0') { return false; }
|
||||||
while (*buffer != '\0') {
|
char* c = buffer;
|
||||||
if (*buffer >= '!' && *buffer <= '~') {
|
while (*c != '\0') {
|
||||||
buffer++;
|
if (*c == ' ') { return false; }
|
||||||
continue;
|
if (!djui_unicode_valid_char(c)) { return false; }
|
||||||
}
|
c = djui_unicode_next_char(c);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue