Ejemplo n.º 1
0
void
Menu_Init (void)
{
	menu_pr_state.progs_name = "menu.dat";
	menu_pr_state.allocate_progs_mem = menu_allocate_progs_mem;
	menu_pr_state.free_progs_mem = menu_free_progs_mem;
	menu_pr_state.load_file = menu_load_file;
	menu_pr_state.resolve = menu_resolve_globals;

	menu_hash = Hash_NewTable (61, menu_get_key, menu_free, 0);

	PR_RegisterBuiltins (&menu_pr_state, builtins);

	RUA_Init (&menu_pr_state, 1);

	InputLine_Progs_Init (&menu_pr_state);
	Key_Progs_Init (&menu_pr_state);
	GIB_Progs_Init (&menu_pr_state);
	PR_Cmds_Init (&menu_pr_state);
	R_Progs_Init (&menu_pr_state);
	S_Progs_Init (&menu_pr_state);

	confirm_quit = Cvar_Get ("confirm_quit", "1", CVAR_ARCHIVE, NULL,
							 "confirm quit command");

	Cmd_AddCommand ("togglemenu", togglemenu_f,
					"Toggle the display of the menu");
	Cmd_RemoveCommand ("quit");
	Cmd_AddCommand ("quit", quit_f, "Exit the program");
	Cmd_AddCommand ("Menu_Enter", Menu_Enter_f, "Do menu action/move up in the menu tree.");
	Cmd_AddCommand ("Menu_Leave", Menu_Leave_f, "Move down in the menu tree.");
	Cmd_AddCommand ("Menu_Prev",  Menu_Prev_f, "Move cursor up.");
	Cmd_AddCommand ("Menu_Next",  Menu_Next_f, "Move cursor up.");
}
Ejemplo n.º 2
0
void
SV_PR_CPQW_Init (progs_t *pr)
{
	PR_RegisterBuiltins (pr, builtins);
	PR_AddLoadFunc (pr, cpqw_load);
}