add Menu_GetIndex

This commit is contained in:
Bill Currie 2002-01-23 21:07:38 +00:00
parent 6a393d175e
commit ed91b16f45

View file

@ -279,6 +279,16 @@ bi_Menu_Quit (progs_t *pr)
Sys_Quit ();
}
static void
bi_Menu_GetIndex (progs_t *pr)
{
if (menu) {
G_INT (pr, OFS_RETURN) = menu->cur_item;
} else {
G_INT (pr, OFS_RETURN) = -1;
}
}
static void
togglemenu_f (void)
{
@ -318,6 +328,7 @@ Menu_Init (void)
PR_AddBuiltin (&menu_pr_state, "Menu_SelectMenu", bi_Menu_SelectMenu, -1);
PR_AddBuiltin (&menu_pr_state, "Menu_SetQuit", bi_Menu_SetQuit, -1);
PR_AddBuiltin (&menu_pr_state, "Menu_Quit", bi_Menu_Quit, -1);
PR_AddBuiltin (&menu_pr_state, "Menu_GetIndex", bi_Menu_GetIndex, -1);
Cbuf_Progs_Init (&menu_pr_state);
File_Progs_Init (&menu_pr_state);