Changeset 715

Show
Ignore:
Timestamp:
02/26/08 04:21:07 (6 months ago)
Author:
takkaria
Message:

Fix #344:

  • Make it so that regardless of what you were doing previously, get_item() prompts start on the inventory
  • Remove the abomination that was p_ptr->command_see
  • Clean up get_item() a little, too.

Also fix a minor bug with the death character information display.

Files:

Legend:

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

    r653 r715  
    504504                item_tester_hook = inven_carry_okay; 
    505505 
    506                 /* Request a list */ 
    507                 p_ptr->command_see = TRUE; 
    508  
    509506                /* Get an object or exit. */ 
    510507                q = "Get which item?"; 
     
    512509                if (!get_item(&item, q, s, USE_FLOOR)) 
    513510                        return (objs_picked_up); 
    514                  
     511 
    515512                this_o_idx = 0 - item; 
    516513                call_function_again = TRUE; 
  • trunk/src/cmd3.c

    r698 r715  
    6161                p_ptr->command_new = 0; 
    6262        } 
    63  
    64         /* Hack -- Process normal keys */ 
    65         else 
    66         { 
    67                 /* Hack -- Use "display" mode */ 
    68                 p_ptr->command_see = TRUE; 
    69         } 
    7063} 
    7164 
     
    10699                /* Reset stuff */ 
    107100                p_ptr->command_new = 0; 
    108         } 
    109  
    110         /* Hack -- Process normal keys */ 
    111         else 
    112         { 
    113                 /* Enter "display" mode */ 
    114                 p_ptr->command_see = TRUE; 
    115101        } 
    116102} 
  • trunk/src/death.c

    r653 r715  
    227227 
    228228        /* Prompt for inventory */ 
    229         prt("Hit any key to see more information (ESC to abort): ", 23, 0); 
     229        prt("Hit any key to see more information (ESC to abort): ", 0, 0); 
    230230 
    231231        /* Allow abort at this point */ 
     
    339339        (void)title; 
    340340 
    341  
    342         screen_save(); 
    343         Term_clear(); 
    344  
    345         /* Start out in "display" mode */ 
    346         p_ptr->command_see = TRUE; 
    347  
    348341        /* Get an item */ 
    349342        q = "Examine which item? "; 
     
    368361                screen_load(); 
    369362        } 
    370  
    371         screen_load(); 
    372363} 
    373364 
  • trunk/src/dungeon.c

    r698 r715  
    11851185 
    11861186 
    1187                 /* Hack -- cancel "lurking browse mode" */ 
    1188                 if (!p_ptr->command_new) p_ptr->command_see = FALSE
     1187                /* Hack -- reset to inventory display */ 
     1188                if (!p_ptr->command_new) p_ptr->command_wrk = USE_INVEN
    11891189 
    11901190 
  • trunk/src/obj-ui.c

    r698 r715  
    731731 * also to induce "auto-enter" of stores, and other such stuff. 
    732732 * 
    733  * Global "p_ptr->command_see" may be set before calling this function to start 
    734  * out in "browse" mode.  It is cleared before this function returns. 
    735  * 
    736733 * Global "p_ptr->command_wrk" is used to choose between equip/inven/floor 
    737734 * listings.  It is equal to USE_INVEN or USE_EQUIP or USE_FLOOR, except 
     
    779776        int floor_num; 
    780777 
    781  
    782         /* Always show lists */ 
    783         if (OPT(show_lists)) p_ptr->command_see = TRUE; 
     778        bool show_list = OPT(show_lists) ? TRUE : FALSE; 
    784779 
    785780 
     
    869864        if (!allow_inven && !allow_equip && !allow_floor) 
    870865        { 
    871                 /* Cancel p_ptr->command_see */ 
    872                 if (!OPT(show_lists)) p_ptr->command_see = FALSE; 
    873  
    874866                /* Oops */ 
    875867                oops = TRUE; 
    876  
    877                 /* Done */ 
    878868                done = TRUE; 
    879869        } 
     
    883873        { 
    884874                /* Hack -- Start on equipment if requested */ 
    885                 if (p_ptr->command_see && 
    886                     (p_ptr->command_wrk == (USE_EQUIP)) && 
    887                     use_equip) 
    888                 { 
    889                         p_ptr->command_wrk = (USE_EQUIP); 
    890                 } 
     875                if ((p_ptr->command_wrk == USE_EQUIP) && use_equip) 
     876                        p_ptr->command_wrk = USE_EQUIP; 
    891877 
    892878                /* Use inventory if allowed */ 
    893879                else if (use_inven) 
    894                 { 
    895                         p_ptr->command_wrk = (USE_INVEN); 
    896                 } 
     880                        p_ptr->command_wrk = USE_INVEN; 
    897881 
    898882                /* Use equipment if allowed */ 
    899883                else if (use_equip) 
    900                 { 
    901                         p_ptr->command_wrk = (USE_EQUIP); 
    902                 } 
     884                        p_ptr->command_wrk = USE_EQUIP; 
    903885 
    904886                /* Use floor if allowed */ 
    905887                else if (use_floor) 
    906                 { 
    907                         p_ptr->command_wrk = (USE_FLOOR); 
    908                 } 
     888                        p_ptr->command_wrk = USE_FLOOR; 
    909889 
    910890                /* Hack -- Use (empty) inventory */ 
    911891                else 
    912                 { 
    913                         p_ptr->command_wrk = (USE_INVEN); 
    914                 } 
     892                        p_ptr->command_wrk = USE_INVEN; 
    915893        } 
    916894 
    917895 
    918896        /* Start out in "display" mode */ 
    919         if (p_ptr->command_see
     897        if (show_list
    920898        { 
    921899                /* Save screen */ 
     
    944922 
    945923                /* Toggle if needed */ 
    946                 if (((p_ptr->command_wrk == (USE_EQUIP)) && ni && !ne) || 
    947                     ((p_ptr->command_wrk == (USE_INVEN)) && !ni && ne)) 
     924                if (((p_ptr->command_wrk == USE_EQUIP) && ni && !ne) || 
     925                    ((p_ptr->command_wrk == USE_INVEN) && !ni && ne)) 
    948926                { 
    949927                        /* Toggle */ 
     
    961939 
    962940                /* Viewing inventory */ 
    963                 if (p_ptr->command_wrk == (USE_INVEN)
     941                if (p_ptr->command_wrk == USE_INVEN
    964942                { 
    965943                        /* Redraw if needed */ 
    966                         if (p_ptr->command_see) show_inven(); 
     944                        if (show_list) show_inven(); 
    967945 
    968946                        /* Begin the prompt */ 
     
    981959 
    982960                        /* Indicate ability to "view" */ 
    983                         if (!p_ptr->command_see
     961                        if (!show_list
    984962                        { 
    985963                                my_strcat(out_val, " * to see,", sizeof(out_val)); 
     
    1010988 
    1011989                /* Viewing equipment */ 
    1012                 else if (p_ptr->command_wrk == (USE_EQUIP)
     990                else if (p_ptr->command_wrk == USE_EQUIP
    1013991                { 
    1014992                        /* Redraw if needed */ 
    1015                         if (p_ptr->command_see) show_equip(); 
     993                        if (show_list) show_equip(); 
    1016994 
    1017995                        /* Begin the prompt */ 
     
    10301008 
    10311009                        /* Indicate ability to "view" */ 
    1032                         if (!p_ptr->command_see
     1010                        if (!show_list
    10331011                        { 
    10341012                                my_strcat(out_val, " * to see,", sizeof(out_val)); 
     
    10551033                { 
    10561034                        /* Redraw if needed */ 
    1057                         if (p_ptr->command_see) show_floor(floor_list, floor_num, FALSE); 
     1035                        if (show_list) show_floor(floor_list, floor_num, FALSE); 
    10581036 
    10591037                        /* Begin the prompt */ 
     
    10711049 
    10721050                        /* Indicate ability to "view" */ 
    1073                         if (!p_ptr->command_see
     1051                        if (!show_list
    10741052                        { 
    10751053                                my_strcat(out_val, " * to see,", sizeof(out_val)); 
     
    11301108                                { 
    11311109                                        /* Hide the list */ 
    1132                                         if (p_ptr->command_see
     1110                                        if (show_list
    11331111                                        { 
    11341112                                                /* Flip flag */ 
    1135                                                 p_ptr->command_see = FALSE; 
     1113                                                show_list = FALSE; 
    11361114 
    11371115                                                /* Load screen */ 
     
    11461124 
    11471125                                                /* Flip flag */ 
    1148                                                 p_ptr->command_see = TRUE; 
     1126                                                show_list = TRUE; 
    11491127                                        } 
    11501128                                } 
     
    11561134                        { 
    11571135                                /* Toggle to inventory */ 
    1158                                 if (use_inven && (p_ptr->command_wrk != (USE_INVEN))) 
    1159                                 { 
    1160                                         p_ptr->command_wrk = (USE_INVEN)
     1136                                if (use_inven && (p_ptr->command_wrk != USE_INVEN)) 
     1137                                { 
     1138                                        p_ptr->command_wrk = USE_INVEN
    11611139                                } 
    11621140 
    11631141                                /* Toggle to equipment */ 
    1164                                 else if (use_equip && (p_ptr->command_wrk != (USE_EQUIP))) 
    1165                                 { 
    1166                                         p_ptr->command_wrk = (USE_EQUIP)
     1142                                else if (use_equip && (p_ptr->command_wrk != USE_EQUIP)) 
     1143                                { 
     1144                                        p_ptr->command_wrk = USE_EQUIP
    11671145                                } 
    11681146 
     
    11741152                                } 
    11751153 
     1154 
    11761155                                /* Hack -- Fix screen */ 
    1177                                 if (p_ptr->command_see
     1156                                if (show_list
    11781157                                { 
    11791158                                        /* Load screen */ 
     
    12231202 
    12241203                                /* Hack -- Fix screen */ 
    1225                                 if (p_ptr->command_see
     1204                                if (show_list
    12261205                                { 
    12271206                                        /* Load screen */ 
     
    13021281                        { 
    13031282                                /* Choose "default" inventory item */ 
    1304                                 if (p_ptr->command_wrk == (USE_INVEN)
     1283                                if (p_ptr->command_wrk == USE_INVEN
    13051284                                { 
    13061285                                        if (i1 != i2) 
     
    13141293 
    13151294                                /* Choose "default" equipment item */ 
    1316                                 else if (p_ptr->command_wrk == (USE_EQUIP)
     1295                                else if (p_ptr->command_wrk == USE_EQUIP
    13171296                                { 
    13181297                                        if (e1 != e2) 
     
    13831362 
    13841363                                /* Convert letter to inventory index */ 
    1385                                 if (p_ptr->command_wrk == (USE_INVEN)
     1364                                if (p_ptr->command_wrk == USE_INVEN
    13861365                                { 
    13871366                                        k = label_to_inven(which.key); 
     
    13951374 
    13961375                                /* Convert letter to equipment index */ 
    1397                                 else if (p_ptr->command_wrk == (USE_EQUIP)
     1376                                else if (p_ptr->command_wrk == USE_EQUIP
    13981377                                { 
    13991378                                        k = label_to_equip(which.key); 
     
    14531432 
    14541433        /* Fix the screen if necessary */ 
    1455         if (p_ptr->command_see
     1434        if (show_list
    14561435        { 
    14571436                /* Load screen */ 
     
    14591438 
    14601439                /* Hack -- Cancel "display" */ 
    1461                 p_ptr->command_see = FALSE; 
     1440                show_list = FALSE; 
    14621441        } 
    14631442 
     
    14691448        button_kill('!'); 
    14701449        redraw_stuff(); 
    1471    
     1450  
    14721451        /* Forget the item_tester_tval restriction */ 
    14731452        item_tester_tval = 0; 
  • trunk/src/store.c

    r707 r715  
    28022802        p_ptr->command_new = 0; 
    28032803 
    2804         /* Hack -- Cancel "see" mode */ 
    2805         p_ptr->command_see = FALSE; 
    2806  
    28072804 
    28082805        /* Flush messages XXX XXX XXX */ 
  • trunk/src/types.h

    r698 r715  
    939939        ui_event_data command_cmd_ex; /* Gives additional information of current command */ 
    940940 
    941         s16b command_see;               /* See "cmd1.c" */ 
    942941        s16b command_wrk;               /* See "cmd1.c" */ 
    943  
    944942        s16b command_new;               /* Hack -- command chaining XXX XXX */ 
    945943