From c5d13e7cacd7ca80a323b67cdee84cabd1600f23 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Sat, 6 Jun 2009 05:57:48 +0000 Subject: [PATCH] Erwan - fixed a bug introduced in Momir with previous revision - Added som french translations --- projects/mtg/bin/Res/lang/fr.txt | 24 ++++++++++++++++++---- projects/mtg/include/GameStateDeckViewer.h | 7 ++++--- projects/mtg/src/Damage.cpp | 3 ++- projects/mtg/src/GameStateMenu.cpp | 24 +++++++++++----------- projects/mtg/src/MTGRules.cpp | 5 ++--- 5 files changed, 40 insertions(+), 23 deletions(-) diff --git a/projects/mtg/bin/Res/lang/fr.txt b/projects/mtg/bin/Res/lang/fr.txt index cda86afa3..65720ec6c 100644 --- a/projects/mtg/bin/Res/lang/fr.txt +++ b/projects/mtg/bin/Res/lang/fr.txt @@ -29,12 +29,25 @@ Back to main menu=Retour au menu Save=Sauver Choose a Deck=Choix du deck Choose Opponent=Choix de l'adversaire -(easy)=(facile) -(hard)=(difficile) +(easy)=(*) +(hard)=(***) Random=Aleatoire Interrupt?=Interruption ? X Interrupt - 0 No - [] No to All=X Interrompre - 0 Non - [] Non pour tout X Interrupt - 0 No=X Interrompre - 0 Non +You have a %i%% victory ratio with Deck%i=Vous avez %i%% de reussite avec le Deck%i +You have played %i games with Deck%i=Vous avez fait %i parties avec le Deck %i +You have played a total of %i games=Vous avez fait un total de %i parties +Unlock the difficult mode for more challenging duels!=Debloquez le mode difficile pour plus de challenge! +Interested in playing Momir Basic? You'll have to unlock it first :)=Connaissez-vous le mode Momir Basic ? Essayez de le debloquer pour pouvoir l'essayer ! +You have a total of %i cards in your collection=Vous avez un total de %i cartes dans votre collection +The cards in your collection have an average value of %i credits=La valeur moyenne de chacune de vos cartes est de %i credits +The shopkeeper would buy your entire collection for around %i credits=Le marchand acheterait votre collection pour environ %i credits +You currently have %i credits=Vous possedez %i credits +Need more cards? Go to http://wololo.net/wagic=Vous voulez plus de cartes ? Allez sur http://wololo.net/wagic +These stats will be updated next time you run Wagic=Ces stats seront mises a jour au prochain demarrage de Wagic +Yes=Oui +No=Non #Phases Untap=Degagement @@ -50,6 +63,9 @@ Main phase 2=Phase principale 2 End of turn=Fin du tour Cleanup=Nettoyage +#Stack +Deals %i damage to=Fait %i degat(s) a + #Deck Editor Prev.=Prec. card=carte @@ -61,12 +77,12 @@ Add card=Ajouter carte Display Deck=Afficher deck Remove Card=Enlever carte Display collection=Afficher collection -Your Deck=Votre deck +Your Deck: %i cards=Votre Deck: %i cartes You are currently viewing your=Vous etes sur votre collection. Press TRIANGLE=collection. Appuyez sur TRIANGLE to switch to your deck=pour voir votre deck deck. Press TRIANGLE to=deck. Appuyez sur TRIANGLE -switch to your collection= pour voire votre collection +switch to your collection=pour voir votre collection Deck info=Info deck Sell card=Vendre carte diff --git a/projects/mtg/include/GameStateDeckViewer.h b/projects/mtg/include/GameStateDeckViewer.h index 47772e5a4..7ccc40e7b 100644 --- a/projects/mtg/include/GameStateDeckViewer.h +++ b/projects/mtg/include/GameStateDeckViewer.h @@ -582,7 +582,7 @@ class GameStateDeckViewer: public GameState, public JGuiListener } } int value = myDeck->getCount(); - sprintf(buffer, "%s: %i %s", _("Your Deck").c_str(), value, _("cards").c_str()); + sprintf(buffer, "Your Deck: %i cards", value); font->DrawString(buffer, SCREEN_WIDTH-200+rightTransition, SCREEN_HEIGHT/2 + 25); //TODO, put back ! @@ -641,7 +641,7 @@ class GameStateDeckViewer: public GameState, public JGuiListener JRenderer::GetInstance()->RenderQuad(quad, x , y , 0.0f,scale,scale); if (showName){ char buffer[4096]; - sprintf(buffer, "%s", card->getName()); + sprintf(buffer, "%s", _(card->getName())); float scaleBackup = mFont->GetScale(); mFont->SetScale(scale); mFont->DrawString(buffer,x,y); @@ -721,11 +721,12 @@ class GameStateDeckViewer: public GameState, public JGuiListener welcome_menu->Render(); }else{ renderOnScreenBasicInfo(); - if (sellMenu) sellMenu->Render(); + } if (mStage == STAGE_MENU){ menu->Render(); } + if (sellMenu) sellMenu->Render(); } diff --git a/projects/mtg/src/Damage.cpp b/projects/mtg/src/Damage.cpp index f4be1f530..c1891aab4 100644 --- a/projects/mtg/src/Damage.cpp +++ b/projects/mtg/src/Damage.cpp @@ -3,6 +3,7 @@ #include "../include/MTGCardInstance.h" #include "../include/Counters.h" #include "../include/WEvent.h" +#include "../include/Translate.h" Damage::Damage(int id, MTGCardInstance * _source, Damageable * _target): Interruptible(id){ init(_source, _target, _source->getPower()); @@ -59,7 +60,7 @@ void Damage::Render(){ mFont->SetBase(0); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); char buffer[200]; - sprintf(buffer, "Deals %i damage to", damage); + sprintf(buffer, _("Deals %i damage to").c_str(), damage); mFont->DrawString(buffer, x + 20 , y, JGETEXT_LEFT); JRenderer * renderer = JRenderer::GetInstance(); JQuad * quad = source->getThumb(); diff --git a/projects/mtg/src/GameStateMenu.cpp b/projects/mtg/src/GameStateMenu.cpp index 2a56f0199..8e14d2f6f 100644 --- a/projects/mtg/src/GameStateMenu.cpp +++ b/projects/mtg/src/GameStateMenu.cpp @@ -11,7 +11,7 @@ #include "../include/utils.h" #include "../include/DeckDataWrapper.h" -static const char* GAME_VERSION = "WTH?! 0.6.2 - by WilLoW"; +static const char* GAME_VERSION = "WTH?! 0.7.0 - by WilLoW"; #define ALPHA_WARNING 0 #define DEFAULT_ANGLE_MULTIPLIER 0.4 @@ -187,50 +187,50 @@ void GameStateMenu::fillScroller(){ stats->load(buffer); int percentVictories = stats->percentVictories(); - sprintf(buff2, "You have a %i%% victory ratio with Deck%i",percentVictories,j); + sprintf(buff2, _("You have a %i%% victory ratio with Deck%i").c_str(),percentVictories,j); scroller->Add(buff2); int nbGames = stats->nbGames(); totalGames+= nbGames; - sprintf(buff2, "You have played %i games with Deck%i",nbGames,j); + sprintf(buff2, _("You have played %i games with Deck%i").c_str(),nbGames,j); scroller->Add(buff2); } } if (totalGames){ - sprintf(buff2, "You have played a total of %i games",totalGames); + sprintf(buff2, _("You have played a total of %i games").c_str(),totalGames); scroller->Add(buff2); } GameOptions * go = GameOptions::GetInstance(); if (!go->values[OPTIONS_DIFFICULTY_MODE_UNLOCKED].getIntValue()){ - scroller->Add("Unlock the difficult mode for more challenging duels!"); + scroller->Add(_("Unlock the difficult mode for more challenging duels!")); } if (!go->values[OPTIONS_MOMIR_MODE_UNLOCKED].getIntValue()){ - scroller->Add("Interested in playing Momir Basic? You'll have to unlock it first :)"); + scroller->Add(_("Interested in playing Momir Basic? You'll have to unlock it first :)")); } DeckDataWrapper* ddw = NEW DeckDataWrapper(NEW MTGDeck(RESPATH"/player/collection.dat", mParent->cache,mParent->collection)); int totalCards = ddw->getCount(); if (totalCards){ - sprintf(buff2, "You have a total of %i cards in your collection",totalCards); + sprintf(buff2, _("You have a total of %i cards in your collection").c_str(),totalCards); scroller->Add(buff2); int estimatedValue = ddw->totalPrice(); - sprintf(buff2, "The shopkeeper would buy your entire collection for around %i credits",estimatedValue/2); + sprintf(buff2, _("The shopkeeper would buy your entire collection for around %i credits").c_str(),estimatedValue/2); scroller->Add(buff2); - sprintf(buff2, "The cards in your collection have an average value of %i credits",estimatedValue/totalCards); + sprintf(buff2, _("The cards in your collection have an average value of %i credits").c_str(),estimatedValue/totalCards); scroller->Add(buff2); } delete ddw; PlayerData * playerdata = NEW PlayerData(mParent->collection); - sprintf(buff2, "You currently have %i credits",playerdata->credits); + sprintf(buff2, _("You currently have %i credits").c_str(),playerdata->credits); delete playerdata; scroller->Add(buff2); - scroller->Add("Need more cards? Go to http://wololo.net/wagic"); + scroller->Add(_("Need more cards? Go to http://wololo.net/wagic")); - scroller->Add("These stats will be updated next time you run Wagic"); + scroller->Add(_("These stats will be updated next time you run Wagic")); scrollerSet = 1; scroller->setRandom(); diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 4e742844c..b0774486d 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -176,9 +176,8 @@ vector MTGMomirRule::pool[20]; MTGMomirRule::MTGMomirRule(int _id, MTGAllCards * _collection):MTGAbility(_id, NULL){ collection = _collection; if (!initialized){ - int total_cards = collection->totalCards(); - for (int i = 0; i < total_cards; i++){ - MTGCard * card = collection->collection[i]; + for (int i = 0; i < collection->ids.size(); i++){ + MTGCard * card = collection->collection[collection->ids[i]]; if (card->isACreature()){ int convertedCost = card->getManaCost()->getConvertedCost(); if (convertedCost>20) continue;