Changeset 169
- Timestamp:
- 06/09/07 08:26:51 (1 year ago)
- Files:
-
- trunk/src/birth.c (modified) (3 diffs)
- trunk/src/cmd4.c (modified) (9 diffs)
- trunk/src/ui.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/birth.c
r156 r169 727 727 { 728 728 byte attr = curs_attrs[CURS_KNOWN][0 != cursor]; 729 c_p rt(attr, sex_info[oid].title, row, col);729 c_put_str(attr, sex_info[oid].title, row, col); 730 730 } 731 731 … … 741 741 { 742 742 byte attr = curs_attrs[CURS_KNOWN][0 != cursor]; 743 c_p rt(attr, p_name + p_info[oid].name, row, col);743 c_put_str(attr, p_name + p_info[oid].name, row, col); 744 744 } 745 745 … … 755 755 { 756 756 byte attr = curs_attrs[0 != (rp_ptr->choice & (1L << oid))][0 != cursor]; 757 c_p rt(attr, c_name + c_info[oid].name, row, col);757 c_put_str(attr, c_name + c_info[oid].name, row, col); 758 758 } 759 759 trunk/src/cmd4.c
r156 r169 2935 2935 int cursor = 0; 2936 2936 2937 region loc = {0, 1, 0, 11};2937 region loc = {0, 0, 0, 12}; 2938 2938 2939 2939 /* Roguelike */ … … 2953 2953 FILE_TYPE(FILE_TYPE_TEXT); 2954 2954 2955 2956 2955 screen_save(); 2957 2956 … … 2967 2966 clear_from(0); 2968 2967 2969 /* No title -- this is a complex menu. */2970 prt("Interact with macros", 0, 0);2971 2968 /* Describe current action */ 2972 prt("Current action (if any) shown below:", 12, 0); 2969 prt("Current action (if any) shown below:", 13, 0); 2970 2973 2971 /* Analyze the current action */ 2974 2972 ascii_to_text(tmp, sizeof(tmp), macro_buffer); 2973 2975 2974 /* Display the current action */ 2976 prt(tmp, 1 3, 0);2975 prt(tmp, 14, 0); 2977 2976 c = menu_select(¯o_menu, &cursor, EVT_CMD); 2978 2977 2979 if (ESCAPE == c.key) 2980 break;2978 2979 if (ESCAPE == c.key) break; 2981 2980 evt = macro_actions[cursor].id; 2982 2981 2983 switch(evt) { 2982 switch(evt) 2983 { 2984 2984 case LOAD_PREF: 2985 { 2985 2986 do_cmd_pref_file_hack(16); 2986 2987 break; 2988 } 2987 2989 2988 2990 #ifdef ALLOW_MACROS … … 3070 3072 break; 3071 3073 } 3074 3072 3075 case DEL_MACRO: 3073 3076 { … … 4166 4169 menu_type *menu; 4167 4170 4171 /* options screen selection menu */ 4172 menu = &option_menu; 4173 WIPE(menu, menu_type); 4174 menu_set_id(menu, OPTION_MENU); 4175 menu->title = "Options Menu"; 4176 menu->menu_data = option_actions; 4177 menu->count = N_ELEMENTS(option_actions); 4178 menu_init(menu, MN_SCROLL, MN_ACT, &SCREEN_REGION); 4179 4168 4180 /* Initialize the options toggle menu */ 4169 4181 menu = &option_toggle_menu; … … 4171 4183 menu->prompt = "Set option (y/n/t), '?' for information"; 4172 4184 menu->cmd_keys = "?YyNnTt"; 4173 menu->selections = default_choice;4185 menu->selections = "abcdefghijklmopqrsuvwxz"; 4174 4186 menu->count = OPT_PAGE_PER; 4175 4187 menu->flags = MN_DBL_TAP; 4176 4188 menu_init2(menu, find_menu_skin(MN_SCROLL), &options_iter, &SCREEN_REGION); 4177 4178 /* options screen selection menu */4179 menu = &option_menu;4180 WIPE(menu, menu_type);4181 menu_set_id(menu, OPTION_MENU);4182 menu->title = "Options Menu";4183 menu->count = N_ELEMENTS(option_actions);4184 menu->menu_data = option_actions;4185 menu_init(menu, MN_SCROLL, MN_ACT, &SCREEN_REGION);4186 4189 4187 4190 /* macro menu */ … … 4189 4192 WIPE(menu, menu_type); 4190 4193 menu_set_id(menu, MACRO_MENU); 4194 menu->title = "Interact with macros"; 4195 menu->selections = default_choice; 4196 menu->menu_data = macro_actions; 4191 4197 menu->count = N_ELEMENTS(macro_actions); 4192 menu->menu_data = macro_actions;4193 menu->selections = lower_case;4194 4198 menu_init(menu, MN_SCROLL, MN_EVT, &SCREEN_REGION); 4195 4199 4196 /* knowledge menu */4197 menu = &knowledge_menu;4198 WIPE(menu, menu_type);4199 menu_set_id(menu, KNOWLEDGE_MENU);4200 menu->title = "Display current knowledge";4201 menu->count = N_ELEMENTS(knowledge_actions),4202 menu->menu_data = knowledge_actions;4203 menu_init(menu, MN_SCROLL, MN_ACT, &SCREEN_REGION);4204 4205 4200 /* visuals menu */ 4206 4201 menu = &visual_menu; … … 4209 4204 menu->title = "Interact with visuals"; 4210 4205 menu->selections = default_choice; 4206 menu->menu_data = visual_menu_items; 4211 4207 menu->count = N_ELEMENTS(visual_menu_items); 4212 menu->menu_data = visual_menu_items;4213 4208 menu_init(menu, MN_SCROLL, MN_EVT, &SCREEN_REGION); 4214 4209 … … 4219 4214 menu->title = "Interact with colors"; 4220 4215 menu->selections = default_choice; 4221 menu->count = N_ELEMENTS(color_events),4222 4216 menu->menu_data = color_events; 4217 menu->count = N_ELEMENTS(color_events); 4223 4218 menu_init(menu, MN_SCROLL, MN_EVT, &SCREEN_REGION); 4219 4220 /* knowledge menu */ 4221 menu = &knowledge_menu; 4222 WIPE(menu, menu_type); 4223 menu_set_id(menu, KNOWLEDGE_MENU); 4224 menu->title = "Display current knowledge"; 4225 menu->menu_data = knowledge_actions; 4226 menu->count = N_ELEMENTS(knowledge_actions), 4227 menu_init(menu, MN_SCROLL, MN_ACT, &SCREEN_REGION); 4224 4228 4225 4229 /* initialize other static variables */ trunk/src/ui.c
r166 r169 17 17 */ 18 18 #include "angband.h" 19 20 19 21 20 /* … … 333 332 334 333 /* Display current view of a skin */ 335 static void 336 display_scrolling(menu_type *menu, int cursor, int *top, region *loc) 334 static void display_scrolling(menu_type *menu, int cursor, int *top, region *loc) 337 335 { 338 336 int col = loc->col; … … 342 340 int i; 343 341 344 if ((cursor <= *top) && (*top > 0)) { 342 if ((cursor <= *top) && (*top > 0)) 343 { 345 344 if(menu->flags & MN_PAGE) *top = cursor; 346 345 else *top = cursor - jumpscroll - 1; 347 346 } 348 if (cursor >= *top + (rows_per_page - 1)) { 349 if(menu->flags & MN_PAGE && cursor + rows_per_page < n) 347 348 if (cursor >= *top + (rows_per_page - 1)) 349 { 350 if (menu->flags & MN_PAGE && cursor + rows_per_page < n) 350 351 *top = cursor; 351 else if (menu->flags & MN_PAGE)352 else if (menu->flags & MN_PAGE) 352 353 *top = n - rows_per_page; 353 354 else 354 355 *top = cursor - (rows_per_page - 1) + 1 + jumpscroll; 355 356 } 357 356 358 if (*top > n - rows_per_page) 357 359 *top = n - rows_per_page; … … 366 368 } 367 369 368 if ( cursor >= 0)370 if (menu->cursor >= 0) 369 371 Term_gotoxy(col, row + cursor - *top); 370 372 } … … 553 555 554 556 /* Modal display of menu */ 555 static void 556 display_menu_row(menu_type *menu, int pos, int top, 557 bool cursor, int row, int col, int width) 557 static void display_menu_row(menu_type *menu, int pos, int top, 558 bool cursor, int row, int col, int width) 558 559 { 559 560 int flags = menu->flags; … … 604 605 TERM_WHITE, menu->prompt); 605 606 606 menu->skin->display_list(menu, menu->cursor, &menu->top, &menu->active);607 608 607 if (menu->browse_hook && oid >= 0) 609 608 menu->browse_hook(oid, (void*) menu->menu_data, loc); 609 610 menu->skin->display_list(menu, menu->cursor, &menu->top, &menu->active); 610 611 } 611 612
