Changeset 332

Show
Ignore:
Timestamp:
07/13/07 12:29:29 (1 year ago)
Author:
takkaria
Message:

Add show_lists option, the EyAngband? way. (closes #25)

Files:

Legend:

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

    r278 r332  
    351351 
    352352        /* Hack -- when browsing a book, start with list shown */ 
    353         if (browse
     353        if (browse || OPT(show_lists)
    354354        { 
    355355                /* Show list */ 
     
    364364 
    365365        /* Build a prompt (accept all spells) */ 
    366         strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) %^s which %s? ", 
    367                 p, I2A(0), I2A(num - 1), prompt, p); 
     366        strnfmt(out_val, sizeof(out_val), "(%^ss a-%c%s, ESC=exit) %^s which %s? ", 
     367                p, I2A(num - 1), (OPT(show_lists) ? "" : ", *=List"), prompt, p); 
    368368 
    369369        /* Get a spell from the user */ 
     
    371371        { 
    372372                /* Request redraw */ 
    373                 if ((choice == ' ') || (choice == '*') || (choice == '?')) 
     373                if (!OPT(show_lists) && 
     374                    ((choice == ' ') || (choice == '*') || (choice == '?'))) 
    374375                { 
    375376                        /* Hide the list */ 
     
    437438 
    438439                        /* Prompt */ 
    439                         strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ", 
     440                        strnfmt(tmp_val, sizeof(tmp_val), "%^s %s (%d mana, %d%% fail)? ", 
    440441                                prompt, get_spell_name(cp_ptr->spell_book, spell), 
    441442                                s_ptr->smana, spell_chance(spell)); 
     
    776777                /* Message */ 
    777778                msg_format("You can learn %d more %s%s.", 
    778                            p_ptr->new_spells, p, 
    779                            (p_ptr->new_spells != 1) ? "s" : ""); 
     779                           p_ptr->new_spells, p, PLURAL(p_ptr->new_spells)); 
    780780        } 
    781781 
  • trunk/src/defines.h

    r320 r332  
    23912391 
    23922392#define OPT_show_labels                         10 
     2393#define OPT_show_lists              11 
    23932394 
    23942395#define OPT_ring_bell                           14 
     
    24752476 * Hack -- Option symbols 
    24762477 */ 
    2477 #define OPTION(opt_name)      op_ptr->opt[OPT_##opt_name] 
    2478  
    2479 #define rogue_like_commands             OPTION(rogue_like_commands) 
    2480 #define quick_messages                  OPTION(quick_messages) 
    2481 #define use_sound                               OPTION(use_sound) 
    2482 #define pickup_detail                   OPTION(pickup_detail) 
    2483 #define use_old_target                  OPTION(use_old_target) 
    2484 #define pickup_always                   OPTION(pickup_always) 
    2485 #define pickup_inven                    OPTION(pickup_inven) 
    2486 #define depth_in_feet                   OPTION(depth_in_feet) 
    2487 #define show_labels                             OPTION(show_labels) 
    2488 #define ring_bell                               OPTION(ring_bell) 
    2489 #define show_flavors                    OPTION(show_flavors) 
    2490 #define run_ignore_doors                OPTION(run_ignore_doors) 
    2491 #define disturb_move                    OPTION(disturb_move) 
    2492 #define disturb_near                    OPTION(disturb_near) 
    2493 #define disturb_detect                  OPTION(disturb_detect) 
    2494 #define disturb_state                   OPTION(disturb_state) 
    2495 #define disturb_minor                   OPTION(disturb_minor) 
    2496 #define view_perma_grids                OPTION(view_perma_grids) 
    2497 #define view_torch_grids                OPTION(view_torch_grids) 
    2498 #define flush_failure                   OPTION(flush_failure) 
    2499 #define flush_disturb                   OPTION(flush_disturb) 
    2500 #define hilite_player                   OPTION(hilite_player) 
    2501 #define view_yellow_lite                OPTION(view_yellow_lite) 
    2502 #define view_bright_lite                OPTION(view_bright_lite) 
    2503 #define view_granite_lite               OPTION(view_granite_lite) 
    2504 #define view_special_lite               OPTION(view_special_lite) 
    2505 #define easy_open                               OPTION(easy_open) 
    2506 #define easy_alter                              OPTION(easy_alter) 
    2507 #define show_piles                              OPTION(show_piles) 
    2508 #define center_player                   OPTION(center_player) 
    2509 #define auto_more                               OPTION(auto_more) 
    2510 #define hp_changes_color                OPTION(hp_changes_color) 
    2511 #define hide_squelchable                OPTION(hide_squelchable) 
    2512 #define mouse_movement                  OPTION(mouse_movement) 
    2513  
    2514 #define birth_maximize                  OPTION(birth_maximize) 
    2515 #define birth_randarts                  OPTION(birth_randarts) 
    2516 #define birth_autoscum                  OPTION(birth_autoscum) 
    2517 #define birth_ironman                   OPTION(birth_ironman) 
    2518 #define birth_no_stores                 OPTION(birth_no_stores) 
    2519 #define birth_no_artifacts              OPTION(birth_no_artifacts) 
    2520 #define birth_no_stacking       OPTION(birth_no_stacking) 
    2521 #define birth_no_preserve       OPTION(birth_no_preserve) 
    2522 #define birth_no_stairs                 OPTION(birth_no_stairs) 
    2523 #define birth_ai_sound                  OPTION(birth_ai_sound) 
    2524 #define birth_ai_smell                  OPTION(birth_ai_smell) 
    2525 #define birth_ai_packs                  OPTION(birth_ai_packs) 
    2526 #define birth_ai_learn                  OPTION(birth_ai_learn) 
    2527 #define birth_ai_cheat                  OPTION(birth_ai_cheat) 
    2528 #define birth_ai_smart                  OPTION(birth_ai_smart) 
    2529  
    2530 #define cheat_peek                              OPTION(cheat_peek) 
    2531 #define cheat_hear                              OPTION(cheat_hear) 
    2532 #define cheat_room                              OPTION(cheat_room) 
    2533 #define cheat_xtra                              OPTION(cheat_xtra) 
    2534 #define cheat_know                              OPTION(cheat_know) 
    2535 #define cheat_live                              OPTION(cheat_live) 
    2536  
    2537 #define adult_maximize                  OPTION(adult_maximize) 
    2538 #define adult_randarts                  OPTION(adult_randarts) 
    2539 #define adult_autoscum                  OPTION(adult_autoscum) 
    2540 #define adult_ironman                   OPTION(adult_ironman) 
    2541 #define adult_no_stores                 OPTION(adult_no_stores) 
    2542 #define adult_no_artifacts              OPTION(adult_no_artifacts) 
    2543 #define adult_no_stacking               OPTION(adult_no_stacking) 
    2544 #define adult_no_preserve               OPTION(adult_no_preserve) 
    2545 #define adult_no_stairs                 OPTION(adult_no_stairs) 
    2546 #define adult_ai_sound                  OPTION(adult_ai_sound) 
    2547 #define adult_ai_smell                  OPTION(adult_ai_smell) 
    2548 #define adult_ai_packs                  OPTION(adult_ai_packs) 
    2549 #define adult_ai_learn                  OPTION(adult_ai_learn) 
    2550 #define adult_ai_cheat                  OPTION(adult_ai_cheat) 
    2551 #define adult_ai_smart                  OPTION(adult_ai_smart) 
    2552  
    2553 #define score_peek                              OPTION(score_peek) 
    2554 #define score_hear                              OPTION(score_hear) 
    2555 #define score_room                              OPTION(score_room) 
    2556 #define score_xtra                              OPTION(score_xtra) 
    2557 #define score_know                              OPTION(score_know) 
    2558 #define score_live                              OPTION(score_live) 
     2478#define OPT(opt_name) op_ptr->opt[OPT_##opt_name] 
     2479 
     2480#define rogue_like_commands             OPT(rogue_like_commands) 
     2481#define quick_messages                  OPT(quick_messages) 
     2482#define use_sound                               OPT(use_sound) 
     2483#define pickup_detail                   OPT(pickup_detail) 
     2484#define use_old_target                  OPT(use_old_target) 
     2485#define pickup_always                   OPT(pickup_always) 
     2486#define pickup_inven                    OPT(pickup_inven) 
     2487#define depth_in_feet                   OPT(depth_in_feet) 
     2488#define show_labels                             OPT(show_labels) 
     2489#define ring_bell                               OPT(ring_bell) 
     2490#define show_flavors                    OPT(show_flavors) 
     2491#define run_ignore_doors                OPT(run_ignore_doors) 
     2492#define disturb_move                    OPT(disturb_move) 
     2493#define disturb_near                    OPT(disturb_near) 
     2494#define disturb_detect                  OPT(disturb_detect) 
     2495#define disturb_state                   OPT(disturb_state) 
     2496#define disturb_minor                   OPT(disturb_minor) 
     2497#define view_perma_grids                OPT(view_perma_grids) 
     2498#define view_torch_grids                OPT(view_torch_grids) 
     2499#define flush_failure                   OPT(flush_failure) 
     2500#define flush_disturb                   OPT(flush_disturb) 
     2501#define hilite_player                   OPT(hilite_player) 
     2502#define view_yellow_lite                OPT(view_yellow_lite) 
     2503#define view_bright_lite                OPT(view_bright_lite) 
     2504#define view_granite_lite               OPT(view_granite_lite) 
     2505#define view_special_lite               OPT(view_special_lite) 
     2506#define easy_open                               OPT(easy_open) 
     2507#define easy_alter                              OPT(easy_alter) 
     2508#define show_piles                              OPT(show_piles) 
     2509#define center_player                   OPT(center_player) 
     2510#define auto_more                               OPT(auto_more) 
     2511#define hp_changes_color                OPT(hp_changes_color) 
     2512#define hide_squelchable                OPT(hide_squelchable) 
     2513#define mouse_movement                  OPT(mouse_movement) 
     2514 
     2515#define birth_maximize                  OPT(birth_maximize) 
     2516#define birth_randarts                  OPT(birth_randarts) 
     2517#define birth_autoscum                  OPT(birth_autoscum) 
     2518#define birth_ironman                   OPT(birth_ironman) 
     2519#define birth_no_stores                 OPT(birth_no_stores) 
     2520#define birth_no_artifacts              OPT(birth_no_artifacts) 
     2521#define birth_no_stacking       OPT(birth_no_stacking) 
     2522#define birth_no_preserve       OPT(birth_no_preserve) 
     2523#define birth_no_stairs                 OPT(birth_no_stairs) 
     2524#define birth_ai_sound                  OPT(birth_ai_sound) 
     2525#define birth_ai_smell                  OPT(birth_ai_smell) 
     2526#define birth_ai_packs                  OPT(birth_ai_packs) 
     2527#define birth_ai_learn                  OPT(birth_ai_learn) 
     2528#define birth_ai_cheat                  OPT(birth_ai_cheat) 
     2529#define birth_ai_smart                  OPT(birth_ai_smart) 
     2530 
     2531#define cheat_peek                              OPT(cheat_peek) 
     2532#define cheat_hear                              OPT(cheat_hear) 
     2533#define cheat_room                              OPT(cheat_room) 
     2534#define cheat_xtra                              OPT(cheat_xtra) 
     2535#define cheat_know                              OPT(cheat_know) 
     2536#define cheat_live                              OPT(cheat_live) 
     2537 
     2538#define adult_maximize                  OPT(adult_maximize) 
     2539#define adult_randarts                  OPT(adult_randarts) 
     2540#define adult_autoscum                  OPT(adult_autoscum) 
     2541#define adult_ironman                   OPT(adult_ironman) 
     2542#define adult_no_stores                 OPT(adult_no_stores) 
     2543#define adult_no_artifacts              OPT(adult_no_artifacts) 
     2544#define adult_no_stacking               OPT(adult_no_stacking) 
     2545#define adult_no_preserve               OPT(adult_no_preserve) 
     2546#define adult_no_stairs                 OPT(adult_no_stairs) 
     2547#define adult_ai_sound                  OPT(adult_ai_sound) 
     2548#define adult_ai_smell                  OPT(adult_ai_smell) 
     2549#define adult_ai_packs                  OPT(adult_ai_packs) 
     2550#define adult_ai_learn                  OPT(adult_ai_learn) 
     2551#define adult_ai_cheat                  OPT(adult_ai_cheat) 
     2552#define adult_ai_smart                  OPT(adult_ai_smart) 
     2553 
     2554#define score_peek                              OPT(score_peek) 
     2555#define score_hear                              OPT(score_hear) 
     2556#define score_room                              OPT(score_room) 
     2557#define score_xtra                              OPT(score_xtra) 
     2558#define score_know                              OPT(score_know) 
     2559#define score_live                              OPT(score_live) 
    25592560 
    25602561 
  • trunk/src/object1.c

    r325 r332  
    28532853 
    28542854 
     2855        /* Always show lists */ 
     2856        if (OPT(show_lists)) p_ptr->command_see = TRUE; 
     2857 
     2858 
    28552859        /* Get the item index */ 
    28562860        if (repeat_pull(cp)) 
     
    29392943        { 
    29402944                /* Cancel p_ptr->command_see */ 
    2941                 p_ptr->command_see = FALSE; 
     2945                if (!OPT(show_lists)) p_ptr->command_see = FALSE; 
    29422946 
    29432947                /* Oops */ 
     
    31503154                        case ' ': 
    31513155                        { 
    3152                                 /* Hide the list */ 
    3153                                 if (p_ptr->command_see) 
     3156                                if (!OPT(show_lists)) 
    31543157                                { 
    3155                                         /* Flip flag */ 
    3156                                         p_ptr->command_see = FALSE; 
    3157  
    3158                                         /* Load screen */ 
    3159                                         screen_load(); 
    3160                                 } 
    3161  
    3162                                 /* Show the list */ 
    3163                                 else 
    3164                                 { 
    3165                                         /* Save screen */ 
    3166                                         screen_save(); 
    3167  
    3168                                         /* Flip flag */ 
    3169                                         p_ptr->command_see = TRUE; 
     3158                                        /* Hide the list */ 
     3159                                        if (p_ptr->command_see) 
     3160                                        { 
     3161                                                /* Flip flag */ 
     3162                                                p_ptr->command_see = FALSE; 
     3163 
     3164                                                /* Load screen */ 
     3165                                                screen_load(); 
     3166                                        } 
     3167 
     3168                                        /* Show the list */ 
     3169                                        else 
     3170                                        { 
     3171                                                /* Save screen */ 
     3172                                                screen_save(); 
     3173 
     3174                                                /* Flip flag */ 
     3175                                                p_ptr->command_see = TRUE; 
     3176                                        } 
    31703177                                } 
    31713178 
  • trunk/src/tables.c

    r305 r332  
    14081408        NULL,                                           /* xxx stack_force_costs */ 
    14091409        "show_labels",                          /* OPT_show_labels */ 
    1410         NULL,                                          /* xxx show_weights */ 
     1410        "show_lists",                          /* OPT_show_lists */ 
    14111411        NULL,                                           /* xxx show_choices */ 
    14121412        NULL,                                           /* xxx show_details */ 
     
    16721672        NULL,                                                                           /* xxx stack_force_costs */ 
    16731673        "Show labels in equipment listings",            /* OPT_show_labels */ 
    1674         NULL,                                                                          /* xxx show_weights */ 
     1674        "Always show lists",                                           /* OPT_show_lists */ 
    16751675        NULL,                                                                           /* xxx show_choices */ 
    16761676        NULL,                                                                           /* xxx show_details */ 
     
    19361936        FALSE,          /* xxx stack_force_costs */ 
    19371937        TRUE,           /* OPT_show_labels */ 
    1938         FALSE,         /* xxx show_weights */ 
     1938        TRUE,          /* OPT_show_weights */ 
    19391939        FALSE,          /* xxx show_choices */ 
    19401940        FALSE,          /* xxx show_details */ 
     
    22002200                OPT_easy_alter, 
    22012201                OPT_easy_open, 
     2202                OPT_show_lists, 
    22022203                OPT_mouse_movement, 
    2203                 OPT_NONE, 
    22042204                OPT_NONE, 
    22052205                OPT_NONE,