src/tron/gLanguageMenu.cpp

Go to the documentation of this file.
00001 /*
00002 
00003 *************************************************************************
00004 
00005 ArmageTron -- Just another Tron Lightcycle Game in 3D.
00006 Copyright (C) 2000  Manuel Moos (manuel@moosnet.de)
00007 
00008 **************************************************************************
00009 
00010 This program is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00023   
00024 ***************************************************************************
00025 
00026 */
00027 
00028 #include "gLanguageMenu.h"
00029 #include "uMenu.h"
00030 #include "tLocale.h"
00031 #include "tConfiguration.h"
00032 
00033 static tString sg_FirstLanguage("American English"), sg_SecondLanguage("American English");
00034 
00035 static tConfItemLine sg_fl("LANGUAGE_FIRST",sg_FirstLanguage);
00036 static tConfItemLine sg_sl("LANGUAGE_SECOND",sg_SecondLanguage);
00037 
00038 static void sg_UpdateLanguage( tString & language )
00039 {
00040     // update outdated language choices
00041     if ( language == "English" )
00042         language = "British English";
00043 
00044     if ( language == "American" )
00045         language = "American English";
00046 }
00047 
00048 void sg_LanguageInit()
00049 {
00050     sg_UpdateLanguage( sg_FirstLanguage );
00051     sg_UpdateLanguage( sg_SecondLanguage );
00052     tLanguage::Find(sg_FirstLanguage )->SetFirstLanguage();
00053     tLanguage::Find(sg_SecondLanguage)->SetSecondLanguage();
00054 }
00055 
00056 // Language menu
00057 void sg_LanguageMenu()
00058 {
00059     if (!tLanguage::FirstLanguage())
00060         return;
00061 
00062     uMenu menu("$language_menu_title", false);
00063     //  uMenu menu("Sprach Menu", false);
00064 
00065     uMenuItemExit exit(&menu, "$menuitem_accept", "$menuitem_accept_help");
00066 
00067     uMenuItemSelection<tString> second(&menu,
00068                                        "$language_menu_item_second",
00069                                        "$language_menu_item_second_help",
00070                                        sg_SecondLanguage);
00071 
00072     uMenuItemSelection<tString> first(&menu,
00073                                       "$language_menu_item_fist",
00074                                       "$language_menu_item_first_help",
00075                                       sg_FirstLanguage);
00076 
00077     tLanguage* run = tLanguage::FirstLanguage();
00078 
00079 
00080     while (run)
00081     {
00082         first.NewChoice(run->Name(),"", run->Name());
00083         second.NewChoice(run->Name(),"", run->Name());
00084         run = run->Next();
00085     }
00086 
00087     menu.Enter();
00088 
00089     sg_LanguageInit();
00090 }
00091 
00092 
00093 

Generated on Sat Mar 15 22:56:08 2008 for Armagetron Advanced by  doxygen 1.5.4