~vitty/armagetronad/trunk-armagetronad-breakpad

« back to all changes in this revision

Viewing changes to src/tron/gLanguageMenu.cpp

  • Committer: z-man
  • Date: 2010-08-06 07:05:46 UTC
  • Revision ID: svn-v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs:7d95bf1e-0414-0410-9756-b78462a59f44:armagetronad%2Ftrunk%2Farmagetronad:9426
Merging branch 0.2.8 from revision 9356 to 9425:
 ------------------------------------------------------------------------
 r9424 | bazaarmagetron | 2010-06-28 17:45:41 +0200 (Mon, 28 Jun 2010) | 2 lines
 
 Manuel Moos: Improving readability of console and in-game menu by fading the background to black with an alpha quad.
 
 ------------------------------------------------------------------------
 r9423 | bazaarmagetron | 2010-06-25 16:03:21 +0200 (Fri, 25 Jun 2010) | 2 lines
 
 Manuel Moos: Finishing passing of configuration directory from last merge.
 
 ------------------------------------------------------------------------
 r9422 | bazaarmagetron | 2010-06-25 16:02:48 +0200 (Fri, 25 Jun 2010) | 5 lines
 
 author: Manuel Moos
 Merging own changes from earlier:
  - Added passing down of $CONFIG directory in serverstarter scripts.
  - Hovering over color menu items no longer breaks debug recording playback fast forward.
 
 ------------------------------------------------------------------------
 r9421 | bazaarmagetron | 2010-06-24 01:04:25 +0200 (Thu, 24 Jun 2010) | 2 lines
 
 Manuel Moos: Merging own forgotten changes.
 
 ------------------------------------------------------------------------
 r9420 | bazaarmagetron | 2010-06-07 15:19:04 +0200 (Mon, 07 Jun 2010) | 2 lines
 
 Manuel Moos: Avoiding player list read overflow. How did this go unnoticed for so long?
 
 ------------------------------------------------------------------------
 r9419 | bazaarmagetron | 2010-05-27 13:36:19 +0200 (Thu, 27 May 2010) | 2 lines
 
 Manuel Moos: Fixing aspect ratio calculations. In all practical cases, ensuring vertical fov did not happen; in those where something happened (really, really high screens), it overcompensated and distorted the image.
 
 ------------------------------------------------------------------------
 r9418 | bazaarmagetron | 2010-05-26 15:04:31 +0200 (Wed, 26 May 2010) | 2 lines
 
 Manuel Moos: Taking ownership of ALL network objects formerly belonging to a deleted user.
 
 ------------------------------------------------------------------------
 r9417 | bazaarmagetron | 2010-05-26 15:03:55 +0200 (Wed, 26 May 2010) | 2 lines
 
 Manuel Moos: Clearing send queue on new user login. Fixes one instance of odd authentication dialogs popping up.
 
 ------------------------------------------------------------------------
 r9416 | bazaarmagetron | 2010-05-26 15:03:19 +0200 (Wed, 26 May 2010) | 2 lines
 
 Manuel Moos: Simplified default login procedure for @forums accounts.
 
 ------------------------------------------------------------------------
 r9415 | bazaarmagetron | 2010-04-25 23:27:21 +0200 (Sun, 25 Apr 2010) | 2 lines
 
 Manuel Moos: Updated to current version from gnu.org. Address change, formatting, and LGPL is now the lesser GNU License.
 
 ------------------------------------------------------------------------
 r9414 | bazaarmagetron | 2010-04-25 23:26:49 +0200 (Sun, 25 Apr 2010) | 2 lines
 
 Manuel Moos: Using OUR version of COPYING.
 
 ------------------------------------------------------------------------
 r9413 | bazaarmagetron | 2010-04-22 12:33:03 +0200 (Thu, 22 Apr 2010) | 2 lines
 
 Manuel Moos: Avoiding reloading of title screen when textures are reloaded and it isn't actually getting displayed.
 
 ------------------------------------------------------------------------
 r9412 | bazaarmagetron | 2010-04-19 20:02:56 +0200 (Mon, 19 Apr 2010) | 1 line
 
 Luke Dashjr: replace references to guru3.sytes.net with working URIs at forums.armagetronad.net
 ------------------------------------------------------------------------
 r9408 | bazaarmagetron | 2010-04-17 19:02:43 +0200 (Sat, 17 Apr 2010) | 1 line
 
 Luke Dashjr: main is not a valid hack for AC_CHECK_LIB... use valid values
 ------------------------------------------------------------------------
 r9400 | bazaarmagetron | 2010-03-19 23:41:45 +0100 (Fri, 19 Mar 2010) | 1 line
 
 Luke Dashjr: png_sig_cmp is in both libpng12 and libpng14, where as png_check_sig is only libpng12 --ssuominen
 ------------------------------------------------------------------------
 r9377 | bazaarmagetron | 2010-02-22 20:39:56 +0100 (Mon, 22 Feb 2010) | 1 line
 
 Manuel Moos: partial portugese translation
 ------------------------------------------------------------------------
 r9375 | bazaarmagetron | 2010-02-21 01:16:35 +0100 (Sun, 21 Feb 2010) | 2 lines
 
 Manuel Moos: More typo fixes.
 
 ------------------------------------------------------------------------
 r9368 | bazaarmagetron | 2010-02-20 18:08:58 +0100 (Sat, 20 Feb 2010) | 2 lines
 
 Manuel Moos: Rebranding support for configure error messages.
 
 ------------------------------------------------------------------------
 r9367 | bazaarmagetron | 2010-02-20 18:08:00 +0100 (Sat, 20 Feb 2010) | 2 lines
 
 Manuel Moos: Merging start menu branch.
 
 ------------------------------------------------------------------------
 r9366 | bazaarmagetron | 2010-02-20 18:06:37 +0100 (Sat, 20 Feb 2010) | 2 lines
 
 Manuel Moos: Merging tooltip branch.
 
 ------------------------------------------------------------------------
 r9365 | bazaarmagetron | 2010-02-20 18:04:54 +0100 (Sat, 20 Feb 2010) | 2 lines
 
 Manuel Moos: Merging luke's spelling fix branch.
 
 ------------------------------------------------------------------------
 r9364 | bazaarmagetron | 2010-02-19 19:25:59 +0100 (Fri, 19 Feb 2010) | 2 lines
 
 Manuel Moos: "Winner..." message only shown if there is a non-zero win score. Yeah, we don't care if it's negative.
 
 ------------------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "tLocale.h"
31
31
#include "tConfiguration.h"
32
32
 
 
33
#include <vector>
 
34
 
33
35
static tString sg_FirstLanguage("American English"), sg_SecondLanguage("American English");
34
36
 
35
37
static tConfItemLine sg_fl("LANGUAGE_FIRST",sg_FirstLanguage);
75
77
                                      sg_FirstLanguage);
76
78
 
77
79
    tLanguage* run = tLanguage::FirstLanguage();
78
 
 
79
 
 
80
80
    while (run)
81
81
    {
82
82
        first.NewChoice(run->Name(),"", run->Name());
89
89
    sg_LanguageInit();
90
90
}
91
91
 
 
92
// for the first language selection, use a menu item for each language
 
93
class uMenuItemLanguage: public uMenuItemAction
 
94
{
 
95
    // translates the language choice help message
 
96
    static tString TranslateHelpOnTheFly(tLanguage & language)
 
97
    {
 
98
        // temporarily set and translate
 
99
        tLanguage * oldFirst = tLanguage::FirstLanguage();
 
100
        language.SetFirstLanguage();
 
101
        tString ret(tOutput("$language_firstchoice_help"));
 
102
        oldFirst->SetFirstLanguage();
 
103
 
 
104
        return ret;
 
105
    }
 
106
    
 
107
public:
 
108
    uMenuItemLanguage( uMenu *M, tLanguage & language )
 
109
    : uMenuItemAction(M, language.Name(), TranslateHelpOnTheFly(language) )
 
110
    , language_( language )
 
111
    {
 
112
    }
 
113
 
 
114
    virtual void Enter()
 
115
    {
 
116
        language_.SetFirstLanguage();
 
117
        sg_FirstLanguage = language_.Name();
 
118
 
 
119
        menu->Exit();
 
120
    }
 
121
private:
 
122
    tLanguage & language_;
 
123
};
 
124
 
 
125
void sg_StartupLanguageMenu()
 
126
{
 
127
    uMenu menu("$language_menu_title", false);
 
128
 
 
129
    std::vector< uMenuItem * > items;
 
130
    
 
131
    tLanguage* run = tLanguage::FirstLanguage();
 
132
    while (run)
 
133
    {
 
134
        uMenuItem * item = tNEW(uMenuItemLanguage)( &menu, *run );
 
135
        items.push_back( item );
 
136
 
 
137
        run = run->Next();
 
138
    }
 
139
 
 
140
    menu.ReverseItems();
 
141
    menu.Enter();
 
142
 
 
143
    for( std::vector< uMenuItem * >::iterator i = items.begin(); i != items.end(); ++i )
 
144
    {
 
145
        delete *i;
 
146
    }
 
147
}
 
148
 
92
149
 
93
150