コード例 #1
0
ファイル: vbl.cpp プロジェクト: MaddTheSane/alephone
bool find_replay_to_use(bool ask_user, FileSpecifier &file)
{
	if (ask_user) {
		return file.ReadDialog(_typecode_film);
	} else
		return get_recording_filedesc(file);
}
コード例 #2
0
/* Note this should show the map of where you are... */
bool choose_saved_game_to_load(FileSpecifier& File)
// FSSpec *saved_game)
{
    return File.ReadDialog(_typecode_savegame);
    /*
    SFTypeList type_list;
    short type_count= 0;
    StandardFileReply reply;

    type_list[type_count++]= SAVE_GAME_TYPE;

    StandardGetFile(NULL, type_count, type_list, &reply);

    if(reply.sfGood)
    {
    	BlockMove(&reply.sfFile, saved_game, sizeof(FSSpec));
    }

    return reply.sfGood;
    */
}
コード例 #3
0
bool load_quick_save_dialog(FileSpecifier& saved_game)
{
    QuickSaves::instance()->enumerate();

    dialog d;
    vertical_placer *placer = new vertical_placer;
    w_title *w_header = new w_title("CONTINUE SAVED GAME");
    placer->dual_add(w_header, d);
    placer->add(new w_spacer, true);
    
    horizontal_placer *mini_button_placer = new horizontal_placer;
    w_tiny_button *rename_w = new w_tiny_button("RENAME", dialog_rename, &d);
    rename_w->set_identifier(iDIALOG_RENAME_W);
    mini_button_placer->dual_add(rename_w, d);
#ifndef MAC_APP_STORE
    w_tiny_button *export_w = new w_tiny_button("EXPORT", dialog_export, &d);
    export_w->set_identifier(iDIALOG_EXPORT_W);
    mini_button_placer->dual_add(export_w, d);
#endif
    w_tiny_button *delete_w = new w_tiny_button("DELETE", dialog_delete, &d);
    delete_w->set_identifier(iDIALOG_DELETE_W);
    mini_button_placer->dual_add(delete_w, d);
    
    placer->add(mini_button_placer, true);
    placer->add(new w_spacer, true);

    std::vector<QuickSave> saves(QuickSaves::instance()->begin(), QuickSaves::instance()->end());
    w_saves* saves_w = new w_saves(saves, 400, 4);
    saves_w->set_identifier(iDIALOG_SAVES_W);
    placer->dual_add(saves_w, d);
    placer->add(new w_spacer, true);

    horizontal_placer* button_placer = new horizontal_placer;
#ifndef MAC_APP_STORE
    w_button* other_w = new w_button("LOAD OTHER", dialog_exit_other, &d);
    button_placer->dual_add(other_w, d);
#endif
    w_button* accept_w = new w_button("LOAD", dialog_ok, &d);
    accept_w->set_identifier(iDIALOG_ACCEPT_W);
    button_placer->dual_add(accept_w, d);
    w_button* cancel_w = new w_button("CANCEL", dialog_cancel, &d);
    button_placer->dual_add(cancel_w, d);
    
    placer->add(button_placer, true);
    
    d.set_widget_placer(placer);
    d.activate_widget(saves_w);
    
    if (!saves_w->has_selection())
    {
        rename_w->set_enabled(false);
        delete_w->set_enabled(false);
#ifndef MAC_APP_STORE
        export_w->set_enabled(false);
#endif
        accept_w->set_enabled(false);
    }
    
    bool ret = false;
    QuickSave sel;
    switch (d.run()) {
        case 0:
            sel = saves_w->selected_save();
            saved_game = sel.save_file;
            last_saved_game = saved_game;
            last_saved_networked = (sel.players > 1) ? 1 : 0;
            ret = true;
            break;
        case LOAD_DIALOG_OTHER:
            last_saved_networked = UNONE;
            ret = saved_game.ReadDialog(_typecode_savegame);
            break;
        default:
            break;
    }
    
    QuickSaves::instance()->clear();
    QuickSaveImageCache::instance()->clear();
    return ret;
}