Angband
Enumerations | Functions
ui-object.h File Reference
#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,
  OLIST_DEATH = 0x80
}
 Modes for item lists in show_inven(), show_equip(), show_quiver() and show_floor() More...
 

Functions

byte object_kind_attr (const struct object_kind *kind)
 Return the "attr" for a given item kind. More...
 
wchar_t object_kind_char (const struct object_kind *kind)
 Return the "char" for a given item kind. More...
 
byte object_attr (const struct object *obj)
 Return the "attr" for a given item. More...
 
wchar_t object_char (const struct object *obj)
 Return the "char" for a given item. More...
 
void show_inven (int mode, item_tester tester)
 Display the inventory. More...
 
void show_equip (int mode, item_tester tester)
 Display the equipment. More...
 
void show_quiver (int mode, item_tester tester)
 Display the quiver. More...
 
void show_floor (struct object **floor_list, int floor_num, int mode, item_tester tester)
 Display the floor. More...
 
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. More...
 
bool get_item_allow (const struct object *obj, unsigned char ch, cmd_code cmd, bool is_harmless)
 

Object selection utilities

More...
 
void display_object_recall (struct object *obj)
 

Object recall

More...
 
void display_object_kind_recall (struct object_kind *kind)
 This draws the Object Recall subwindow when displaying a recalled item kind (e.g. More...
 
void display_object_recall_interactive (struct object *obj)
 Display object recall modally and wait for a keypress. More...
 
void textui_obj_examine (void)
 Examine an object. More...
 
void textui_cmd_ignore_menu (struct object *obj)
 
void textui_cmd_ignore (void)
 
void textui_cmd_toggle_ignore (void)
 

Enumeration Type Documentation

◆ olist_detail_t

Modes for item lists in show_inven(), show_equip(), show_quiver() and show_floor()

Enumerator
OLIST_NONE 
OLIST_WINDOW 
OLIST_QUIVER 
OLIST_GOLD 
OLIST_WEIGHT 
OLIST_PRICE 
OLIST_FAIL 
OLIST_SEMPTY 
OLIST_DEATH 

Function Documentation

◆ display_object_kind_recall()

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 display_object_recall(), EXTREMIFY, OBJECT_NULL, and object_prep().

Referenced by update_object_subwindow().

◆ display_object_recall()

void display_object_recall ( struct object obj)


Object recall

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().

◆ display_object_recall_interactive()

void display_object_recall_interactive ( struct object obj)

Display object recall modally and wait for a keypress.

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

Parameters
objis 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().

◆ get_item_allow()

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


Object selection utilities

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(), strnfmt(), UN_KTRL, and verify_object().

Referenced by context_menu_object(), and get_item_action().

◆ object_attr()

byte object_attr ( const struct object obj)

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().

◆ object_char()

wchar_t object_char ( const struct object obj)

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().

◆ object_kind_attr()

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().

◆ object_kind_char()

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().

◆ show_equip()

void show_equip ( int  mode,
item_tester  tester 
)

◆ show_floor()

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 build_obj_list(), angband_constants::floor_size, num_head, show_obj_list(), wipe_obj_list(), and z_info.

Referenced by see_floor_items(), and target_set_interactive_aux().

◆ show_inven()

void show_inven ( int  mode,
item_tester  tester 
)

◆ show_quiver()

void show_quiver ( int  mode,
item_tester  tester 
)

Display the quiver.

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

References build_obj_list(), i, NULL, num_head, player_upkeep::quiver, angband_constants::quiver_size, show_obj_list(), player::upkeep, wipe_obj_list(), and z_info.

Referenced by death_info().

◆ textui_cmd_ignore()

void textui_cmd_ignore ( void  )

◆ textui_cmd_ignore_menu()

void textui_cmd_ignore_menu ( struct object obj)

◆ textui_cmd_toggle_ignore()

void textui_cmd_toggle_ignore ( void  )

◆ textui_get_item()

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.

If a legal item is selected , we save it in "choice" and return true.

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

If no item is selected, we do nothing to "choice", 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 allow_all, angband_term, ANGBAND_TERM_MAX, player::body, build_obj_list(), CMD_NULL, player_upkeep::command_wrk, player_body::count, e1, e2, EVENT_MESSAGE_FLUSH, event_signal(), f1, f2, false, angband_constants::floor_size, header, i1, i2, player_upkeep::inven, item_cmd, item_menu(), item_mode, MAX, mem_free(), mem_zalloc(), menu_header(), msg, newmenu, NULL, object_test(), OFLOOR_SENSE, OFLOOR_TEST, OFLOOR_VISIBLE, OLIST_FAIL, olist_mode, OLIST_PRICE, OLIST_QUIVER, OLIST_SEMPTY, OLIST_WEIGHT, angband_constants::pack_size, PR_EQUIP, PR_INVEN, prompt, prt(), PW_EQUIP, PW_INVEN, q1, q2, player_upkeep::quiver, angband_constants::quiver_size, QUIVER_TAGS, player_upkeep::redraw, redraw_stuff(), scan_floor(), screen_load(), screen_save(), SHOW_EMPTY, SHOW_FAIL, SHOW_PRICES, SHOW_QUIVER, slot_object(), tester_m, toggle_inven_equip(), true, player::upkeep, USE_EQUIP, USE_FLOOR, USE_INVEN, USE_QUIVER, window_flag, wipe_obj_list(), and z_info.

Referenced by textui_input_init().

◆ textui_obj_examine()

void textui_obj_examine ( void  )