summaryrefslogtreecommitdiff
path: root/source/ui_main.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-05-08 13:21:30 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-05-08 13:21:30 +0000
commitc42cbedd8019373228e260de2f422fb7a15f4156 (patch)
tree9b7f615784ad2f69f93097c3f673cb2004461e0e /source/ui_main.c
parent2abb37ac482ea1d47a516784c2f23538dcc18e5d (diff)
Removed hardcoded menus in favor of scriptable ones.
Made UI module part of the client, removed all glue. Added `pushmenu', `popmenu', 'forcemenuoff' commands. Detect gzipped files by contents, not by *.gz extension (TODO).
Diffstat (limited to 'source/ui_main.c')
-rw-r--r--source/ui_main.c101
1 files changed, 0 insertions, 101 deletions
diff --git a/source/ui_main.c b/source/ui_main.c
deleted file mode 100644
index aa355bf..0000000
--- a/source/ui_main.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-Copyright (C) 2003-2006 Andrey Nazarov
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-
-#include "ui_local.h"
-
-/*
-=======================================================================
-
-MAIN MENU
-
-=======================================================================
-*/
-
-#define MAIN_ITEMS 4
-
-static const char names[MAIN_ITEMS][8] = {
- "Servers",
- "Demos",
- "Options",
- "Quit"
-};
-
-typedef struct mainMenu_s {
- menuFrameWork_t menu;
- menuAction_t actions[MAIN_ITEMS];
-} mainMenu_t;
-
-static mainMenu_t m_main;
-
-static int MainMenu_Callback( int id, int msg, int param ) {
- switch( msg ) {
- case QM_ACTIVATE:
- switch( id ) {
- case 0:
- M_Menu_Multiplayer_f();
- break;
- case 1:
- M_Menu_Demos_f();
- break;
- case 2:
- M_Menu_Options_f();
- break;
- case 3:
- cmd.ExecuteText( EXEC_APPEND, "quit\n" );
- break;
- }
- return QMS_IN;
- case QM_DESTROY:
- break;
- case QM_SIZE:
- Menu_Size( &m_main.menu );
- break;
- default:
- break;
- }
-
- return QMS_NOTHANDLED;
-}
-
-static void MainMenu_Init( void ) {
- int i;
-
- memset( &m_main, 0, sizeof( m_main ) );
-
- m_main.menu.callback = MainMenu_Callback;
- m_main.menu.banner = "Main Menu";
-
- for( i = 0; i < MAIN_ITEMS; i++ ) {
- m_main.actions[i].generic.type = MTYPE_ACTION;
- m_main.actions[i].generic.id = i;
- m_main.actions[i].generic.name = names[i];
- m_main.actions[i].generic.uiFlags = UI_CENTER;
-
- Menu_AddItem( &m_main.menu, &m_main.actions[i] );
- }
-
- m_main.actions[0].generic.flags = QMF_HASFOCUS;
-}
-
-void M_Menu_Main_f( void ) {
- MainMenu_Init();
- UI_PushMenu( &m_main.menu );
-}
-