Пример #1
0
void new_song_dialog(void)
{
	struct dialog *dialog;

	/* only create everything if it hasn't been set up already */
	if (new_song_widgets[0].width == 0) {
		create_togglebutton(new_song_widgets + 0, 35, 24, 6, 0, 2, 1, 1, 1, NULL, "Keep",
				    2, new_song_groups[0]);
		create_togglebutton(new_song_widgets + 1, 45, 24, 7, 1, 3, 0, 0, 0, NULL, "Clear",
				    2, new_song_groups[0]);
		create_togglebutton(new_song_widgets + 2, 35, 27, 6, 0, 4, 3, 3, 3, NULL, "Keep",
				    2, new_song_groups[1]);
		create_togglebutton(new_song_widgets + 3, 45, 27, 7, 1, 5, 2, 2, 2, NULL, "Clear",
				    2, new_song_groups[1]);
		create_togglebutton(new_song_widgets + 4, 35, 30, 6, 2, 6, 5, 5, 5, NULL, "Keep",
				    2, new_song_groups[2]);
		create_togglebutton(new_song_widgets + 5, 45, 30, 7, 3, 7, 4, 4, 4, NULL, "Clear",
				    2, new_song_groups[2]);
		create_togglebutton(new_song_widgets + 6, 35, 33, 6, 4, 8, 7, 7, 7, NULL, "Keep",
				    2, new_song_groups[3]);
		create_togglebutton(new_song_widgets + 7, 45, 33, 7, 5, 9, 6, 6, 6, NULL, "Clear",
				    2, new_song_groups[3]);
		create_button(new_song_widgets + 8, 28, 36, 8, 6, 8, 9, 9, 9, dialog_yes_NULL, "OK", 4);
		create_button(new_song_widgets + 9, 41, 36, 8, 6, 9, 8, 8, 8, dialog_cancel_NULL, "Cancel", 2);
		togglebutton_set(new_song_widgets, 1, 0);
		togglebutton_set(new_song_widgets, 3, 0);
		togglebutton_set(new_song_widgets, 5, 0);
		togglebutton_set(new_song_widgets, 7, 0);
	}

	dialog = dialog_create_custom(21, 20, 38, 19, new_song_widgets, 10, 8, new_song_draw_const, NULL);
	dialog->action_yes = new_song_ok;
}
Пример #2
0
void show_about(void)
{
        static int didit = 0;
        struct dialog *d;
        unsigned char *p;
        int x, y;

        fake_driver = (rand() & 3) ? 0 : 1;

        if (!didit) {
                vgamem_ovl_alloc(&logo_image);
                it_logo = xpmdata(_logo_it_xpm);
                schism_logo = xpmdata(_logo_schism_xpm);
                didit=1;
        }

        if (status.flags & CLASSIC_MODE) {
                p = it_logo ? it_logo->pixels : NULL;
        } else {
                p = schism_logo ? schism_logo->pixels : NULL;
        }

        /* this is currently pretty gross */
        vgamem_ovl_clear(&logo_image, 2);
        if (p) {
                int c = (status.flags & CLASSIC_MODE) ? 11 : 0;
                for (y = 0; y < LOGO_HEIGHT; y++) {
                        for (x = 0; x < LOGO_WIDTH; x++) {
                                if (p[x]) {
                                        vgamem_ovl_drawpixel(&logo_image, x+2, y+6, c);
                                }
                        }
                        vgamem_ovl_drawpixel(&logo_image, x, y+6, 2);
                        vgamem_ovl_drawpixel(&logo_image, x+1, y+6, 2);
                        p += LOGO_PITCH;
                }
        }

        create_button(widgets_about + 0,
                        33,32,
                        12,
                        0,0,0,0,0,
                        dialog_yes_NULL, "Continue", 3);
        d = dialog_create_custom(11,16,
                        58, 19,
                        widgets_about, 1, 0,
                        about_draw_const, NULL);
        d->action_yes = about_close;
        d->action_no = about_close;
        d->action_cancel = about_close;

        /* okay, in just a moment, we're going to the module page.
         * if your modules dir is large enough, this causes an annoying pause.
         * to defeat this, we start scanning *NOW*. this makes startup "feel"
         * faster.
         */
        status.flags |= DIR_MODULES_CHANGED;
        pages[PAGE_LOAD_MODULE].set_page();
}
Пример #3
0
static void minipop_slide(int cv, const char *name, int min, int max,
	void (*setv)(int v), void (*setv_noplay)(int v), int midx, int midy)
{
	/* sweet jesus! */

	if (_mp_active == 1) {
		_mp_active = 2;
		return;
	}
	_mp_text = name;
	_mp_text_x = midx - 9;
	_mp_text_y = midy - 2;
	_mp_setv = setv;
	_mp_setv_noplay = setv_noplay;
	create_thumbbar(_mpw, midx - 8, midy, 13, 0, 0, 0, _mp_change, min, max);
	_mpw[0].d.thumbbar.value = CLAMP(cv, min, max);
	_mpw[0].depressed = 1; /* maybe it just needs some zoloft? */
	dialog_create_custom(midx - 10, midy - 3,  20, 6, _mpw, 1, 0, _mp_draw, NULL);

	_mp_active = 1;
	status.flags |= NEED_UPDATE;
}
Пример #4
0
static void video_change_dialog(void)
{
	struct dialog *d;

	video_revert_driver = video_driver_name();
	video_revert_fs = video_is_fullscreen();

	countdown = 10;
	time(&started);

	create_button(video_dialog_widgets+0, 28,28,8, 0, 0, 0, 1, 1,
					dialog_yes_NULL, "OK", 4);
	create_button(video_dialog_widgets+1, 42,28,8, 1, 1, 0, 1, 0,
					dialog_cancel_NULL, "Cancel", 2);
	d = dialog_create_custom(20, 17, 40, 14,
			video_dialog_widgets,
			2, 1,
			video_dialog_draw_const, NULL);
	d->action_yes = video_mode_keep;
	d->action_no = video_mode_cancel;
	d->action_cancel = video_mode_cancel;
}