std::string I7GlkFile::fileDialog(glui32 use, glui32 fmode) { int data[2]; switch (use & fileusage_TypeMask) { case fileusage_Data: data[0] = File_GlkData; break; case fileusage_SavedGame: data[0] = File_GlkSave; break; case fileusage_Transcript: case fileusage_InputRecord: default: data[0] = File_Text; break; } data[1] = (fmode != filemode_Read); sendCommand(Command_FileDialog,sizeof data,data); FrontEndCmd pathCmd = readFilePath(); if (pathCmd.len > 0) return std::string((char*)pathCmd.data,pathCmd.len); pathCmd.free(); return ""; }
/*! * \fn void preferencesMenu() * Preferences menu of csuper. */ void preferencesMenu() { int choice; int stop = false; do { choice=-1; clearScreen(); printf(_("\nWhat do you want to do?\n")); #ifndef PORTABLE printf(_("\n (%d) Change the folder where files will be saved\n (%d) Display the folder where files will be saved"),newPath,readPath); #endif printf(_("\n (%d) Make a new game configuration\n (%d) Delete an existing game configuration" "\n (%d) Display the list of game configurations\n (%d) Display a game configuration" "\n (%d) Export game configurations\n (%d) Import game configurations\n (%d) Change pdf export preferences" "\n (%d) Back to main menu\n\nYour choice : ") ,newGameConf,removeGameConf,printListGameConf,printGameConf,exportGameConf,importGameConf,pdfPreferences,backMainMenu); intKey(&choice); switch (choice) { #ifndef PORTABLE case newPath : changeFilePath(); break; case readPath : readFilePath(); break; #endif case backMainMenu : stop=true; break; case newGameConf : newGameConfig(); break; case removeGameConf:removeGameConfig(); break; case printListGameConf:printListGameConfig(); break; case printGameConf: printGameConfigFile(); break; case easterEggs2 : printf(_("\nYes, it's the correct answer, but that doesn't help me to know what you want to do.\n")); systemPause(); break; case exportGameConf:exportListGameConfig(); break; case importGameConf:importListGameConfig(); break; case pdfPreferences:changePdfPreferences(); break; default : wrongChoice(); systemPause(); } clearScreen(); } while (stop==false); }