Exemplo n.º 1
0
static int time_out_action(int i)
{
    audio_play(AUD_MENU, 1.0f);

    switch (i)
    {
    case TIME_OUT_BACK:
        /* Fall through. */

    case TIME_OUT_OVER:
        progress_stop();
        return goto_state(&st_over);

    case TIME_OUT_SAVE:
        progress_stop();
        return goto_save(&st_time_out, &st_time_out);

    case TIME_OUT_NEXT:
        if (progress_next())
            return goto_state(&st_level);
        break;

    case TIME_OUT_SAME:
        if (progress_same())
            return goto_state(&st_level);
        break;
    }

    return 1;
}
Exemplo n.º 2
0
void view_player::run_model_tour( model_player* model ){

    //
    _ref_model_player=model;

    //
    progress_next();
}
Exemplo n.º 3
0
//+++++++++++++++++++++++++
void view_player::run_model_interrogation( model_player* model ){

    //
    _ref_model_player=model;

    //
    progress_next();
}
Exemplo n.º 4
0
static int goal_action(int i)
{
    audio_play(AUD_MENU, 1.0f);

    switch (i)
    {
    case GOAL_BACK:
        /* Fall through. */

    case GOAL_OVER:
        progress_stop();
        return goto_state(&st_over);

    case GOAL_SAVE:
        resume = 1;

        progress_stop();
        return goto_save(&st_goal, &st_goal);

    case GUI_NAME:
        new_name = 1;
        resume = 1;

        progress_stop();
        return goto_name(&st_goal, &st_goal, 0);

    case GOAL_DONE:
        progress_stop();
        progress_exit();
        return goto_state(&st_done);

    case GOAL_LAST:
        progress_stop();
        return goto_state(&st_start);

    case GUI_MOST_COINS:
    case GUI_BEST_TIMES:
    case GUI_FAST_UNLOCK:
        gui_score_set(i);
        resume = 1;
        return goto_state(&st_goal);

    case GOAL_NEXT:
        if (progress_next())
            return goto_state(&st_level);
        break;

    case GOAL_SAME:
        if (progress_same())
            return goto_state(&st_level);
        break;
    }

    return 1;
}
Exemplo n.º 5
0
static int goal_action(int tok, int val)
{
    audio_play(AUD_MENU, 1.0f);

    switch (tok)
    {
    case GUI_BACK:
    case GOAL_OVER:
        progress_stop();
        return goto_state(&st_exit);

    case GUI_SAVE:
        progress_stop();
        return goto_save(&st_goal, &st_goal);

    case GUI_NAME:
        progress_stop();
        return goto_name(&st_goal, &st_goal, 0);

    case GOAL_DONE:
        progress_stop();
        progress_exit();
        return goto_state(&st_exit);

    case GOAL_LAST:
        progress_stop();
        return goto_state(&st_exit);

    case GUI_SCORE:
        gui_score_set(val);
        return goto_state(&st_goal);

    case GOAL_NEXT:
        if (progress_next())
            return goto_state(&st_level);
        break;

    case GOAL_SAME:
        if (progress_same())
            return goto_state(&st_level);
        break;
    }

    return 1;
}
Exemplo n.º 6
0
//+++++++++++++++++++++++++
void view_player::init_view(){

    //
    _grid = new QGridLayout;
    setLayout( _grid );

    //  Size/Position.
    //
    int total_width=4;
    int text_height=4;
    int question_height = 2;
    int button_height=1;

    //  Create the first hbox.
    //
    {

        //  Make.
        //
        QHBoxLayout *box = new QHBoxLayout;

        //  Create the text browser.
        //
        _text_browser = new QTextBrowser();
        box->addWidget( _text_browser );

        //  Store.
        //
        _list_hbox.push_back( box );

        //
        _grid->addLayout( box, 0,0, text_height,total_width );
    }

    //  We'll have a ton of buttons that aren't active.
    //  That way we can on/off them as we need to support more/less options.
    //
    for( int ii=1; ii<10; ii++ ){

        //  Make.
        //
        QHBoxLayout *box = new QHBoxLayout;

        //  Add a checkbox.
        //
        QCheckBox* check = new QCheckBox;
        _list_check.push_back( check );
        box->addWidget( check );

        //  Add a label
        //
        QLabel* label = new QLabel("option-option-option-option-option");
        _list_label.push_back( label );
        box->addWidget( label );

        //  Store.
        //
        _list_hbox.push_back( box );

        //  Add to the grid.
        //
        _grid->addLayout( box, (text_height*ii),0, question_height,total_width );
    }

    //  Add buttons for progression.
    //
    {

        //  Make.
        //
        QHBoxLayout *box = new QHBoxLayout;

        //
        QPushButton* btn_forward = new QPushButton("Next");
        connect( btn_forward, SIGNAL(clicked()), this, SLOT(progress_next()) );
        box->addWidget( btn_forward );

        //  Store.
        //
        _list_hbox.push_back( box );

        //
        _grid->addLayout( box, (text_height*_list_hbox.size()),0, button_height,total_width );
    }
    hide_all_options();
    //
    _text_browser->setText("This is the player. Questions durring the interrogation will go right here. ");
}