+ return TRUE;
+}
+
+/* Internal function: See if there is a corresponding graphics file */
+static void
+search_for_graphics_file(const char *filename, ChimaraIF *glk)
+{
+
+ extern GSettings *prefs_settings;
+
+ /* First get the name of the story file */
+ char *scratch = g_path_get_basename(filename);
+ char *ext = strrchr(scratch, '.');
+ if(strcmp(ext, ".zlb") == 0 ||
+ strcmp(ext, ".zblorb") == 0 ||
+ strcmp(ext, ".glb") == 0 ||
+ strcmp(ext, ".gblorb") == 0 ||
+ strcmp(ext, ".blorb") == 0 ||
+ strcmp(ext, ".blb") == 0)
+ {
+ g_object_set(glk, "graphics-file", NULL, NULL);
+ return;
+ }
+ *ext = '\0';
+
+ /* Check in the stored resource path, if set */
+ char *resource_path;
+ g_settings_get(prefs_settings, "resource-path", "ms", &resource_path);
+
+ /* Otherwise check in the current directory */
+ if(!resource_path)
+ resource_path = g_path_get_dirname(filename);
+
+ char *blorbfile = g_strconcat(resource_path, "/", scratch, ".blb", NULL);
+ if(g_file_test(blorbfile, G_FILE_TEST_EXISTS))
+ g_object_set(glk, "graphics-file", blorbfile, NULL);
+
+ g_free(blorbfile);
+ g_free(scratch);
+ g_free(resource_path);
+}
+
+void
+on_open_activate(GtkAction *action, ChimaraGlk *glk)
+{
+ GtkWindow *window = GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(glk)));
+
+ if(!confirm_open_new_game(glk))
+ return;