Fix: SE063 Problem: There is no support in the GTK interface for Slash'EM specific commands. In addtion, the extended command interface is very simplistic and can't cope with the concept of more than one extended command starting with the same letter. This fix: - Maps move commands to m prefix moves (so won't fight if monster is in the way). - Adds new fight menu mapped to F prefix - Adds Slash'EM specific commands - Adds a dialog for extended commands - Adds support for mapping menu items to extended commands which aren't available via the Alt key interface. - Fixes the mouse moving code - Corrects tag for '(' command (was item). Compatible with: Slash'EM 0.0.6E0F3 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 13 Apr 2000 diff -Nacrd ../slashem-0.0.6E0F3/include/winGTK.h ./include/winGTK.h *** ../slashem-0.0.6E0F3/include/winGTK.h Sat Mar 4 17:47:10 2000 --- ./include/winGTK.h Thu Apr 13 15:10:05 2000 *************** *** 94,99 **** --- 94,101 ---- extern int GTK_doprev_message(void); extern char GTK_yn_function(const char *, const char *, CHAR_P); extern void GTK_getlin(const char *, char *); + extern void GTK_extcmd_init(void); + extern void GTK_extcmd_set(int cmd); extern int GTK_get_ext_cmd(void); extern void GTK_number_pad(void); extern void GTK_delay_output(void); *************** *** 110,116 **** extern void nh_map_destroy(void); extern void nh_map_clear(void); extern void nh_map_check_visibility(void); ! extern void nh_map_pos(int *, int *); extern void nh_map_click(int); extern void nh_map_flush(void); --- 112,118 ---- extern void nh_map_destroy(void); extern void nh_map_clear(void); extern void nh_map_check_visibility(void); ! extern void nh_map_pos(int *, int *, int *); extern void nh_map_click(int); extern void nh_map_flush(void); *************** *** 192,196 **** --- 194,231 ---- extern void x_tile_destroy(); extern void x_tile_tmp_draw(int src_x, int src_y, int ofsx, int ofsy); extern void x_tile_tmp_draw_rectangle(int ofsx, int ofsy, int c); + + /* + * These must agree with the table in gtkextcmd.c -ALI + */ + + #define EXT_CMD_ADJUST 0 + #define EXT_CMD_BORROW 1 + #define EXT_CMD_CHAT 2 + #define EXT_CMD_CONDUCT 3 + #define EXT_CMD_DIP 4 + #define EXT_CMD_ENHANCE 5 + #define EXT_CMD_EXPLORE 6 + #define EXT_CMD_FORCE 7 + #define EXT_CMD_INVOKE 8 + #define EXT_CMD_JUMP 9 + #define EXT_CMD_LOOT 10 + #define EXT_CMD_MONSTER 11 + #define EXT_CMD_NAME 12 + #define EXT_CMD_OFFER 13 + #define EXT_CMD_PRAY 14 + #define EXT_CMD_QUIT 15 + #define EXT_CMD_RIDE 16 + #define EXT_CMD_RUB 17 + #define EXT_CMD_SIT 18 + #define EXT_CMD_TECHNIQUE 19 + #define EXT_CMD_TURN 20 + #define EXT_CMD_TWOWEAPON 21 + #define EXT_CMD_UNTRAP 22 + #define EXT_CMD_VERSION 23 + #define EXT_CMD_WIPE 24 + #define EXT_CMD_YOUPOLY 25 + + #define NO_EXT_CMD_MAPS 26 #endif diff -Nacrd ../slashem-0.0.6E0F3/sys/unix/Makefile.src ./sys/unix/Makefile.src *** ../slashem-0.0.6E0F3/sys/unix/Makefile.src Sat Mar 4 17:47:11 2000 --- ./sys/unix/Makefile.src Thu Apr 13 15:20:36 2000 *************** *** 187,197 **** # files for a GTK port # (tile.c is included in the defn. for WINCSRC, below) WINGTKSRC = ../win/gtk/gtk.c ../win/gtk/gtkgetlin.c ../win/gtk/gtkstatus.c \ ! ../win/gtk/gtkmenu.c ../win/gtk/gtkyn.c ../win/gtk/gtkmap.c \ ! ../win/gtk/gtkmessage.c ../win/gtk/gtkmisc.c ../win/gtk/xshmmap.c \ ! ../win/gtk/xshm.c ! WINGTKOBJ = gtk.o gtkgetlin.o gtkstatus.o gtkmenu.o gtkyn.o gtkmap.o \ ! gtkmessage.o gtkmisc.o xshmmap.o xshm.o tile.o # Use these declarations if you only want to support the TTY windowing system WINSRC = $(WINTTYSRC) --- 187,197 ---- # files for a GTK port # (tile.c is included in the defn. for WINCSRC, below) WINGTKSRC = ../win/gtk/gtk.c ../win/gtk/gtkgetlin.c ../win/gtk/gtkstatus.c \ ! ../win/gtk/gtkmenu.c ../win/gtk/gtkyn.c ../win/gtk/gtkextcmd.c \ ! ../win/gtk/gtkmap.c ../win/gtk/gtkmessage.c ../win/gtk/gtkmisc.c \ ! ../win/gtk/xshmmap.c ../win/gtk/xshm.c ! WINGTKOBJ = gtk.o gtkgetlin.o gtkstatus.o gtkmenu.o gtkyn.o gtkextcmd.o \ ! gtkmap.o gtkmessage.o gtkmisc.o xshmmap.o xshm.o tile.o # Use these declarations if you only want to support the TTY windowing system WINSRC = $(WINTTYSRC) *************** *** 590,596 **** ../win/X11/nh56icon ../win/X11/nh32icon $(CC) $(CFLAGS) -c ../win/X11/winX.c winmap.o: ../win/X11/winmap.c ../include/xwindow.h $(HACK_H) ../include/dlb.h \ ! ../include/patchlevel.h ../include/winX.h ../include/tile2x11.h $(CC) $(CFLAGS) -c ../win/X11/winmap.c winmenu.o: ../win/X11/winmenu.c $(HACK_H) ../include/winX.h $(CC) $(CFLAGS) -c ../win/X11/winmenu.c --- 590,596 ---- ../win/X11/nh56icon ../win/X11/nh32icon $(CC) $(CFLAGS) -c ../win/X11/winX.c winmap.o: ../win/X11/winmap.c ../include/xwindow.h $(HACK_H) ../include/dlb.h \ ! ../include/winX.h ../include/patchlevel.h ../include/tile2x11.h $(CC) $(CFLAGS) -c ../win/X11/winmap.c winmenu.o: ../win/X11/winmenu.c $(HACK_H) ../include/winX.h $(CC) $(CFLAGS) -c ../win/X11/winmenu.c *************** *** 616,623 **** $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkmenu.c gtkyn.o: ../win/gtk/gtkyn.c ../include/winGTK.h $(HACK_H) $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkyn.c gtkmap.o: ../win/gtk/gtkmap.c ../include/winGTK.h $(HACK_H) ../include/dlb.h \ ! ../include/patchlevel.h $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkmap.c gtkmessage.o: ../win/gtk/gtkmessage.c ../include/winGTK.h $(HACK_H) $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkmessage.c --- 616,626 ---- $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkmenu.c gtkyn.o: ../win/gtk/gtkyn.c ../include/winGTK.h $(HACK_H) $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkyn.c + gtkextcmd.o: ../win/gtk/gtkextcmd.c ../include/winGTK.h $(HACK_H) \ + ../include/func_tab.h + $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkextcmd.c gtkmap.o: ../win/gtk/gtkmap.c ../include/winGTK.h $(HACK_H) ../include/dlb.h \ ! ../include/patchlevel.h $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkmap.c gtkmessage.o: ../win/gtk/gtkmessage.c ../include/winGTK.h $(HACK_H) $(CC) $(CFLAGS) $(WINGTKCFLAGS) -c ../win/gtk/gtkmessage.c diff -Nacrd ../slashem-0.0.6E0F3/win/gtk/gtk.c ./win/gtk/gtk.c *** ../slashem-0.0.6E0F3/win/gtk/gtk.c Sat Mar 4 17:47:11 2000 --- ./win/gtk/gtk.c Thu Apr 13 15:17:24 2000 *************** *** 23,28 **** --- 23,31 ---- static void select_player(GtkWidget *w, gpointer data); static void key_command(GtkWidget *w, gpointer data); + static void move_command(GtkWidget *w, gpointer data); + static void fight_command(GtkWidget *w, gpointer data); + static void ext_command(GtkWidget *w, gpointer data); static void game_option(GtkWidget *w, gpointer data); static void game_topten(GtkWidget *w, gpointer data); *************** *** 193,213 **** static GtkItemFactoryEntry playmenu_items[] = { {"/Move", NULL, NULL, 0, ""}, ! {"/Move/North", "k", key_command, 'k', NULL}, ! {"/Move/East", "h", key_command, 'h', NULL}, ! {"/Move/South", "j", key_command, 'j', NULL}, ! {"/Move/West", "l", key_command, 'l', NULL}, ! {"/Move/Northeast", "u", key_command, 'u', NULL}, ! {"/Move/Northwest", "y", key_command, 'y', NULL}, ! {"/Move/Southeast", "n", key_command, 'n', NULL}, ! {"/Move/Southwest", "b", key_command, 'b', NULL}, {"/Move/Down", "greater", key_command, '>', NULL}, {"/Move/Up", "less", key_command, '<', NULL}, {"/Check", NULL, NULL, 0, ""}, {"/Check/Here", "colon", key_command, ':', NULL}, {"/Check/There", "semicolon", key_command, ';', NULL}, {"/Check/Trap", "asciicircum", key_command, '^', NULL}, {"/Equip/Wield", "w", key_command, 'w', NULL}, {"/Equip/Wear", "w", key_command, 'W', NULL}, {"/Equip/Take off", "T", key_command, 'T', NULL}, {"/Equip/Puton", "p", key_command, 'P', NULL}, --- 196,228 ---- static GtkItemFactoryEntry playmenu_items[] = { {"/Move", NULL, NULL, 0, ""}, ! {"/Move/North", NULL, move_command, 'k', NULL}, ! {"/Move/East", NULL, move_command, 'l', NULL}, ! {"/Move/South", NULL, move_command, 'j', NULL}, ! {"/Move/West", NULL, move_command, 'h', NULL}, ! {"/Move/Northeast", NULL, move_command, 'u', NULL}, ! {"/Move/Northwest", NULL, move_command, 'y', NULL}, ! {"/Move/Southeast", NULL, move_command, 'n', NULL}, ! {"/Move/Southwest", NULL, move_command, 'b', NULL}, {"/Move/Down", "greater", key_command, '>', NULL}, {"/Move/Up", "less", key_command, '<', NULL}, + {"/Fight", NULL, NULL, 0, ""}, + {"/Fight/North", NULL, fight_command, 'k', NULL}, + {"/Fight/East", NULL, fight_command, 'l', NULL}, + {"/Fight/South", NULL, fight_command, 'j', NULL}, + {"/Fight/West", NULL, fight_command, 'h', NULL}, + {"/Fight/Northeast", NULL, fight_command, 'u', NULL}, + {"/Fight/Northwest", NULL, fight_command, 'y', NULL}, + {"/Fight/Southeast", NULL, fight_command, 'n', NULL}, + {"/Fight/Southwest", NULL, fight_command, 'b', NULL}, {"/Check", NULL, NULL, 0, ""}, {"/Check/Here", "colon", key_command, ':', NULL}, {"/Check/There", "semicolon", key_command, ';', NULL}, {"/Check/Trap", "asciicircum", key_command, '^', NULL}, {"/Equip/Wield", "w", key_command, 'w', NULL}, + {"/Equip/Exchange weapons", "x", key_command, 'x', NULL}, + {"/Equip/Two-handed", NULL, ext_command, EXT_CMD_TWOWEAPON, NULL}, + {"/Equip/Quiver", "Q", key_command, 'Q', NULL}, {"/Equip/Wear", "w", key_command, 'W', NULL}, {"/Equip/Take off", "T", key_command, 'T', NULL}, {"/Equip/Puton", "p", key_command, 'P', NULL}, *************** *** 218,226 **** {"/You/Armor", "bracketleft", key_command, '[', NULL}, {"/You/Ring", "equal", key_command, '=', NULL}, {"/You/Amulet", "quotedbl", key_command, '"', NULL}, ! {"/You/Item", "parenleft", key_command, '(', NULL}, ! {"/You/Spells", "x", key_command, 'x', NULL}, {"/You/Known Item", "backslash", key_command, '\\', NULL}, {"/Adventure", NULL, NULL, 0, ""}, {"/Adventure/Name", "n", key_command, 'n' | 0x80, NULL}, {"/Adventure/Call", "C", key_command, 'C', NULL}, --- 233,242 ---- {"/You/Armor", "bracketleft", key_command, '[', NULL}, {"/You/Ring", "equal", key_command, '=', NULL}, {"/You/Amulet", "quotedbl", key_command, '"', NULL}, ! {"/You/Tool", "parenleft", key_command, '(', NULL}, ! {"/You/Spells", "plus", key_command, '+', NULL}, {"/You/Known Item", "backslash", key_command, '\\', NULL}, + {"/You/Conduct", NULL, ext_command, EXT_CMD_CONDUCT, NULL}, {"/Adventure", NULL, NULL, 0, ""}, {"/Adventure/Name", "n", key_command, 'n' | 0x80, NULL}, {"/Adventure/Call", "C", key_command, 'C', NULL}, *************** *** 239,244 **** --- 255,261 ---- {"/Action/Apply", "a", key_command, 'a', NULL}, {"/Action/Kick", "D", key_command, '\04', NULL}, {"/Action/Throw", "t", key_command, 't', NULL}, + {"/Action/Fire", "f", key_command, 'f', NULL}, {"/Action/Asep3", NULL, NULL, 0, ""}, {"/Action/Drink", "q", key_command, 'q', NULL}, {"/Action/Read", "r", key_command, 'r', NULL}, *************** *** 252,277 **** {"/Special", NULL, NULL, 0, ""}, {"/Special/Engrave", "E", key_command, 'E', NULL}, {"/Special/Pay", "p", key_command, 'p', NULL}, {"/Special/Chat", "c", key_command, 'c' | 0x80, NULL}, {"/Special/Enhance", "e", key_command, 'e' | 0x80, NULL}, {"/Special/Force", "f", key_command, 'f' | 0x80, NULL}, {"/Special/Invoke", "i", key_command, 'i' | 0x80, NULL}, {"/Special/Monster", "m", key_command, 'm' | 0x80, NULL}, {"/Special/Rub", "r", key_command, 'r' | 0x80, NULL}, {"/Special/Wipe", "w", key_command, 'w' | 0x80, NULL}, {"/Special/Teleport", "t", key_command, '', NULL}, ! {"/Special/Turn", "t", key_command, 't' | 0x80, NULL}, {"/Special/Untrap", "u", key_command, 'u' | 0x80, NULL}, {"/Special/Jump", "j", key_command, 'j' | 0x80, NULL}, }; ! static int keysym; static int pl_selection; void win_GTK_init() { ! ; } GtkWidget * --- 269,297 ---- {"/Special", NULL, NULL, 0, ""}, {"/Special/Engrave", "E", key_command, 'E', NULL}, {"/Special/Pay", "p", key_command, 'p', NULL}, + {"/Special/Borrow", "b", key_command, 'b' | 0x80, NULL}, {"/Special/Chat", "c", key_command, 'c' | 0x80, NULL}, {"/Special/Enhance", "e", key_command, 'e' | 0x80, NULL}, {"/Special/Force", "f", key_command, 'f' | 0x80, NULL}, {"/Special/Invoke", "i", key_command, 'i' | 0x80, NULL}, {"/Special/Monster", "m", key_command, 'm' | 0x80, NULL}, + {"/Special/Ride", NULL, ext_command, EXT_CMD_RIDE, NULL}, {"/Special/Rub", "r", key_command, 'r' | 0x80, NULL}, {"/Special/Wipe", "w", key_command, 'w' | 0x80, NULL}, + {"/Special/Technique", "t", key_command, 't' | 0x80, NULL}, {"/Special/Teleport", "t", key_command, '', NULL}, ! {"/Special/Turn", NULL, ext_command, EXT_CMD_TURN, NULL}, {"/Special/Untrap", "u", key_command, 'u' | 0x80, NULL}, {"/Special/Jump", "j", key_command, 'j' | 0x80, NULL}, }; ! static int keysym, keysym1; static int pl_selection; void win_GTK_init() { ! GTK_extcmd_init(); } GtkWidget * *************** *** 478,511 **** { keysym = (int)data; ! if(iflags.num_pad){ ! switch(keysym){ ! case 'y': ! keysym = '7'; ! break; ! case 'u': ! keysym = '9'; ! break; ! case 'b': ! keysym = '1'; ! break; ! case 'n': ! keysym = '3'; ! break; ! case 'h': ! keysym = '4'; ! break; ! case 'j': ! keysym = '2'; ! break; ! case 'k': ! keysym = '8'; ! break; ! case 'l': ! keysym = '6'; ! break; ! } ! } quit_hook(); } --- 498,529 ---- { keysym = (int)data; ! quit_hook(); ! } ! ! static void ! move_command(GtkWidget *widget, gpointer data) ! { ! keysym = 'm'; ! keysym1 = (int)data; ! ! quit_hook(); ! } ! ! static void ! fight_command(GtkWidget *widget, gpointer data) ! { ! keysym = 'F'; ! keysym1 = (int)data; ! ! quit_hook(); ! } ! ! static void ! ext_command(GtkWidget *widget, gpointer data) ! { ! keysym = '#'; ! GTK_extcmd_set((int)data); quit_hook(); } *************** *** 998,1004 **** nh_radar_update(); #endif ! keysym = 0; if(!keysym) main_hook(); --- 1016,1023 ---- nh_radar_update(); #endif ! keysym = keysym1; ! keysym1 = 0; if(!keysym) main_hook(); *************** *** 1017,1031 **** nh_radar_update(); #endif ! nh_map_click(TRUE); ! ! keysym = 0; ! main_hook(); if(!keysym) ! nh_map_pos(x, y); ! ! nh_map_click(FALSE); key = keysym; keysym = 0; --- 1036,1051 ---- nh_radar_update(); #endif ! keysym = keysym1; ! keysym1 = 0; if(!keysym) ! { ! nh_map_click(TRUE); ! main_hook(); ! nh_map_pos(x, y, mod); ! nh_map_click(FALSE); ! } key = keysym; keysym = 0; *************** *** 1150,1176 **** GTK_mark_synch() { ; - } - - int - GTK_get_ext_cmd() - { - extern struct ext_func_tab extcmdlist[]; - int i; - - GTK_putstr(NHW_MESSAGE, 7, "#"); - main_hook(); - - i = 0; - while(extcmdlist[i].ef_txt){ - if(extcmdlist[i].ef_txt[0] == keysym){ - GTK_putstr(NHW_MESSAGE, 7, extcmdlist[i].ef_txt); - return i; - } - ++i; - } - - return -1; } #define NAME_LINE 0 /* line # for player name */ --- 1170,1175 ---- diff -Nacrd ../slashem-0.0.6E0F3/win/gtk/gtkextcmd.c ./win/gtk/gtkextcmd.c *** ../slashem-0.0.6E0F3/win/gtk/gtkextcmd.c Thu Jan 1 01:00:00 1970 --- ./win/gtk/gtkextcmd.c Thu Apr 13 14:33:29 2000 *************** *** 0 **** --- 1,211 ---- + /* + $Id: gtkextcmd.c,v 1.0 2000/04/12 15:58:09 ali Exp ali $ + */ + /* + GTK+ NetHack Copyright (c) Issei Numata 1999-2000 + Modifications Copyright (c) J. Ali Harlow 2000 + GTK+ NetHack may be freely redistributed. See license for details. + */ + + #include + #include + #include + #include + #include "winGTK.h" + #include "func_tab.h" + + extern struct ext_func_tab extcmdlist[]; + + /* + * These must agree with the list in winGTK.h -ALI + */ + + struct ext_cmd_map { + char *txt; + int index; + } extcmdmap[NO_EXT_CMD_MAPS] = { + { "adjust" }, + { "borrow" }, + { "chat" }, + { "conduct" }, + { "dip" }, + { "enhance" }, + { "explore" }, + { "force" }, + { "invoke" }, + { "jump" }, + { "loot" }, + { "monster" }, + { "name" }, + { "offer" }, + { "pray" }, + { "quit" }, + { "ride" }, + { "rub" }, + { "sit" }, + { "technique" }, + { "turn" }, + { "twoweapon" }, + { "untrap" }, + { "version" }, + { "wipe" }, + { "youpoly" }, + }; + + static int extcmd = 0; + + void GTK_extcmd_init(void) + { + int i, j; + + for(i = 0; i < NO_EXT_CMD_MAPS; i++) + { + for(j = 0; extcmdlist[j].ef_txt; j++) + if (!strcmp(extcmdmap[i].txt, extcmdlist[j].ef_txt)) + { + extcmdmap[i].index = j; + break; + } + if (!extcmdlist[j].ef_txt) + extcmdmap[i].index = -1; + } + } + + void GTK_extcmd_set(int cmd) + { + if (cmd < 0 || cmd >= NO_EXT_CMD_MAPS) + extcmd = -1; + else + extcmd = extcmdmap[cmd].index; + } + + static void + extcmd_clicked(GtkWidget *widget, gpointer data) + { + extcmd = (int)data; + gtk_main_quit(); + } + + static gint + extcmd_destroy(GtkWidget *widget, gpointer data) + { + guint *hid = (guint *)data; + *hid = 0; + extcmd = -1; + + gtk_main_quit(); + + return FALSE; + } + + /* + * This is not ideal since you can't choose between extended commands + * that start with the same letter from the keyboard, but it will do + * for now. --- ALI + */ + + static gint + extcmd_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data) + { + int i, keysym; + keysym = nh_keysym(event); + + if(keysym){ + i = 0; + extcmd=-1; + while(extcmdlist[i].ef_txt){ + if(extcmdlist[i].ef_txt[0] == keysym){ + extcmd=i; + } + ++i; + } + if(extcmd>=0 || keysym=='\033') + gtk_main_quit(); + } + + return FALSE; + } + + int + GTK_get_ext_cmd() + { + guint hid; + + GtkWidget *window; + GtkWidget *frame; + GtkWidget *vbox; + GtkWidget *hbox; + GtkWidget *table = NULL; + GtkWidget *d; + int i, data; + const char *label; + + if (extcmd) + { + i = extcmd; + extcmd = 0; + return i; + } + + window = gtk_window_new(GTK_WINDOW_DIALOG); + gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_MOUSE); + gtk_signal_connect_after( + GTK_OBJECT(window), "key_press_event", + GTK_SIGNAL_FUNC(extcmd_key_press), NULL); + hid = gtk_signal_connect( + GTK_OBJECT(window), "destroy", + GTK_SIGNAL_FUNC(extcmd_destroy), &hid); + + frame = nh_gtk_new_and_add(gtk_frame_new(NULL), window, ""); + + vbox = nh_gtk_new_and_add(gtk_vbox_new(FALSE, 0), frame, ""); + + hbox = nh_gtk_new_and_pack( + gtk_hbox_new(FALSE, 0), vbox, "", + FALSE, FALSE, NH_PAD); + for(i=0; extcmdlist[i].ef_txt; i++) + ; + table = nh_gtk_new_and_pack( + gtk_table_new((i+2)/3, 3, TRUE), hbox, "", + FALSE, FALSE, NH_PAD); + for(i = 0; extcmdlist[i].ef_txt; i++) + { + if (!strcmp(extcmdlist[i].ef_txt, "?")) + { + /* + * Rather more useful than '?' in these circumstances -ALI + */ + label = "Cancel"; + data = -1; + } + else + { + label = extcmdlist[i].ef_txt; + data = i; + } + d = nh_gtk_new_and_attach( + gtk_button_new_with_label(label), table, "", + i%3, i%3+1, i/3, i/3+1); + gtk_signal_connect( + GTK_OBJECT(d), "clicked", + GTK_SIGNAL_FUNC(extcmd_clicked), (gpointer)data); + } + + gtk_grab_add(window); + gtk_widget_show_all(window); + + gtk_main(); + + if(hid > 0){ + gtk_widget_unmap(window); + gtk_signal_disconnect(GTK_OBJECT(window), hid); + + gtk_widget_destroy(frame); + gtk_widget_destroy(vbox); + gtk_widget_destroy(window); + } + + i = extcmd; + extcmd = 0; + return i; + } diff -Nacrd ../slashem-0.0.6E0F3/win/gtk/gtkmap.c ./win/gtk/gtkmap.c *** ../slashem-0.0.6E0F3/win/gtk/gtkmap.c Sat Mar 4 17:47:11 2000 --- ./win/gtk/gtkmap.c Thu Apr 13 15:15:43 2000 *************** *** 189,194 **** --- 189,195 ---- int cursx; int cursy; + int cursm; static int c_width; static int c_height; *************** *** 346,352 **** static gint map_button_event(GtkWidget *widget, GdkEventButton *event) { ! GTK_curs(NHW_MAP, event->x / 32, event->y / 32); if(map_click) gtk_main_quit(); --- 347,357 ---- static gint map_button_event(GtkWidget *widget, GdkEventButton *event) { ! GTK_curs(NHW_MAP, event->x / c_width, event->y / c_height); ! if (event->button == 1) ! cursm = CLICK_1; ! else ! cursm = CLICK_2; if(map_click) gtk_main_quit(); *************** *** 1265,1274 **** } void ! nh_map_pos(int *x, int *y) { *x = cursx; *y = cursy; } void --- 1270,1280 ---- } void ! nh_map_pos(int *x, int *y, int *mod) { *x = cursx; *y = cursy; + *mod = cursm; } void