gtk: now remembers last loaded lua script for loadLua dialog
This commit is contained in:
parent
55a1faadd7
commit
ca8fb4ab08
|
@ -224,6 +224,7 @@ InitConfig()
|
||||||
config->addOption("_laststatefrom", "SDL.LastLoadStateFrom", home_dir);
|
config->addOption("_laststatefrom", "SDL.LastLoadStateFrom", home_dir);
|
||||||
config->addOption("_lastopennsf", "SDL.LastOpenNSF", home_dir);
|
config->addOption("_lastopennsf", "SDL.LastOpenNSF", home_dir);
|
||||||
config->addOption("_lastsavestateas", "SDL.LastSaveStateAs", home_dir);
|
config->addOption("_lastsavestateas", "SDL.LastSaveStateAs", home_dir);
|
||||||
|
config->addOption("_lastloadlua", "SDL.LastLoadLua", home_dir);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// fcm -> fm2 conversion
|
// fcm -> fm2 conversion
|
||||||
|
|
|
@ -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), filterLua);
|
||||||
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterAll);
|
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)
|
if (gtk_dialog_run (GTK_DIALOG (fileChooser)) ==GTK_RESPONSE_ACCEPT)
|
||||||
{
|
{
|
||||||
char* filename;
|
char* filename;
|
||||||
|
|
||||||
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
|
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
|
||||||
|
g_config->setOption("SDL.LastLoadLua", filename);
|
||||||
|
g_config->save();
|
||||||
gtk_widget_destroy(fileChooser);
|
gtk_widget_destroy(fileChooser);
|
||||||
if(FCEU_LoadLuaCode(filename) == 0)
|
if(FCEU_LoadLuaCode(filename) == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -756,6 +756,8 @@ GetMouseData(uint32 (&d)[3])
|
||||||
t = PtoV(x, y);
|
t = PtoV(x, y);
|
||||||
d[0] = t & 0xFFFF;
|
d[0] = t & 0xFFFF;
|
||||||
d[1] = (t >> 16) & 0xFFFF;
|
d[1] = (t >> 16) & 0xFFFF;
|
||||||
|
// debug print
|
||||||
|
// printf("mouse %d %d %d\n", d[0], d[1], d[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue