Exemplo n.º 1
0
void OptionsMenu::graphics_and_sound_click() {
    int vw = subsystem.get_view_width();
    int vh = subsystem.get_view_height();
    int ww = 273;
    int wh = 184;
    int bw = 140;

    GuiWindow *window = gui.push_window(vw / 2 - ww / 2, vh / 2- wh / 2, ww, wh, "Graphics And Sound");
    window->set_cancelable(true);

    gui.create_checkbox(window, 15, 15, "fullscreen graphics mode", subsystem.is_fullscreen(), static_toggle_fullscreen_click, this);
    gui.create_checkbox(window, 15, 30, "draw scanlines", subsystem.has_scanlines(), static_toggle_scanlines_click, this);

    gui.create_label(window, 15, 45, "intensity:");
    gui.create_hscroll(window, 115, 46, 143, 25, 100, config.get_int("scanlines_intensity"), static_scanlines_intensity_changed, this);
    gui.create_box(window, 15, 66, ww - 30, 1);

    gui.create_label(window, 15, 75, "music volume:");
    gui.create_hscroll(window, 115, 76, 143, 0, 100, config.get_int("music_volume"), static_music_volume_changed, this);

    gui.create_label(window, 15, 90, "sfx volume:");
    gui.create_hscroll(window, 115, 91, 143, 0, 128, config.get_int("sfx_volume"), static_sfx_volume_changed, this);

    gui.create_box(window, 15, 111, ww - 30, 1);

    gui.create_label(window, 15, 120, "text fade speed:");
    gui.create_hscroll(window, 115, 121, 143, 5, 15, config.get_int("text_fade_speed"), static_text_fade_speed_changed, this);

    bw = 55;
    gui.create_button(window, ww / 2 - bw / 2, wh - 43, bw, 18, "Close", static_close_window_click, this);
}
Exemplo n.º 2
0
void OptionsMenu::controller_and_keyboard_click() {
    int vw = subsystem.get_view_width();
    int vh = subsystem.get_view_height();
    int ww = 335;
    int wh = 203;
    int bw = 140;

    GuiWindow *window = gui.push_window(vw / 2 - ww / 2, vh / 2- wh / 2, ww, wh, "Controller And Keyboard");
    window->set_cancelable(true);

    ck_up = create_field(window, 15, 15, "up:", static_capture_up_click, false);
    ck_down = create_field(window, 175, 15, "down:", static_capture_down_click, false);
    ck_left = create_field(window, 15, 35, "left:", static_capture_left_click, false);
    ck_right = create_field(window, 175, 35, "right:", static_capture_right_click, false);
    ck_jump = create_field(window, 15, 55, "jump:", static_capture_jump_click, false);
    ck_fire = create_field(window, 175, 55, "fire:", static_capture_fire_click, false);
    ck_drop1 = create_field(window, 15, 75, "grenade:", static_capture_drop1_click, false);
    ck_drop2 = create_field(window, 175, 75, "bomb:", static_capture_drop2_click, false);
    ck_drop3 = create_field(window, 15, 95, "frog:", static_capture_drop3_click, false);
    ck_chat = create_field(window, 175, 95, "chat:", static_capture_chat_click, false);
    ck_stats = create_field(window, 15, 115, "stats:", static_capture_stats_click, false);
    ck_escape = create_field(window, 175, 115, "esc:", static_capture_escape_click, false);
    ck_selected = 0;
    capture_draw();

    ck_dz_h = create_field(window, 15, 135, "dz horz.:", static_ck_erase_horz, true);
    ck_dz_h->set_text(config.get_string("deadzone_horizontal"));

    ck_dz_v = create_field(window, 175, 135, "dz vert.:", static_ck_erase_vert, true);
    ck_dz_v->set_text(config.get_string("deadzone_vertical"));

    bw = 55;
    gui.create_button(window, ww / 2 - bw / 2, wh - 43, bw, 18, "Close", static_close_capture_window_click, this);
    gui.create_button(window, Gui::Spc, wh - 43, 110, 18, "Rescan Joysticks", static_capture_rescan_click, this);
}
Exemplo n.º 3
0
void OptionsMenu::player_click() {
    int vw = subsystem.get_view_width();
    int vh = subsystem.get_view_height();
    int ww = 287;
    int wh = 167;
    int bw = 140;

    subsystem.clear_input_buffer();
    GuiWindow *window = gui.push_window(vw / 2 - ww / 2, vh / 2- wh / 2, ww, wh, "Player");
    window->set_cancelable(true);

    gui.create_label(window, 15, 15, "player's name:");
    player_name = gui.create_textbox(window, 120, 15, 150, config.get_string("player_name"));
    show_player_name  = gui.create_checkbox(window, 15, 33, "show player's name", config.get_bool("show_player_name"), 0, 0);
    gui.create_label(window, 15, 53, "character:");
    player_skin = gui.create_listbox(window, 120, 56, 150, 60, "Character", static_player_skin_click, this);
    player_skin_pic = gui.create_picture(window, 15, 70, 0);

    Resources::ResourceObjects& sets = resources.get_charactersets();
    int sz = static_cast<int>(sets.size());
    for (int i = 0; i < sz; i++) {
        Characterset *cset = static_cast<Characterset *>(sets[i].object);
        player_skin->add_entry(cset->get_description());
        if (cset->get_name() == config.get_string("player_skin")) {
            player_skin->set_selected_index(i);
            player_skin_pic->set_picture(cset->get_tile(DirectionRight, CharacterAnimationStanding)->get_tilegraphic());
        }
    }

    player_name->set_focus();
    bw = 55;
    gui.create_button(window, ww / 2 - bw / 2, wh - 43, bw, 18, "Close", static_close_player_click, this);
}