Feature suggestion 'l'ook for inventory/equipment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PaulBlay
    Knight
    • Jan 2009
    • 657

    Feature suggestion 'l'ook for inventory/equipment

    At present you can only 'l'ook at items in shops / your home. I suggest that when the inventory or equipment list is showing (e.g. 'i' or 'e' has been pressed) that 'l'ook could work like it does at home.

    [EDIT]Never mind. I suppose 'I' is the equivalent for that.

    ===============================================

    The following is (I think) "Everything that can be done with an item in your equipment or inventory". I would suggest that it (or something like it)
    could be made the context sensitive help for when your inventory or
    equipment is showing (e.g. pressed 'i' or 'e').

    Code:
    === Inventory/Equipment help ===
    i  Show inventory list                 q  Quaff a potion from inventory/ground
    e  Show equipment list                 r  Read a scroll from inventory/ground
    d  Drop an item from inv/equip         {  Inscribe object (inv/equip/ground)
    k  Destroy item from inv/equip/ground  }  Uninscribe object (inv/equip/ground)
    w  Wear/wield item from inv/ground     A  Activate an artifcat (inv/equip/gr)
    t  Take off an item from equipment     a  Aim a wand from inventory/ground
    b  Browse a book from inventory        u  Use a staff from inventory/ground
    G  Gain new spells/prayers from a book z  Zap a rod from inventory/ground
    m  Cast a spell from a book (inv)      f  Fire an item from inventory/ground
    p  Pray a prayer from a book (inv)     v  Throw an item from inventory/ground
    E  Eat some food from inventory/ground I  Observe an item (inv/equip/ground)
    F  Fuel your lantern from inv/ground
    The following example (for 'k' - destroy item) shows some common features.
    (Inven: a-c, / for Equip, - for floor, ! for squelched, ESC) Destroy which item?
                                    a) 3 Rations of food
                                    b) a Grey Potion of Slime Mold Juice
                                    c) 3 Wooden Torches (5000 turns)
    'a-c' is the range of inventory items, '/' switches to the equipment list,
    - shows items on the floor, ! shows squelched items, ESC to cancel.
    Last edited by PaulBlay; February 20, 2009, 16:48. Reason: Command already existed (sort of)
    Currently turning (Angband) Japanese.
  • PaulBlay
    Knight
    • Jan 2009
    • 657

    #2
    Whoo! I implemented this, compiled it and it actually worked!

    Files altered:

    .\lib\help\help.hlp (Link to new help file)
    .\lib\help\invent.txt (New help file)
    .\src\cmd3.c (Add local help handling)
    Currently turning (Angband) Japanese.

    Comment

    • Pete Mack
      Prophet
      • Apr 2007
      • 6883

      #3
      Did you use the menus from cmd0.c? If not, you are probably duplicating functionality. (The point isn't that duplication is bad necessarily, but that if you ever want to add an inventory command, you will need to modify cmd3.c as well as cmd0.c. That is how "code [gets] all spread to hell and gone."

      Comment

      • PaulBlay
        Knight
        • Jan 2009
        • 657

        #4
        Originally posted by Pete Mack
        Did you use the menus from cmd0.c? If not, you are probably duplicating functionality. (The point isn't that duplication is bad necessarily, but that if you ever want to add an inventory command, you will need to modify cmd3.c as well as cmd0.c. That is how "code [gets] all spread to hell and gone."
        Hey, I said 'heck'.

        It's handled within the display inventory / display equipment functions. It's probably a bit of a hack but you can see for yourself.

        Code:
        	/* PTB */ 
        	/* Process '?' */
        	if (p_ptr->command_new == '?')
        	{
        		p_ptr->command_new = 0; 
        
        		/* Show help screen */
        		/* Save screen */
        		screen_save(); 
        
        		/* Peruse the invent/equip help file */
        		(void)show_file("invent.txt", NULL, 0, 0);
        
        		/* Load screen */
        		screen_load();
        	}
        	/* Hack -- Process "Escape" */
        	else if (p_ptr->command_new == ESCAPE) /* PTB END */
        The local store help is handled entirely within store.c so I don't see it's much different to that.
        Currently turning (Angband) Japanese.

        Comment

        • Pete Mack
          Prophet
          • Apr 2007
          • 6883

          #5
          Got it. I hadn't quite understood what you were doing. What you've got looks good, just put a comment in cmd0.c that invent.txt needs to be kept in sync.

          Comment

          • PaulBlay
            Knight
            • Jan 2009
            • 657

            #6
            Could a moderator move this to the Development forum?
            Currently turning (Angband) Japanese.

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎