summaryrefslogtreecommitdiffstats
path: root/src/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/menu.c b/src/menu.c
index c9509e5..c5087ee 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -50,6 +50,12 @@ struct _mf_menu {
};
static int
+_mf_menu_isdigit(void *user_data __attribute__((__unused__)), char c)
+{
+ return isdigit(c);
+}
+
+static int
_mf_menu_seed(void *user_data, const char *seed)
{
struct _mf_menu *menu = (struct _mf_menu *) user_data;
@@ -169,11 +175,11 @@ _mf_menu_form(SDL_Renderer *renderer, TTF_Font *text_font,
}
menu->seed_text = mftk_text_new('0', '9', rand_max_len, menu->seed_buf,
- text_font, text_color, SDL_TRUE, &_mf_menu_seed,
- &_mf_menu_play, menu);
+ text_font, text_color, SDL_TRUE, &_mf_menu_isdigit,
+ &_mf_menu_seed, &_mf_menu_play, menu);
menu->enemies_text = mftk_text_new('0', '9', 2, menu->enemies_buf,
- text_font, text_color, SDL_TRUE, &_mf_menu_enemies,
- &_mf_menu_play, menu);
+ text_font, text_color, SDL_TRUE, &_mf_menu_isdigit,
+ &_mf_menu_enemies, &_mf_menu_play, menu);
grid = mftk_grid_new(6, 2, MF_ROW_M, MF_COL_M,
mftk_label_new(text_font, "Seed", text_color, renderer),
MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T,