int d_aphoton_text_list_proc(int msg, DIALOG *d, int c) { if (msg == MSG_DRAW) return d_aphoton_list_proc(msg, d, c); return d_text_list_proc(msg, d, c); }
//this makes the list int d_enemy_list_proc(int msg, DIALOG *d, int c) { int ans; ans=d_text_list_proc(msg,d,c); enemy_chosen=d->d1; return ans; }
int d_emitsound_list_proc(int msg, DIALOG *d, int c) { int ans; ans=d_text_list_proc(msg,d,c); emitsound_chosen=d->d1; return ans; }
/* fs_dlist_proc: * Dialog procedure for the file selector disk list. */ static int fs_dlist_proc(int msg, DIALOG *d, int c) { char *s = file_selector[FS_EDIT].dp; int ret, i, temp; if (msg == MSG_START) { d->d1 = d->d2 = 0; temp = utoupper(ugetc(s)); if (((temp >= 'A') && (temp <= 'Z')) && (ugetat(s, 1) == DEVICE_SEPARATOR)) { temp -= 'A'; for (i=0; i<temp; i++) if (drive_exists(i)) d->d1++; } } ret = d_text_list_proc(msg, d, c); if (ret == D_CLOSE) { temp = 'A' + get_x_drive(d->d1+1); if ((temp < 'A') || (temp > 'Z')) temp = 'C'; s += usetc(s, temp); s += usetc(s, DEVICE_SEPARATOR); s += usetc(s, OTHER_PATH_SEPARATOR); usetc(s, 0); scare_mouse(); SEND_MESSAGE(file_selector+FS_FILES, MSG_START, 0); SEND_MESSAGE(file_selector+FS_FILES, MSG_DRAW, 0); SEND_MESSAGE(file_selector+FS_EDIT, MSG_START, 0); SEND_MESSAGE(file_selector+FS_EDIT, MSG_DRAW, 0); unscare_mouse(); return D_O_K; } return ret; }
/* fs_flist_proc: * Dialog procedure for the file selector list. */ static int fs_flist_proc(int msg, DIALOG *d, int c) { static int recurse_flag = 0; char *s = file_selector[FS_EDIT].dp; char tmp[32]; int sel = d->d1; int i, ret; int ch, count; if (msg == MSG_START) { if (!flist) { flist = malloc(sizeof(FLIST)); if (!flist) { *allegro_errno = ENOMEM; return D_CLOSE; } } else { for (i=0; i<flist->size; i++) if (flist->name[i]) free(flist->name[i]); } flist->size = 0; replace_filename(flist->dir, s, uconvert_ascii("*.*", tmp), sizeof(flist->dir)); for_each_file(flist->dir, FA_RDONLY | FA_DIREC | FA_ARCH | FA_HIDDEN | FA_SYSTEM, fs_flist_putter, 0); if (*allegro_errno) raine_alert("", "Disk error", NULL, NULL, "OK", NULL, 13, 0); usetc(get_filename(flist->dir), 0); d->d1 = d->d2 = 0; sel = 0; } if (msg == MSG_END) { if (flist) { for (i=0; i<flist->size; i++) if (flist->name[i]) free(flist->name[i]); free(flist); flist = NULL; } } recurse_flag++; ret = d_text_list_proc(msg, d, c); /* call the parent procedure */ recurse_flag--; if (((sel != d->d1) || (ret == D_CLOSE)) && (recurse_flag == 0)) { replace_filename(s, flist->dir, flist->name[d->d1], 512); /* check if we want to `cd ..' */ if ((!ustrncmp(flist->name[d->d1], "..", 2)) && (ret == D_CLOSE)) { /* let's remember the previous directory */ ustrcpy(updir, empty_string); i = ustrlen(flist->dir); count = 0; while (i>0) { ch = ugetat(flist->dir, i); if ((ch == '/') || (ch == OTHER_PATH_SEPARATOR)) { if (++count == 2) break; } uinsert(updir, 0, ch); i--; } /* ok, we have the dirname in updir */ } else { ustrcpy(updir, empty_string); } scare_mouse(); SEND_MESSAGE(file_selector+FS_EDIT, MSG_START, 0); SEND_MESSAGE(file_selector+FS_EDIT, MSG_DRAW, 0); unscare_mouse(); if (ret == D_CLOSE) return SEND_MESSAGE(file_selector+FS_EDIT, MSG_KEY, 0); } return ret; }
int d_aase_text_list_proc(int msg, DIALOG *d, int c) { return d_text_list_proc(msg, d, c); }