Ejemplo n.º 1
0
void video_confirm_ok_clicked(component *c, void *userdata) {
    menu *m = sizer_get_obj(c->parent);
    m->finished = 1;

    video_menu_confirm_data *local = userdata;
    *local->old_video_settings = settings_get()->video;
}
Ejemplo n.º 2
0
void video_confirm_cancel_clicked(component *c, void *userdata) {
    video_menu_confirm_data *local = userdata;
    settings_video *v = &settings_get()->video;
    *v = *local->old_video_settings;
    video_reinit(v->screen_w, v->screen_h, v->fullscreen, v->vsync, v->scaler, v->scale_factor);

    // Finish the menu
    menu *m = sizer_get_obj(c->parent);
    m->finished = 1;
}
Ejemplo n.º 3
0
void menu_listen_cancel(component *c, void *userdata) {
    menu *m = sizer_get_obj(c->parent);
    m->finished = 1;

    // Clean up host
    listen_menu_data *local = menu_get_userdata(c->parent);
    if(local->host) {
        enet_host_destroy(local->host);
        local->host = NULL;
    }
}
Ejemplo n.º 4
0
static int xysizer_action(component *c, int action) {
    sizer *s = sizer_get_obj(c);

    // Just pass events to all children
    iterator it;
    component **tmp;
    vector_iter_begin(&s->objs, &it);
    while((tmp = iter_next(&it)) != NULL) {
        component_action(*tmp, action);
    }

    return 1; // Wasn't handled here (event though it might have been)
}
Ejemplo n.º 5
0
void menu_audio_done(component *c, void *userdata) {
    audio_menu_data *local = userdata;

    // Set menu as finished
    menu *m = sizer_get_obj(c->parent);
    m->finished = 1;

    // Reload music if changes made
    settings_sound *s = &settings_get()->sound;
    if(s->music_library != local->old_audio_settings.music_library
       || s->music_frequency != local->old_audio_settings.music_frequency
       || s->music_resampler != local->old_audio_settings.music_resampler
       || s->music_mono != local->old_audio_settings.music_mono)
    {
        music_reload();
    }
}
Ejemplo n.º 6
0
static void xysizer_free(component *c) {
    xysizer *m = sizer_get_obj(c);
    free(m);
}
Ejemplo n.º 7
0
void* xysizer_get_userdata(component *c) {
    xysizer *m = sizer_get_obj(c);
    return m->userdata;
}
Ejemplo n.º 8
0
void xysizer_set_userdata(component *c, void *userdata) {
    xysizer *m = sizer_get_obj(c);
    m->userdata = userdata;
}
Ejemplo n.º 9
0
void menu_gameplay_done(component *c, void *u) {
    menu *m = sizer_get_obj(c->parent);
    m->finished = 1;
}