Changeset 414 – HoverRace

Changeset 414

Show
Ignore:
Timestamp:
02/16/09 22:07:36 (18 months ago)
Author:
zoogie
Message:

#102: The craft selection text in the HUD (at the start of the game) is now translatable.

Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/client/Game2/Game2.rc

    r397 r414  
    12771277    IDS_SAMEADDRPORT2       " are using the same IP and port!" 
    12781278    IDS_CONN_ERROR          "Connection error with " 
    1279     IDS_SELECT_CRAFT        "<==   Select your craft with the arrow keys   ==>" 
    1280     IDS_BASIC_CRAFT_DESC    "Basic craft" 
    1281     IDS_BI_TURBO_CRAFT_DESC "Bi-Turbo craft" 
    1282     IDS_CX_CRAFT_DESC       "CX craft" 
    1283     IDS_EON_CRAFT_DESC      "Eon craft" 
    12841279END 
    12851280 
  • trunk/client/Game2/Observer.cpp

    r323 r414  
    2727#include "resource.h" 
    2828#include "../../engine/Util/StrRes.h" 
     29#include "../../engine/VideoServices/StaticText.h" 
    2930 
    3031#include <math.h> 
     32 
     33using HoverRace::VideoServices::StaticText; 
    3134 
    3235#define NB_PLAYER_PAGE 10 
     
    4952CString gCurLapStr = MR_LoadString(IDS_CUR_LAP); 
    5053 
    51 CString gChooseCraft = MR_LoadString(IDS_SELECT_CRAFT); 
    52 CString gBasicStr = MR_LoadString(IDS_BASIC_CRAFT_DESC); 
    53 CString gBiStr = MR_LoadString(IDS_BI_TURBO_CRAFT_DESC); 
    54 CString gCXStr = MR_LoadString(IDS_CX_CRAFT_DESC); 
    55 CString gEonStr = MR_LoadString(IDS_EON_CRAFT_DESC); 
     54static const char *GetCraftName(int id) 
     55{ 
     56    static const char *names[4] = { 
     57        _("Basic craft"), 
     58        _("CX craft"), 
     59        _("Bi-Turbo craft"), 
     60        _("Eon craft"), 
     61        }; 
     62    static const char *unknown = _("Unknown craft"); 
     63    return (id >= 0 && id < 4) ? names[id] : unknown; 
     64} 
    5665 
    5766MR_Observer::MR_Observer() 
     
    8695    mHoverIcons = (MR_SpriteHandle *) MR_DllObjectFactory::CreateObject(lHoverIconsId); 
    8796 
     97    std::string selectStr("<==   "); 
     98    selectStr += _("Select your craft with the arrow keys"); 
     99    selectStr += "   ==>"; 
     100    selectCraftTxt = new StaticText(selectStr, "Arial", 16, true, true, 0x2c); 
     101 
     102    craftTxt = new StaticText("", "Arial", 20, true, false, 0x47); 
    88103} 
    89104 
    90105MR_Observer::~MR_Observer() 
    91106{ 
     107    delete craftTxt; 
     108    delete selectCraftTxt; 
     109 
    92110    delete mBaseFont; 
    93111    delete mMissileLevel; 
     
    742760            sprintf(lMainLineBuffer, gCountdownStr, (pTime % 60000) / 1000, (pTime % 1000) / 10, pViewingCharacter->GetTotalLap()); 
    743761             
    744             // craft info -- not added below since this is the only time this line is used 
    745             char lCraftInfoBuffer[80]; 
    746  
    747762            int lFontScaling = 1 + (mBaseFont->GetSprite()->GetItemHeight() * 30) / (lYRes); 
    748763            int lLineHeight = (mBaseFont->GetSprite()->GetItemHeight() / lFontScaling); 
    749764 
    750             if(pSession->GetMainCharacter()->GetHoverModel() == 0) // basic 
    751                 sprintf(lCraftInfoBuffer, gBasicStr); 
    752             else if(pSession->GetMainCharacter()->GetHoverModel() == 1) // cx 
    753                 sprintf(lCraftInfoBuffer, gCXStr); 
    754             else if(pSession->GetMainCharacter()->GetHoverModel() == 2) // bi-turbo 
    755                 sprintf(lCraftInfoBuffer, gBiStr); 
    756             else if(pSession->GetMainCharacter()->GetHoverModel() == 3) // eon 
    757                 sprintf(lCraftInfoBuffer, gEonStr); 
    758  
    759             mBaseFont->GetSprite()->StrBlt(lXRes / 2, lYRes / 16 + lLineHeight, Ascii2Simple(gChooseCraft), &m3DView, MR_Sprite::eCenter, MR_Sprite::eTop, lFontScaling); 
    760             mBaseFont->GetSprite()->StrBlt(lXRes / 2, lYRes / 16 + 2 * lLineHeight, Ascii2Simple(lCraftInfoBuffer), &m3DView, MR_Sprite::eCenter, MR_Sprite::eTop, lFontScaling); 
     765            selectCraftTxt->Blt(lXRes / 2, lYRes / 16 + lLineHeight, &m3DView, true); 
     766 
     767            craftTxt->SetText(GetCraftName(pSession->GetMainCharacter()->GetHoverModel())); 
     768            craftTxt->Blt(lXRes / 2, lYRes / 16 + lLineHeight + selectCraftTxt->GetHeight(), &m3DView, true); 
    761769        } 
    762770        else if(pViewingCharacter->GetTotalLap() <= pViewingCharacter->GetLap()) { 
  • trunk/client/Game2/Observer.h

    r217 r414  
    2828#include "../../engine/MainCharacter/MainCharacter.h" 
    2929#include "../../engine/ObjFacTools/SpriteHandle.h" 
     30 
     31namespace HoverRace { namespace VideoServices { class StaticText; } } 
    3032 
    3133class MR_Observer 
     
    6971        MR_SpriteHandle *mPowerUpDisp; 
    7072        MR_SpriteHandle *mHoverIcons; 
     73 
     74        HoverRace::VideoServices::StaticText *selectCraftTxt; 
     75        HoverRace::VideoServices::StaticText *craftTxt; 
    7176 
    7277        MR_Observer(); 
  • trunk/client/Game2/resource.h

    r384 r414  
    346346#define IDS_SAMEADDRPORT2               40233 
    347347#define IDS_CONN_ERROR                  40234 
    348 #define IDS_SELECT_CRAFT                40235 
    349 #define IDS_BASIC_CRAFT_DESC            40236 
    350 #define IDS_BI_TURBO_CRAFT_DESC         40237 
    351 #define IDS_CX_CRAFT_DESC               40238 
    352 #define IDS_EON_CRAFT_DESC              40239 
    353348#define IDS_INVALID_RESOLUTION          40240 
    354349#define IDS_TEST_RESOLUTION             40241 
  • trunk/po/de.po

    r407 r414  
    77"Project-Id-Version: hoverrace 1.24\n" 
    88"Report-Msgid-Bugs-To: \n" 
    9 "POT-Creation-Date: 2009-02-07 16:35-0500\n" 
     9"POT-Creation-Date: 2009-02-16 21:55-0500\n" 
    1010"PO-Revision-Date: 2009-02-07 17:07-0500\n" 
    1111"Last-Translator: Ryan Curtin <ryan@igglybob.com>\n" 
     
    5858 
    5959#: client/Game2/GameApp.cpp:2691 
    60 msgid "and with the help of the many testers willing to put up with bugs and other strange happenings." 
    61 msgstr "und mit der Hilfe vieler Prüfern, die Fehler und Merkwürdigen tolerieren." 
     60msgid "" 
     61"and with the help of the many testers willing to put up with bugs and other " 
     62"strange happenings." 
     63msgstr "" 
     64"und mit der Hilfe vieler Prüfern, die Fehler und Merkwürdigen tolerieren." 
    6265 
    6366#: client/Game2/GameApp.cpp:2693 
     
    7376msgstr "Schließen" 
    7477 
    75 #: client/Game2/NetInterface.cpp:463 
    76 #: client/Game2/NetInterface.cpp:484 
    77 #: client/Game2/NetInterface.cpp:496 
    78 #: client/Game2/NetInterface.cpp:554 
    79 #: client/Game2/NetInterface.cpp:574 
    80 #: client/Game2/NetInterface.cpp:629 
    81 #: client/Game2/NetInterface.cpp:709 
    82 #: client/Game2/NetInterface.cpp:719 
    83 #: client/Game2/NetInterface.cpp:890 
    84 #: client/Game2/NetInterface.cpp:1652 
     78#: client/Game2/NetInterface.cpp:463 client/Game2/NetInterface.cpp:484 
     79#: client/Game2/NetInterface.cpp:496 client/Game2/NetInterface.cpp:554 
     80#: client/Game2/NetInterface.cpp:574 client/Game2/NetInterface.cpp:629 
     81#: client/Game2/NetInterface.cpp:709 client/Game2/NetInterface.cpp:719 
     82#: client/Game2/NetInterface.cpp:890 client/Game2/NetInterface.cpp:1652 
    8583msgid "TCP Server" 
    8684msgstr "" 
    8785 
    88 #: client/Game2/NetInterface.cpp:463 
    89 #: client/Game2/NetInterface.cpp:554 
     86#: client/Game2/NetInterface.cpp:463 client/Game2/NetInterface.cpp:554 
    9087#: client/Game2/NetInterface.cpp:890 
    9188msgid "Unable to create socket" 
    9289msgstr "" 
    9390 
    94 #: client/Game2/NetInterface.cpp:483 
    95 #: client/Game2/NetInterface.cpp:719 
     91#: client/Game2/NetInterface.cpp:483 client/Game2/NetInterface.cpp:719 
    9692msgid "Unable to use the port, try to close some WINSOCK applications" 
    9793msgstr "" 
    9894 
    99 #: client/Game2/NetInterface.cpp:495 
    100 #: client/Game2/NetInterface.cpp:573 
     95#: client/Game2/NetInterface.cpp:495 client/Game2/NetInterface.cpp:573 
    10196#: client/Game2/NetInterface.cpp:628 
    102 msgid "Unable to use UDP recv port; choose a different port or close some Winsock applications." 
     97msgid "" 
     98"Unable to use UDP recv port; choose a different port or close some Winsock " 
     99"applications." 
    103100msgstr "" 
    104101 
     
    120117 
    121118#: client/Game2/NetInterface.cpp:1694 
    122 msgid "; perhaps they are behind a firewall and need to forward ports 9530 and 9531 TCP and UDP?" 
    123 msgstr "" 
    124  
    125 #: client/Game2/NetInterface.cpp:1696 
    126 #: client/Game2/NetInterface.cpp:1735 
    127 #: client/Game2/NetInterface.cpp:1761 
    128 #: client/Game2/NetInterface.cpp:1771 
     119msgid "" 
     120"; perhaps they are behind a firewall and need to forward ports 9530 and 9531 " 
     121"TCP and UDP?" 
     122msgstr "" 
     123 
     124#: client/Game2/NetInterface.cpp:1696 client/Game2/NetInterface.cpp:1735 
     125#: client/Game2/NetInterface.cpp:1761 client/Game2/NetInterface.cpp:1771 
    129126msgid "TCP Client" 
    130127msgstr "" 
     
    150147msgstr "" 
    151148 
    152 #: client/Game2/TrackSelect.cpp:119 
    153 #: client/Game2/TrackSelect.cpp:129 
     149#: client/Game2/Observer.cpp:58 
     150msgid "Basic craft" 
     151msgstr "" 
     152 
     153#: client/Game2/Observer.cpp:59 
     154msgid "CX craft" 
     155msgstr "" 
     156 
     157#: client/Game2/Observer.cpp:60 
     158msgid "Bi-Turbo craft" 
     159msgstr "" 
     160 
     161#: client/Game2/Observer.cpp:61 
     162msgid "Eon craft" 
     163msgstr "" 
     164 
     165#: client/Game2/Observer.cpp:63 
     166msgid "Unknown craft" 
     167msgstr "" 
     168 
     169#: client/Game2/Observer.cpp:101 
     170msgid "Select your craft with the arrow keys" 
     171msgstr "" 
     172 
     173#: client/Game2/TrackSelect.cpp:119 client/Game2/TrackSelect.cpp:129 
    154174msgid "Bad track file format" 
    155175msgstr "Falsches Strecke Dateiformat" 
     
    183203msgstr "Abbrechen" 
    184204 
    185 #: client/Game2/TrackSelect.cpp:211 
    186 #: client/Game2/TrackSelect.cpp:230 
     205#: client/Game2/TrackSelect.cpp:211 client/Game2/TrackSelect.cpp:230 
    187206msgid " no selection" 
    188207msgstr " nichts ist ausgewählt" 
     
    192211msgstr "Die Anzahl von Runden soll zwischen 1 und 99" 
    193212 
    194 #: client/Game2/main.cpp:225 
     213#: client/Game2/main.cpp:229 
    195214#, fuzzy, c-format, boost-format 
    196215msgid "" 
     
    202221"Bitte besuchen Sie %s zu lernen, wie man\n" 
    203222"diesem Projekt mitwirken kann." 
    204  
  • trunk/po/en_US@piglatin.po

    r408 r414  
    88"Project-Id-Version: PACKAGE VERSION\n" 
    99"Report-Msgid-Bugs-To: \n" 
    10 "POT-Creation-Date: 2009-02-07 16:32-0500\n" 
    11 "PO-Revision-Date: 2009-02-07 17:11-0500\n" 
    12 "Last-Translator: Ryan Curtin <ryan@igglybob.com>\n" 
     10"POT-Creation-Date: 2009-02-16 21:55-0500\n" 
     11"PO-Revision-Date: 2009-02-16 22:03-0500\n" 
     12"Last-Translator: Michael Imamura <zoogie@lugatgt.org>\n" 
    1313"Language-Team: English\n" 
    1414"MIME-Version: 1.0\n" 
     
    149149msgstr "Onnectioncay erroray ithway" 
    150150 
     151#: client/Game2/Observer.cpp:58 
     152msgid "Basic craft" 
     153msgstr "Asicbay aftcray" 
     154 
     155#: client/Game2/Observer.cpp:59 
     156msgid "CX craft" 
     157msgstr "CX aftcray" 
     158 
     159#: client/Game2/Observer.cpp:60 
     160msgid "Bi-Turbo craft" 
     161msgstr "Bi-Turbo aftcray" 
     162 
     163#: client/Game2/Observer.cpp:61 
     164msgid "Eon craft" 
     165msgstr "Eon aftcray" 
     166 
     167#: client/Game2/Observer.cpp:63 
     168msgid "Unknown craft" 
     169msgstr "Unknownway aftcray" 
     170 
     171#: client/Game2/Observer.cpp:101 
     172msgid "Select your craft with the arrow keys" 
     173msgstr "Electsay ouryay aftcray ithway ethey arrowyay eyskay" 
     174 
    151175#: client/Game2/TrackSelect.cpp:119 
    152176#: client/Game2/TrackSelect.cpp:129 
     
    191215msgstr "Umbernay of apslay ouldshay ebay etweenbay 1 and 99" 
    192216 
    193 #: client/Game2/main.cpp:225 
     217#: client/Game2/main.cpp:229 
    194218#, c-format, boost-format 
    195219msgid "" 
  • trunk/po/ja.po

    r407 r414  
    77"Project-Id-Version: hoverrace 1.24\n" 
    88"Report-Msgid-Bugs-To: \n" 
    9 "POT-Creation-Date: 2009-02-07 16:32-0500\n" 
    10 "PO-Revision-Date: 2009-02-04 00:10-0500\n" 
     9"POT-Creation-Date: 2009-02-16 21:55-0500\n" 
     10"PO-Revision-Date: 2009-02-16 21:59-0500\n" 
    1111"Last-Translator: Michael Imamura <zoogie@lugatgt.org>\n" 
    1212"Language-Team: Japanese\n" 
     
    5454 
    5555#: client/Game2/GameApp.cpp:2691 
    56 msgid "" 
    57 "and with the help of the many testers willing to put up with bugs and other " 
    58 "strange happenings." 
     56msgid "and with the help of the many testers willing to put up with bugs and other strange happenings." 
    5957msgstr "" 
    6058 
     
    7169msgstr "閉じる" 
    7270 
    73 #: client/Game2/NetInterface.cpp:463 client/Game2/NetInterface.cpp:484 
    74 #: client/Game2/NetInterface.cpp:496 client/Game2/NetInterface.cpp:554 
    75 #: client/Game2/NetInterface.cpp:574 client/Game2/NetInterface.cpp:629 
    76 #: client/Game2/NetInterface.cpp:709 client/Game2/NetInterface.cpp:719 
    77 #: client/Game2/NetInterface.cpp:890 client/Game2/NetInterface.cpp:1652 
     71#: client/Game2/NetInterface.cpp:463 
     72#: client/Game2/NetInterface.cpp:484 
     73#: client/Game2/NetInterface.cpp:496 
     74#: client/Game2/NetInterface.cpp:554 
     75#: client/Game2/NetInterface.cpp:574 
     76#: client/Game2/NetInterface.cpp:629 
     77#: client/Game2/NetInterface.cpp:709 
     78#: client/Game2/NetInterface.cpp:719 
     79#: client/Game2/NetInterface.cpp:890 
     80#: client/Game2/NetInterface.cpp:1652 
    7881msgid "TCP Server" 
    7982msgstr "" 
    8083 
    81 #: client/Game2/NetInterface.cpp:463 client/Game2/NetInterface.cpp:554 
     84#: client/Game2/NetInterface.cpp:463 
     85#: client/Game2/NetInterface.cpp:554 
    8286#: client/Game2/NetInterface.cpp:890 
    8387msgid "Unable to create socket" 
    8488msgstr "" 
    8589 
    86 #: client/Game2/NetInterface.cpp:483 client/Game2/NetInterface.cpp:719 
     90#: client/Game2/NetInterface.cpp:483 
     91#: client/Game2/NetInterface.cpp:719 
    8792msgid "Unable to use the port, try to close some WINSOCK applications" 
    8893msgstr "" 
    8994 
    90 #: client/Game2/NetInterface.cpp:495 client/Game2/NetInterface.cpp:573 
     95#: client/Game2/NetInterface.cpp:495 
     96#: client/Game2/NetInterface.cpp:573 
    9197#: client/Game2/NetInterface.cpp:628 
    92 msgid "" 
    93 "Unable to use UDP recv port; choose a different port or close some Winsock " 
    94 "applications." 
     98msgid "Unable to use UDP recv port; choose a different port or close some Winsock applications." 
    9599msgstr "" 
    96100 
     
    112116 
    113117#: client/Game2/NetInterface.cpp:1694 
    114 msgid "" 
    115 "; perhaps they are behind a firewall and need to forward ports 9530 and 9531 " 
    116 "TCP and UDP?" 
    117 msgstr "" 
    118  
    119 #: client/Game2/NetInterface.cpp:1696 client/Game2/NetInterface.cpp:1735 
    120 #: client/Game2/NetInterface.cpp:1761 client/Game2/NetInterface.cpp:1771 
     118msgid "; perhaps they are behind a firewall and need to forward ports 9530 and 9531 TCP and UDP?" 
     119msgstr "" 
     120 
     121#: client/Game2/NetInterface.cpp:1696 
     122#: client/Game2/NetInterface.cpp:1735 
     123#: client/Game2/NetInterface.cpp:1761 
     124#: client/Game2/NetInterface.cpp:1771 
    121125msgid "TCP Client" 
    122126msgstr "" 
     
    142146msgstr "" 
    143147 
    144 #: client/Game2/TrackSelect.cpp:119 client/Game2/TrackSelect.cpp:129 
     148#: client/Game2/Observer.cpp:58 
     149msgid "Basic craft" 
     150msgstr "基本的な車両" 
     151 
     152#: client/Game2/Observer.cpp:59 
     153msgid "CX craft" 
     154msgstr "CX 車両" 
     155 
     156#: client/Game2/Observer.cpp:60 
     157msgid "Bi-Turbo craft" 
     158msgstr "Bi-Turbo 車両" 
     159 
     160#: client/Game2/Observer.cpp:61 
     161msgid "Eon craft" 
     162msgstr "Eon 車両" 
     163 
     164#: client/Game2/Observer.cpp:63 
     165msgid "Unknown craft" 
     166msgstr "無名車両" 
     167 
     168#: client/Game2/Observer.cpp:101 
     169msgid "Select your craft with the arrow keys" 
     170msgstr "車両は、矢印キーで選択してください" 
     171 
     172#: client/Game2/TrackSelect.cpp:119 
     173#: client/Game2/TrackSelect.cpp:129 
    145174msgid "Bad track file format" 
    146175msgstr "" 
     
    174203msgstr "キャンセル" 
    175204 
    176 #: client/Game2/TrackSelect.cpp:211 client/Game2/TrackSelect.cpp:230 
     205#: client/Game2/TrackSelect.cpp:211 
     206#: client/Game2/TrackSelect.cpp:230 
    177207msgid " no selection" 
    178208msgstr "" 
     
    182212msgstr "" 
    183213 
    184 #: client/Game2/main.cpp:225 
     214#: client/Game2/main.cpp:229 
    185215#, c-format, boost-format 
    186216msgid "" 
     
    189219"contribute to this project." 
    190220msgstr "" 
     221