error_box(fe->window, msg);
}
+static void menu_restart_event(GtkMenuItem *menuitem, gpointer data)
+{
+ frontend *fe = (frontend *)data;
+
+ midend_restart_game(fe->me);
+}
+
static void menu_config_event(GtkMenuItem *menuitem, gpointer data)
{
frontend *fe = (frontend *)data;
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
add_menu_item_with_key(fe, GTK_CONTAINER(menu), "New", 'n');
- add_menu_item_with_key(fe, GTK_CONTAINER(menu), "Restart", 'r');
+
+ menuitem = gtk_menu_item_new_with_label("Restart");
+ gtk_container_add(GTK_CONTAINER(menu), menuitem);
+ gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
+ GTK_SIGNAL_FUNC(menu_restart_event), fe);
+ gtk_widget_show(menuitem);
menuitem = gtk_menu_item_new_with_label("Specific...");
gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
fe->ncolours = ncolours;
fe->colours = snewn(ncolours, GdkColor);
for (i = 0; i < ncolours; i++) {
- /*
- * Just for Gareth: if you dislike any of the standard
- * colours, here's your chance to configure them in a
- * really hacky way.
- */
- char buf[80], *e;
- unsigned int r, g, b;
- sprintf(buf, "PUZZLE_COLOUR_%d", i);
- if ((e = getenv(buf)) != NULL &&
- sscanf(e, "%2x%2x%2x", &r, &g, &b) == 3) {
- fe->colours[i].red = r * 0x101;
- fe->colours[i].green = g * 0x101;
- fe->colours[i].blue = b * 0x101;
- } else {
- fe->colours[i].red = colours[i*3] * 0xFFFF;
- fe->colours[i].green = colours[i*3+1] * 0xFFFF;
- fe->colours[i].blue = colours[i*3+2] * 0xFFFF;
- }
+ fe->colours[i].red = colours[i*3] * 0xFFFF;
+ fe->colours[i].green = colours[i*3+1] * 0xFFFF;
+ fe->colours[i].blue = colours[i*3+2] * 0xFFFF;
}
success = snewn(ncolours, gboolean);
gdk_colormap_alloc_colors(fe->colmap, fe->colours, ncolours,
char *pname = argv[0];
char *error;
+ if (argc > 1 && !strcmp(argv[1], "--version")) {
+ printf("%s, from Simon Tatham's Portable Puzzle Collection\n%s\n",
+ thegame.name, ver);
+ return 0;
+ }
+
/*
* Special standalone mode for generating puzzle IDs on the
* command line. Useful for generating puzzles to be printed