Changeset 869

Show
Ignore:
Timestamp:
04/30/08 15:51:52 (4 months ago)
Author:
takkaria
Message:

Simply the menu API again -- remove the menu ID values.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cmd4.c

    r864 r869  
    5252#define MOD_COL         121 
    5353#define RESET_VIS       122 
    54  
    55 #define OPTION_MENU 140 
    56 #define VISUAL_MENU 141 
    57 #define COLOR_MENU      142 
    58 #define KNOWLEDGE_MENU 143 
    59 #define MACRO_MENU      144 
    6054 
    6155 
     
    42154209        menu = &option_menu; 
    42164210        WIPE(menu, menu_type); 
    4217         menu_set_id(menu, OPTION_MENU); 
    42184211        menu->title = "Options Menu"; 
    42194212        menu->menu_data = option_actions; 
     
    42364229        menu = &macro_menu; 
    42374230        WIPE(menu, menu_type); 
    4238         menu_set_id(menu, MACRO_MENU); 
    42394231        menu->title = "Interact with macros"; 
    42404232        menu->cmd_keys = cmd_keys; 
     
    42474239        menu = &visual_menu; 
    42484240        WIPE(menu, menu_type); 
    4249         menu_set_id(menu, VISUAL_MENU); 
    42504241        menu->title = "Interact with visuals"; 
    42514242        menu->cmd_keys = cmd_keys; 
     
    42584249        menu = &color_menu; 
    42594250        WIPE(menu, menu_type); 
    4260         menu_set_id(menu, COLOR_MENU); 
    42614251        menu->title = "Interact with colors"; 
    42624252        menu->cmd_keys = cmd_keys; 
     
    42694259        menu = &knowledge_menu; 
    42704260        WIPE(menu, menu_type); 
    4271         menu_set_id(menu, KNOWLEDGE_MENU); 
    42724261        menu->title = "Display current knowledge"; 
    42734262        menu->menu_data = knowledge_actions; 
  • trunk/src/death.c

    r864 r869  
    465465        menu = &death_menu; 
    466466        WIPE(menu, menu_type); 
    467         menu_set_id(menu, 1); 
    468467        menu->menu_data = death_actions; 
    469468        menu->flags = MN_CASELESS_TAGS; 
  • trunk/src/ui-event.h

    r868 r869  
    5454typedef struct 
    5555{ 
    56         int object_id;      /* Identifier used for macros, etc */ 
    5756        handler_f handler;  /* The handler function to call */ 
    5857        release_f release;  /* Frees any owned resources */ 
  • trunk/src/ui-menu.c

    r868 r869  
    3838 * MN_ACTIONS HELPER FUNCTIONS 
    3939 * 
    40  * MN_ACTIONS is the type of menu iterator that displays a simple list of  
     40 * MN_ACTIONS is the type of menu iterator that displays a simple list of 
    4141 * menu_actions. 
    4242 * ------------------------------------------------------------------------ */ 
    4343 
    4444/* Display an event, with possible preference overrides */ 
    45 static void display_action_aux(menu_action *act, int menu_id, byte color, int row, int col, int wid) 
     45static void display_action_aux(menu_action *act, byte color, int row, int col, int wid) 
    4646{ 
    4747        /* TODO: add preference support */ 
     
    5858        byte color = curs_attrs[CURS_KNOWN][0 != cursor]; 
    5959 
    60         display_action_aux(&acts[oid], menu->target.object_id, color,  
    61                            row, col, width); 
     60        display_action_aux(&acts[oid], color, row, col, width); 
    6261} 
    6362 
     
    116115        byte color = curs_attrs[!(items[oid].flags & (MN_GRAYED))][0 != cursor]; 
    117116 
    118         display_action_aux(&items[oid].act, menu->target.object_id, color, 
    119                            row, col, width); 
     117        display_action_aux(&items[oid].act, color, row, col, width); 
    120118} 
    121119 
     
    836834} 
    837835 
    838 void menu_set_id(menu_type *menu, int id) 
    839 { 
    840         menu->target.object_id = id; 
    841 } 
    842  
    843836/* ======================== MENU INITIALIZATION ==================== */ 
    844837 
     
    904897 
    905898        /* Stuff for the event listener (see ui-event.h) */ 
    906         menu->target.object_id = 0; 
    907899        menu->target.handler = menu_handle_event; 
    908900        menu->target.release = NULL; 
  • trunk/src/ui-menu.h

    r868 r869  
    245245void menu_set_filter(menu_type *menu, const int object_list[], int n); 
    246246void menu_release_filter(menu_type *menu); 
    247 void menu_set_id(menu_type *menu, int id); 
    248247 
    249248