Skip to content

Commit

Permalink
Add language choice in options.
Browse files Browse the repository at this point in the history
  • Loading branch information
colin.pitrat committed Nov 9, 2007
1 parent 523c2ca commit ba53255
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 79 deletions.
48 changes: 26 additions & 22 deletions po/AlThreat.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2007-11-09 20:15+0100\n"
"POT-Creation-Date: 2007-11-10 00:00+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -48,51 +48,51 @@ msgstr ""
msgid " Energy: "
msgstr ""

#: ../src/Menu.cc:28
#: ../src/Menu.cc:77
msgid "Adventure"
msgstr ""

#: ../src/Menu.cc:29
#: ../src/Menu.cc:78
msgid "Training"
msgstr ""

#: ../src/Menu.cc:30 ../src/MenuJeu.cc:14
#: ../src/Menu.cc:79 ../src/MenuJeu.cc:14
msgid "Options"
msgstr ""

#: ../src/Menu.cc:31
#: ../src/Menu.cc:80
msgid "Credits"
msgstr ""

#: ../src/Menu.cc:32
#: ../src/Menu.cc:81
msgid "Quit"
msgstr ""

#: ../src/Menu.cc:106 ../src/Options.cc:55
#: ../src/Menu.cc:117 ../src/Options.cc:72
msgid "OK"
msgstr ""

#: ../src/Menu.cc:135
#: ../src/Menu.cc:146
msgid "Development: Skippy"
msgstr ""

#: ../src/Menu.cc:136
#: ../src/Menu.cc:147
msgid "Graphisms: Raz & Skippy"
msgstr ""

#: ../src/Menu.cc:137
#: ../src/Menu.cc:148
msgid "Music: Raz & Vavrek"
msgstr ""

#: ../src/Menu.cc:138
#: ../src/Menu.cc:149
msgid "-=( the3fold )=-"
msgstr ""

#: ../src/Menu.cc:139
#: ../src/Menu.cc:150
msgid "http://www.vavrek.com"
msgstr ""

#: ../src/Menu.cc:140
#: ../src/Menu.cc:151
msgid "http://the3fold.free.fr"
msgstr ""

Expand Down Expand Up @@ -124,39 +124,43 @@ msgstr ""
msgid "Modify controls"
msgstr ""

#: ../src/Options.cc:60
#: ../src/Options.cc:55
msgid "Language:"
msgstr ""

#: ../src/Options.cc:77
msgid "Cancel"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Up"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Down"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Left"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Right"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Fire"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Special weapon"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Shield"
msgstr ""

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Pause"
msgstr ""

Expand Down
3 changes: 1 addition & 2 deletions po/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
POFILES = $(top_srcdir)/po/fr_FR/LC_MESSAGES/AlThreat.po

MOFILES = $(POFILES:.po=.mo)
MOFILES = $(top_builddir)/po/fr_FR/LC_MESSAGES/AlThreat.mo

SRCFILES = $(top_srcdir)/src/AlThreat.cc \
$(top_srcdir)/src/Arme.cc \
Expand Down Expand Up @@ -63,7 +63,6 @@ $(MOFILES): $(POFILES)
$(MSGFMT) -o $@ $<

$(POFILES): $(POTFILE)
echo $(MOFILES)
test -f $@ && $(MSGMERGE) $(MSGMERGE_OPTIONS) $@ $(POTFILE)

$(POTFILE): $(SRCFILES)
Expand Down
3 changes: 1 addition & 2 deletions po/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
POFILES = $(top_srcdir)/po/fr_FR/LC_MESSAGES/AlThreat.po
MOFILES = $(POFILES:.po=.mo)
MOFILES = $(top_builddir)/po/fr_FR/LC_MESSAGES/AlThreat.mo
SRCFILES = $(top_srcdir)/src/AlThreat.cc \
$(top_srcdir)/src/Arme.cc \
$(top_srcdir)/src/Arme.h \
Expand Down Expand Up @@ -410,7 +410,6 @@ $(MOFILES): $(POFILES)
$(MSGFMT) -o $@ $<

$(POFILES): $(POTFILE)
echo $(MOFILES)
test -f $@ && $(MSGMERGE) $(MSGMERGE_OPTIONS) $@ $(POTFILE)

$(POTFILE): $(SRCFILES)
Expand Down
48 changes: 26 additions & 22 deletions po/fr_FR/LC_MESSAGES/AlThreat.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: AlThreat 0.3\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2007-11-08 21:36+0100\n"
"POT-Creation-Date: 2007-11-10 00:00+0100\n"
"PO-Revision-Date: 2007-11-07 22:38+0100\n"
"Last-Translator: <[email protected]>\n"
"Language-Team: French\n"
Expand Down Expand Up @@ -49,51 +49,51 @@ msgstr " Vies : "
msgid " Energy: "
msgstr " Energie : "

#: ../src/Menu.cc:28
#: ../src/Menu.cc:77
msgid "Adventure"
msgstr "Aventure"

#: ../src/Menu.cc:29
#: ../src/Menu.cc:78
msgid "Training"
msgstr "Entrainement"

#: ../src/Menu.cc:30 ../src/MenuJeu.cc:14
#: ../src/Menu.cc:79 ../src/MenuJeu.cc:14
msgid "Options"
msgstr "Options"

#: ../src/Menu.cc:31
#: ../src/Menu.cc:80
msgid "Credits"
msgstr "Credits"

#: ../src/Menu.cc:32
#: ../src/Menu.cc:81
msgid "Quit"
msgstr "Quitter"

#: ../src/Menu.cc:106 ../src/Options.cc:55
#: ../src/Menu.cc:117 ../src/Options.cc:72
msgid "OK"
msgstr "OK"

#: ../src/Menu.cc:135
#: ../src/Menu.cc:146
msgid "Development: Skippy"
msgstr "Programmation : Skippy"

#: ../src/Menu.cc:136
#: ../src/Menu.cc:147
msgid "Graphisms: Raz & Skippy"
msgstr "Graphismes : Raz & Skippy"

#: ../src/Menu.cc:137
#: ../src/Menu.cc:148
msgid "Music: Raz & Vavrek"
msgstr "Musique : Raz & Vavrek"

#: ../src/Menu.cc:138
#: ../src/Menu.cc:149
msgid "-=( the3fold )=-"
msgstr ""

#: ../src/Menu.cc:139
#: ../src/Menu.cc:150
msgid "http://www.vavrek.com"
msgstr ""

#: ../src/Menu.cc:140
#: ../src/Menu.cc:151
msgid "http://the3fold.free.fr"
msgstr ""

Expand Down Expand Up @@ -125,39 +125,43 @@ msgstr "Volume des effets sonores :"
msgid "Modify controls"
msgstr "Modifier les controles"

#: ../src/Options.cc:60
#: ../src/Options.cc:55
msgid "Language:"
msgstr "Langue"

#: ../src/Options.cc:77
msgid "Cancel"
msgstr "Annuler"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Up"
msgstr "Haut"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Down"
msgstr "Bas"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Left"
msgstr "Gauche"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Right"
msgstr "Droite"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Fire"
msgstr "Feu"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Special weapon"
msgstr "Arme speciale"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Shield"
msgstr "Bouclier"

#: ../src/Options.cc:239
#: ../src/Options.cc:258
msgid "Pause"
msgstr "Pause"

Expand Down
1 change: 0 additions & 1 deletion src/Configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Configuration::Configuration()
joysticks = NULL;

char* locale = setlocale(LC_ALL, NULL);
std::cout << "locale : " << locale << std::endl;
if(locale && strstr(locale, "fr"))
_lang = "fr_FR";
else
Expand Down
53 changes: 32 additions & 21 deletions src/Menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,8 @@ Menu::Menu()
fond = loadImage((configuration->getDataDir() + "images/Menu.png").c_str());
Selected = 0;

nbChoix = 5;
texte = new std::string[nbChoix];
texte[0] = _("Adventure");
texte[1] = _("Training");
texte[2] = _("Options");
texte[3] = _("Credits");
texte[4] = _("Quit");

SDL_Rect dest[nbChoix];
MenuButton *choixBoutons[nbChoix];
menuLayer = new FocusContainer();
for(int i = 0; i < nbChoix; i++)
{
dest[i].w = 180;
dest[i].h = 40;
dest[i].x = (Screen->w - dest[i].w) / 2;
dest[i].y = (Screen->h - nbChoix * dest[i].h - (nbChoix - 1) * dest[i].h / 2) / 2 + i * dest[i].h + (i - 1) * dest[i].h;
choixBoutons[i] = new MenuButton(dest[i], texte[i], i, &Selected, &choisi);
choixBoutons[i]->setFont((configuration->getDataDir() + "fonts/babelfish.ttf").c_str(), 30);
menuLayer->addWidget(choixBoutons[i]);
}
menuLayer->focus(choixBoutons[0]);
init_text();
}

Menu::~Menu()
Expand Down Expand Up @@ -86,10 +66,41 @@ void Menu::init()
}
}

void Menu::init_text()
{
SDL_Surface *Screen = SDL_GetVideoSurface();
if(texte) delete[] texte;
if(menuLayer) menuLayer->deleteAll();

nbChoix = 5;
texte = new std::string[nbChoix];
texte[0] = _("Adventure");
texte[1] = _("Training");
texte[2] = _("Options");
texte[3] = _("Credits");
texte[4] = _("Quit");

SDL_Rect dest[nbChoix];
MenuButton *choixBoutons[nbChoix];
for(int i = 0; i < nbChoix; i++)
{
dest[i].w = 180;
dest[i].h = 40;
dest[i].x = (Screen->w - dest[i].w) / 2;
dest[i].y = (Screen->h - nbChoix * dest[i].h - (nbChoix - 1) * dest[i].h / 2) / 2 + i * dest[i].h + (i - 1) * dest[i].h;
choixBoutons[i] = new MenuButton(dest[i], texte[i], i, &Selected, &choisi);
choixBoutons[i]->setFont((configuration->getDataDir() + "fonts/babelfish.ttf").c_str(), 30);
menuLayer->addWidget(choixBoutons[i]);
}

menuLayer->focus(choixBoutons[0]);
}

void Menu::show_options()
{
Options *options = new Options(fond, musique, configuration->getDataDir() + "sons/Menusong.ogg");
options->afficher();
init_text();
}

void Menu::show_credits()
Expand Down
1 change: 1 addition & 0 deletions src/Menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Menu
unsigned char show(Game *&jeu);
~Menu();
void init();
void init_text();

private:
Menu();
Expand Down
Loading

0 comments on commit ba53255

Please sign in to comment.