int MineMenu() { int x; static const char *const MenuItems[] = { "New mine", "Load mine", "Save mine", "Print mine", "Redraw mine" }; x = MenuX( -1, -1, 5, MenuItems ); switch( x ) { case 1: // New CreateNewMine(); break; case 2: // Load //@@LoadMine(); break; case 3: // Save SaveMine(); break; case 4: // Print break; case 5: // Redraw Update_flags = UF_ALL; break; } return 1; }
int MacroMenu() { int x; char * MenuItems[] = { "Play fast", "Play normal", "Record all", "Record keys", "Save macro", "Load macro" }; x = MenuX( -1, -1, 6, MenuItems ); switch( x ) { case 1: MacroPlayFast(); break; case 2: MacroPlayNormal(); break; case 3: MacroRecordAll(); break; case 4: MacroRecordKeys(); break; case 5: // Save MacroSave(); break; case 6: // Load MacroLoad(); break; } return 1; }
int ui_get_file( char * filename, const char * Filespec ) { int x; auto list = file_getfilelist(Filespec, ""); if (!list) return 0; x = MenuX(-1, -1, list.get_count(), list.get()); if (x > 0) strcpy(filename, list[x - 1]); return (x > 0); }
int ui_get_file( char * filename, char * Filespec ) { int x, NumFiles; char **list = file_getfilelist(&NumFiles, Filespec, ""); if (!list) return 0; x = MenuX(-1, -1, NumFiles, list); if (x > 0) strcpy(filename, list[x - 1]); PHYSFS_freeList(list); return (x > 0); }