Angband
Macros | Enumerations | Functions | Variables
ui-context.c File Reference

Show player and terrain context menus. More...

#include "angband.h"
#include "cave.h"
#include "cmd-core.h"
#include "cmds.h"
#include "game-input.h"
#include "mon-desc.h"
#include "mon-lore.h"
#include "mon-util.h"
#include "obj-chest.h"
#include "obj-desc.h"
#include "obj-gear.h"
#include "obj-ignore.h"
#include "obj-info.h"
#include "obj-tval.h"
#include "obj-util.h"
#include "player-calcs.h"
#include "player-timed.h"
#include "player-util.h"
#include "store.h"
#include "target.h"
#include "ui-context.h"
#include "ui-game.h"
#include "ui-input.h"
#include "ui-keymap.h"
#include "ui-knowledge.h"
#include "ui-menu.h"
#include "ui-mon-lore.h"
#include "ui-object.h"
#include "ui-player.h"
#include "ui-spell.h"
#include "ui-store.h"
#include "ui-target.h"
#include "wizard.h"

Macros

#define ADD_LABEL(text, cmd, valid)
 

Enumerations

enum  context_menu_value_e {
  MENU_VALUE_INSPECT = CMD_REPEAT + 1000, MENU_VALUE_DROP_ALL, MENU_VALUE_LOOK, MENU_VALUE_RECALL,
  MENU_VALUE_REST, MENU_VALUE_INVENTORY, MENU_VALUE_CENTER_MAP, MENU_VALUE_FLOOR,
  MENU_VALUE_CHARACTER, MENU_VALUE_OTHER, MENU_VALUE_KNOWLEDGE, MENU_VALUE_MAP,
  MENU_VALUE_MESSAGES, MENU_VALUE_OBJECTS, MENU_VALUE_MONSTERS, MENU_VALUE_TOGGLE_IGNORED,
  MENU_VALUE_OPTIONS, MENU_VALUE_HELP
}
 Additional constants for menu item values. More...
 

Functions

static int context_menu_player_2 (int mx, int my)
 
static void context_menu_player_display_floor (void)
 
int context_menu_player (int mx, int my)
 
int context_menu_cave (struct chunk *c, int y, int x, int adjacent, int mx, int my)
 
int context_menu_object (struct object *obj)
 Pick the context menu options appropiate for the item. More...
 
static int show_command_list (struct cmd_info cmd_list[], int size, int mx, int my)
 
int context_menu_command (int mx, int my)
 
void textui_process_click (ui_event e)
 Handle a textui mouseclick. More...
 
static void cmd_sub_entry (struct menu *menu, int oid, bool cursor, int row, int col, int width)
 

Menu functions

More...
 
static bool cmd_menu (struct command_list *list, void *selection_p)
 Display a list of commands. More...
 
static bool cmd_list_action (struct menu *m, const ui_event *event, int oid)
 
static void cmd_list_entry (struct menu *menu, int oid, bool cursor, int row, int col, int width)
 
struct cmd_infotextui_action_menu_choose (void)
 Display a list of command types, allowing the user to select one. More...
 

Variables

static struct menucommand_menu
 
static menu_iter command_menu_iter
 

Detailed Description

Show player and terrain context menus.

Copyright (c) 2011 Brett Reid

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 license": 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.

Macro Definition Documentation

#define ADD_LABEL (   text,
  cmd,
  valid 
)
Value:
{ \
cmdkey = cmd_lookup_key_unktrl((cmd), mode); \
menu_dynamic_add_label_valid(m, (text), cmdkey, (cmd), labels, (valid)); \
}
void menu_dynamic_add_label_valid(struct menu *m, const char *text, const char label, int value, char *label_list, menu_row_validity_t valid)
Definition: ui-menu.c:1069
unsigned char cmd_lookup_key_unktrl(cmd_code lookup_cmd, int mode)
Definition: ui-game.c:251
const char * text
Definition: player-attack.c:281

Referenced by context_menu_cave(), context_menu_object(), context_menu_player(), and context_menu_player_2().

Enumeration Type Documentation

Additional constants for menu item values.

The values must not collide with the cmd_code enum, since those are the main values for these menu items.

Enumerator
MENU_VALUE_INSPECT 
MENU_VALUE_DROP_ALL 
MENU_VALUE_LOOK 
MENU_VALUE_RECALL 
MENU_VALUE_REST 
MENU_VALUE_INVENTORY 
MENU_VALUE_CENTER_MAP 
MENU_VALUE_FLOOR 
MENU_VALUE_CHARACTER 
MENU_VALUE_OTHER 
MENU_VALUE_KNOWLEDGE 
MENU_VALUE_MAP 
MENU_VALUE_MESSAGES 
MENU_VALUE_OBJECTS 
MENU_VALUE_MONSTERS 
MENU_VALUE_TOGGLE_IGNORED 
MENU_VALUE_OPTIONS 
MENU_VALUE_HELP 

Function Documentation

static bool cmd_list_action ( struct menu m,
const ui_event event,
int  oid 
)
static
static void cmd_list_entry ( struct menu menu,
int  oid,
bool  cursor,
int  row,
int  col,
int  width 
)
static
static bool cmd_menu ( struct command_list list,
void selection_p 
)
static
static void cmd_sub_entry ( struct menu menu,
int  oid,
bool  cursor,
int  row,
int  col,
int  width 
)
static
int context_menu_cave ( struct chunk c,
int  y,
int  x,
int  adjacent,
int  mx,
int  my 
)
int context_menu_command ( int  mx,
int  my 
)
int context_menu_object ( struct object obj)

Pick the context menu options appropiate for the item.

References ADD_LABEL, area, bell(), player::body, cave, CMD_ACTIVATE, CMD_BROWSE_SPELL, CMD_CAST, CMD_DROP, CMD_EAT, CMD_FIRE, CMD_IGNORE, CMD_INSCRIBE, cmd_lookup_key(), CMD_PICKUP, CMD_QUAFF, CMD_READ_SCROLL, CMD_REFILL, CMD_SELL, cmd_set_arg_item(), cmd_set_arg_number(), CMD_STASH, CMD_STUDY, CMD_TAKEOFF, CMD_THROW, CMD_UNINSCRIBE, CMD_USE, CMD_USE_ROD, CMD_USE_STAFF, CMD_USE_WAND, CMD_WIELD, cmdq_peek(), cmdq_push(), command::code, region::col, menu::count, format(), get_check(), get_item_allow(), header, int, inven_carry_okay(), key_confirm_command(), KEYMAP_MODE_ORIG, KEYMAP_MODE_ROGUE, lower_case, menu_dynamic_add_label(), menu_dynamic_free(), menu_dynamic_longest_entry(), menu_dynamic_new(), menu_dynamic_select(), menu_layout(), MENU_VALUE_DROP_ALL, MENU_VALUE_INSPECT, MN_ROW_INVALID, MN_ROW_VALID, msg_flag, object::number, obj_can_activate(), obj_can_browse(), obj_can_cast_from(), obj_can_fire(), obj_can_refill(), obj_can_study(), obj_can_takeoff(), obj_can_wear(), obj_can_zap(), obj_has_charges(), obj_has_inscrip(), obj_is_activatable(), obj_is_useable(), object_desc(), object_info(), object_is_carried(), object_is_equipped(), object_is_ignored(), ODESC_BASE, ODESC_FULL, ODESC_PREFIX, OINFO_NONE, OPT, region::page_rows, player_can_cast(), player_can_read(), player_can_study(), prt(), player::px, player::py, region_erase_bordered(), region::row, screen_load(), screen_save(), menu::selections, square_isshop(), square_shopnum(), STORE_HOME, store_will_buy_tester(), string_free(), string_make(), Term, textblock_free(), textui_book_browse(), textui_cmd_ignore_menu(), textui_textblock_place(), textui_textblock_show(), tval_is_edible(), tval_is_potion(), tval_is_rod(), tval_is_scroll(), tval_is_staff(), tval_is_wand(), term::wid, and region::width.

Referenced by context_menu_player_display_floor(), do_cmd_equip(), do_cmd_inven(), and do_cmd_quiver().

int context_menu_player ( int  mx,
int  my 
)
static int context_menu_player_2 ( int  mx,
int  my 
)
static
static void context_menu_player_display_floor ( void  )
static
static int show_command_list ( struct cmd_info  cmd_list[],
int  size,
int  mx,
int  my 
)
static
struct cmd_info* textui_action_menu_choose ( void  )

Display a list of command types, allowing the user to select one.

References area, cmds_all, menu_layout(), menu_new(), menu_select(), menu_setpriv(), MN_SKIN_SCROLL, NULL, screen_load(), screen_save(), and window_make().

Referenced by textui_process_command().

void textui_process_click ( ui_event  e)

Variable Documentation

struct menu* command_menu
static
menu_iter command_menu_iter
static
Initial value:
=
{
NULL
}
static void cmd_list_entry(struct menu *menu, int oid, bool cursor, int row, int col, int width)
Definition: ui-context.c:1180
static bool cmd_list_action(struct menu *m, const ui_event *event, int oid)
Definition: ui-context.c:1172
NULL
Definition: list-summon-types.h:18