Exemplo n.º 1
0
void selectLang()
{
    CLS;
    string in;
    cout << "Please Select Language:" << endll;
    cout << "1.English" << endl;
    cout << "2.简体中文" << endl;
    cout << "3.繁体中文" << endll;
    cout << "Please Select:_\b";
    cin >> in;

    if (in.length() == 1 && isdigit(in[0]))
        switch (in[0])
        {
            case '1':
                Game::langFlag = en_us;
                break;
            case '2':
                Game::langFlag = zh_cn;
                break;
            case '3':
                Game::langFlag = zh_tw;
                break;
            case '4':
                cout << "Developing..." << endl;
                Game::langFlag = en_us;
                PAUSE;
                break;
            default:
                cout << Game::mainLang.ivldipt << endl;
                PAUSE;
                selectLang();
        }
    else
    {
        cout << Game::mainLang.ivldipt << endl;
        PAUSE;
        selectLang();
    }
    Game::mainLang.setLangStrings(Game::langFlag);
}
Exemplo n.º 2
0
/**
 * Draw pause menu
 */
static void ps_drawPause() {
    int x, y;
    
#define selectLang(textEN, textPT) \
  do { \
    if (gl_lang == EN_US) { _op_renderText(textEN, x, y, sizeof(textEN)-1); } \
    else if (gl_lang == PT_BR) { _op_renderText(textPT, x, y, sizeof(textPT)-1); } \
  } while (0)
    
    // Draw the overlay
    transition_drawPause();
    // Render the text
    x = 14;
    y = 6;
    selectLang(" --PAUSED--", "--PAUSADO--");
    
    x = 14;
    y = 10;
    
    _op_renderText("--", x-2, y+_ps_opt, 2);
    
    selectLang("CONTINUE", "CONTINUAR");
    y++;
    selectLang("RETRY", "REINICIAR MAPA");
    y++;
    selectLang("OPTIONS", "OPCOES");
    y++;
    selectLang("QUIT TO MENU", "VOLTAR AO MENU");
    y++;
    selectLang("EXIT GAME", "SAIR DO JOGO");
    
#undef selectLang
}
Exemplo n.º 3
0
void settings()
{
    CLS;
    string in;
    for (int i = 0; i < 4; i++)
        cout << Game::mainLang.sts[i] << endl;
    cout << endl << Game::mainLang.sglipt;

    cin >> in;
    if (in.length() == 1 && isdigit(in[0]))
        switch (in[0])
        {
            case '1':
#ifdef _WIN32
                theme();
#else
                cout << Game::mainLang.themenspt << endl;
                PAUSE;
#endif
                break;
            case '2':
                selectLang();
                break;
            case '3':
                isAssistMode();
                break;
            case '0':
                menu();
            default:
                cout << Game::mainLang.ivldipt << endl;
                PAUSE;
        }
    else
    {
        cout << Game::mainLang.ivldipt << endl;
        PAUSE;
    }
    settings();
}
Exemplo n.º 4
0
void menu()
{
    CLS;

    if (firstRun)
    {
        selectLang();
        isAssistMode();
    }

    firstRun = false;

#ifdef _WIN32
    system(Game::mainLang.title);
#endif

    Game::mainLang.printVersion();
    Game::mainLang.printMenu();

    string in;

    cin >> in;
    cout << endl;

    if (in.length() == 1)
        switch (in[0])
        {
            case '1':
                Game::AIFlag = NON_AI_MODE;
                Game::board.init();
                Game::humanSide = Black;
                gameThread(Human, Human);
            case '2':
                Game::AIFlag = AI_MODE;
                Game::board.init();
                Game::humanSide = Black;
                selectSide();
                Game::diff = selectdiff();
                AchillesInit(Game::diff);
                if (Game::humanSide == Black)
                    gameThread(Human, AI);
                else
                    gameThread(AI, Human);
            case '3':
                Game::AIFlag = AI_MODE;
                Game::autoFlag = true;
                Game::assistFlag = true;
                Game::board.init();

                short diffB, diffW;
                CLS;
                cout << Game::mainLang.atplbs << endl << endl;
                diffB = selectdiff();
                CLS;
                cout << Game::mainLang.atplws << endl << endl;
                diffW = selectdiff();

                autoPlayThread(diffB, diffW);
            case '4':
                Game::UIFlag ^= 1;
                menu();
            case '5':
                Game::board.load();
                if (Game::AIFlag)
                {
                    if (Game::humanSide == Black)
                        gameThread(Human, AI);
                    else
                        gameThread(AI, Human);
                }
                else
                    gameThread(Human, Human);
            case '6':
                settings();
                break;
            case '7':
                Game::mainLang.help();
                menu();
            case '0':
                exit(0);
        }
    else if (in == "ABAB")
        debugMenu();

    if (Game::debugCalled)
        Game::debugCalled = false;
    else
        cout << Game::mainLang.ivldipt << endl;
    PAUSE;
    menu();
}