Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 20, 2009, 12:03   #1
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
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 at 16:48. Reason: Command already existed (sort of)
PaulBlay is offline   Reply With Quote
Old February 20, 2009, 16:48   #2
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
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)
PaulBlay is offline   Reply With Quote
Old February 20, 2009, 21:58   #3
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,014
Donated: $40
Pete Mack is on a distinguished road
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."
Pete Mack is offline   Reply With Quote
Old February 20, 2009, 22:19   #4
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
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.
PaulBlay is offline   Reply With Quote
Old February 20, 2009, 22:28   #5
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,014
Donated: $40
Pete Mack is on a distinguished road
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.
Pete Mack is offline   Reply With Quote
Old March 1, 2009, 09:03   #6
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
Could a moderator move this to the Development forum?
__________________
Currently turning (Angband) Japanese.
PaulBlay is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Proposed inventory changes! Comments please! Orillian Vanilla 13 February 11, 2009 22:03
Elemental attacks destroying inventory items - challenging or frustrating? hugorune Vanilla 24 January 28, 2009 09:23
Vendor suggestion Zikke Vanilla 2 January 12, 2009 22:39
inventory management newb question Halloween Jack Vanilla 16 October 30, 2007 14:14
Command Menu Suggestion arcum42 Vanilla 1 August 3, 2007 15:54


All times are GMT +1. The time now is 18:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.