Angband
Enumerations | Functions
ui-obj.h File Reference

lists of objects and object pictures More...

#include "cmd-core.h"

Go to the source code of this file.

Enumerations

enum  olist_detail_t {
  OLIST_NONE = 0x00, OLIST_WINDOW = 0x01, OLIST_QUIVER = 0x02, OLIST_GOLD = 0x04,
  OLIST_WEIGHT = 0x08, OLIST_PRICE = 0x10, OLIST_FAIL = 0x20, OLIST_SEMPTY = 0x40
}
 Modes for item lists in "show_inven()" "show_equip()" and "show_floor()". More...

Functions

byte object_kind_attr (const struct object_kind *kind)
 Return the "attr" for a given item kind.
wchar_t object_kind_char (const struct object_kind *kind)
 Return the "char" for a given item kind.
byte object_attr (const struct object *o_ptr)
 Return the "attr" for a given item.
wchar_t object_char (const struct object *o_ptr)
 Return the "char" for a given item.
void show_inven (int mode, item_tester tester)
 Display the inventory.
void show_equip (int mode, item_tester tester)
 Display the equipment.
void show_floor (struct object **floor_list, int floor_num, int mode, item_tester tester)
 Display the floor.
bool textui_get_item (struct object **choice, const char *pmt, const char *str, cmd_code cmd, item_tester tester, int mode)
 Let the user select an object, save its address.
bool get_item_allow (const struct object *obj, unsigned char ch, cmd_code cmd, bool is_harmless)
 Prevent certain choices depending on the inscriptions on the item.
void display_object_recall (struct object *obj)
 This draws the Object Recall subwindow when displaying a particular object (e.g.
void display_object_kind_recall (struct object_kind *kind)
 This draws the Object Recall subwindow when displaying a recalled item kind (e.g.
void display_object_recall_interactive (object_type *o_ptr)
 Display object recall modally and wait for a keypress.

Detailed Description

lists of objects and object pictures

Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Enumeration Type Documentation

Modes for item lists in "show_inven()" "show_equip()" and "show_floor()".

Enumerator:
OLIST_NONE 
OLIST_WINDOW 
OLIST_QUIVER 
OLIST_GOLD 
OLIST_WEIGHT 
OLIST_PRICE 
OLIST_FAIL 
OLIST_SEMPTY 

Function Documentation

void display_object_kind_recall ( struct object_kind kind)

This draws the Object Recall subwindow when displaying a recalled item kind (e.g.

a generic ring of acid or a generic blade of chaos)

References object_kind::aware, display_object_recall(), EXTREMIFY, object_notice_everything(), and object_prep().

Referenced by update_object_subwindow().

void display_object_recall ( struct object o_ptr)

This draws the Object Recall subwindow when displaying a particular object (e.g.

a helmet in the backpack, or a scroll on the ground)

References clear_from(), object_desc(), object_info(), ODESC_FULL, ODESC_PREFIX, OINFO_NONE, SCREEN_REGION, textblock_free(), and textui_textblock_place().

Referenced by display_object_kind_recall(), and update_object_subwindow().

void display_object_recall_interactive ( struct object o_ptr)

Display object recall modally and wait for a keypress.

This is set up for use in look mode (see target_set_interactive_aux()).

Parameters
o_ptris the object to be described.

References EVENT_MESSAGE_FLUSH, event_signal(), object_desc(), object_info(), ODESC_FULL, ODESC_PREFIX, OINFO_NONE, SCREEN_REGION, textblock_free(), and textui_textblock_show().

Referenced by target_recall_loop_object().

bool get_item_allow ( const struct object obj,
unsigned char  ch,
cmd_code  cmd,
bool  is_harmless 
)

Prevent certain choices depending on the inscriptions on the item.

The item can be negative to mean "item on floor".

References check_for_inscrip(), cmd_verb(), FALSE, strnfmt(), TRUE, UN_KTRL, and verify_object().

Referenced by context_menu_object(), and textui_get_item().

byte object_attr ( const struct object o_ptr)

Return the "attr" for a given item.

Use "flavor" if available. Default to user definitions.

References object::kind, and object_kind_attr().

Referenced by display_missile(), display_player_equippy(), and prt_equippy().

wchar_t object_char ( const struct object o_ptr)

Return the "char" for a given item.

Use "flavor" if available. Default to user definitions.

References object::kind, and object_kind_char().

Referenced by display_missile(), display_player_equippy(), and prt_equippy().

byte object_kind_attr ( const struct object_kind kind)

Return the "attr" for a given item kind.

Use "flavor" if available. Default to user definitions.

References flavor::fidx, object_kind::flavor, flavor_x_attr, object_kind::kidx, kind_x_attr, and use_flavor_glyph().

Referenced by display_object(), grid_data_as_text(), object_attr(), and object_list_format_section().

wchar_t object_kind_char ( const struct object_kind kind)

Return the "char" for a given item kind.

Use "flavor" if available. Default to user definitions.

References flavor::fidx, object_kind::flavor, flavor_x_char, object_kind::kidx, kind_x_char, and use_flavor_glyph().

Referenced by display_object(), grid_data_as_text(), object_char(), and object_list_format_section().

void show_equip ( int  mode,
item_tester  tester 
)
void show_floor ( struct object **  floor_list,
int  floor_num,
int  mode,
item_tester  tester 
)

Display the floor.

Builds a list of objects and passes them off to show_obj_list() for display. Mode flags documented in object.h

References angband_constants::floor_size, i, I2A, object_test(), OLIST_GOLD, show_obj_list(), strnfmt(), tval_is_money(), and z_info.

Referenced by see_floor_items(), target_set_interactive_aux(), and textui_get_item().

void show_inven ( int  mode,
item_tester  tester 
)
bool textui_get_item ( struct object **  choice,
const char *  pmt,
const char *  str,
cmd_code  cmd,
item_tester  tester,
int  mode 
)

Let the user select an object, save its address.

Return TRUE only if an acceptable item was chosen by the user.

The user is allowed to choose acceptable items from the equipment, inventory, quiver, or floor, respectively, if the proper flag was given, and there are any acceptable items in that location.

The equipment, inventory or quiver are displayed (even if no acceptable items are in that location) if the proper flag was given.

If there are no acceptable items available anywhere, and "str" is not NULL, then it will be used as the text of a warning message before the function returns.

Note that the user must press "-" to specify the item on the floor, and there is no way to "examine" the item on the floor, while the use of "capital" letters will "examine" an inventory/equipment item, and prompt for its use.

If a legal item is selected , we save it in "obj" and return TRUE.

If no item is available, we do nothing to "obj", and we display a warning message, using "str" if available, and return FALSE.

If no item is selected, we do nothing to "obj", and return FALSE.

Global "player->upkeep->command_wrk" is used to choose between equip/inven/quiver/floor listings. It is equal to USE_INVEN or USE_EQUIP or USE_QUIVER or USE_FLOOR, except when this function is first called, when it is equal to zero, which will cause it to be set to USE_INVEN.

We always erase the prompt when we are done, leaving a blank line, or a warning message, if appropriate, if no items are available.

Note that only "acceptable" floor objects get indexes, so between two commands, the indexes of floor objects may change. XXX XXX XXX

References A2I, angband_term, ANGBAND_TERM_MAX, bell(), player::body, mouseclick::button, cmd_lookup_key(), keypress::code, player_upkeep::command_wrk, player_body::count, ESCAPE, EVENT_MESSAGE_FLUSH, event_signal(), EVT_MOUSE, FALSE, angband_constants::floor_size, get_item_allow(), get_tag(), I2A, inkey_m(), player_upkeep::inven, IS_HARMLESS, KC_ENTER, ui_event::key, KEYMAP_MODE_ORIG, KEYMAP_MODE_ROGUE, label_to_equip(), label_to_inven(), label_to_quiver(), mem_free(), mem_zalloc(), ui_event::mouse, msg, my_strcat(), object_test(), OLIST_FAIL, OLIST_PRICE, OLIST_QUIVER, OLIST_SEMPTY, OLIST_WEIGHT, OPT, angband_constants::pack_size, PR_EQUIP, PR_INVEN, prt(), PW_EQUIP, PW_INVEN, player::px, player::py, player_upkeep::quiver, angband_constants::quiver_size, QUIVER_TAGS, player_upkeep::redraw, redraw_stuff(), scan_floor(), screen_load(), screen_save(), SHOW_EMPTY, show_equip(), SHOW_FAIL, show_floor(), show_inven(), SHOW_PRICES, SHOW_QUIVER, show_quiver(), slot_object(), strnfmt(), toggle_inven_equip(), TRUE, ui_event::type, UN_KTRL, player::upkeep, USE_EQUIP, USE_FLOOR, USE_INVEN, USE_QUIVER, verify_object(), window_flag, mouseclick::y, and z_info.

Referenced by textui_input_init().