gtk: now remembers last loaded lua script for loadLua dialog

This commit is contained in:
punkrockguy318 2011-10-19 07:12:10 +00:00
parent 55a1faadd7
commit ca8fb4ab08
3 changed files with 8 additions and 2 deletions

View File

@ -224,6 +224,7 @@ InitConfig()
config->addOption("_laststatefrom", "SDL.LastLoadStateFrom", home_dir);
config->addOption("_lastopennsf", "SDL.LastOpenNSF", home_dir);
config->addOption("_lastsavestateas", "SDL.LastSaveStateAs", home_dir);
config->addOption("_lastloadlua", "SDL.LastLoadLua", home_dir);
#endif
// fcm -> fm2 conversion

View File

@ -1324,14 +1324,17 @@ void loadLua ()
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterLua);
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterAll);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fileChooser), getcwd(NULL, 0));
const char* last_file;
g_config->getOption("SDL.LastLoadLua", &last_file);
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(fileChooser), last_file);
if (gtk_dialog_run (GTK_DIALOG (fileChooser)) ==GTK_RESPONSE_ACCEPT)
{
char* filename;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
g_config->setOption("SDL.LastLoadLua", filename);
g_config->save();
gtk_widget_destroy(fileChooser);
if(FCEU_LoadLuaCode(filename) == 0)
{

View File

@ -756,6 +756,8 @@ GetMouseData(uint32 (&d)[3])
t = PtoV(x, y);
d[0] = t & 0xFFFF;
d[1] = (t >> 16) & 0xFFFF;
// debug print
// printf("mouse %d %d %d\n", d[0], d[1], d[2]);
}
/**