cl_menu.c

Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2002-2010 UFO: Alien Invasion.
00008 
00009 This program is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00017 
00018 See the GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 
00024 */
00025 
00026 #include "client.h"
00027 #include "cl_menu.h"
00028 #include "ui/ui_main.h"
00029 #include "ui/ui_nodes.h"
00030 #include "ui/ui_popup.h"
00031 #include "ui/node/ui_node_abstractnode.h"
00032 
00033 static inline void CLMN_AddBindings (linkedList_t **list, char **bindings)
00034 {
00035     int i;
00036     for (i = K_FIRST_KEY; i < K_LAST_KEY; i++)
00037         if (bindings[i] && bindings[i][0] != '\0')
00038             LIST_AddString(list, va("%s\t%s", Key_KeynumToString(i), Cmd_GetCommandDesc(bindings[i])));
00039 }
00040 
00044 static void CLMN_InitKeyList_f (void)
00045 {
00046     linkedList_t *list = NULL;
00047 
00048     CLMN_AddBindings(&list, keyBindings);
00049     CLMN_AddBindings(&list, menuKeyBindings);
00050     CLMN_AddBindings(&list, battleKeyBindings);
00051 
00052     UI_RegisterLinkedListText(TEXT_LIST, list);
00053 }
00054 
00061 void CLMN_InitStartup (void)
00062 {
00063     /* print the keyBindings to mn.menuText */
00064     Cmd_AddCommand("mn_init_keylist", CLMN_InitKeyList_f, NULL);
00065 
00066     UI_Init();
00067 }

Generated by  doxygen 1.6.2