Angband
game-input.h
Go to the documentation of this file.
1 
19 #ifndef INCLUDED_GAME_INPUT_H
20 #define INCLUDED_GAME_INPUT_H
21 
22 #include "cmd-core.h"
23 
27 #define USE_EQUIP 0x0001 /* Allow equip items */
28 #define USE_INVEN 0x0002 /* Allow inven items */
29 #define USE_FLOOR 0x0004 /* Allow quiver items */
30 #define USE_QUIVER 0x0008 /* Allow floor items */
31 #define IS_HARMLESS 0x0010 /* Ignore generic warning inscriptions */
32 #define SHOW_PRICES 0x0020 /* Show item prices in item lists */
33 #define SHOW_FAIL 0x0040 /* Show device failure in item lists */
34 #define SHOW_QUIVER 0x0080 /* Show quiver summary when in inventory */
35 #define SHOW_EMPTY 0x0100 /* Show empty slots in equipment display */
36 #define QUIVER_TAGS 0x0200 /* 0-9 are quiver slots when selecting */
37 
38 
39 extern bool (*get_string_hook)(const char *prompt, char *buf, size_t len);
40 extern int (*get_quantity_hook)(const char *prompt, int max);
41 extern bool (*get_check_hook)(const char *prompt);
42 extern bool (*get_com_hook)(const char *prompt, char *command);
43 extern bool (*get_rep_dir_hook)(int *dir, bool allow_none);
44 extern bool (*get_aim_dir_hook)(int *dir);
45 extern int (*get_spell_from_book_hook)(const char *verb, struct object *book,
46  const char *error,
47  bool (*spell_filter)(int spell));
48 extern int (*get_spell_hook)(const char *verb, item_tester book_filter,
49  cmd_code cmd,
50  const char *error,
51  bool (*spell_filter)(int spell));
52 extern bool (*get_item_hook)(struct object **choice, const char *pmt,
53  const char *str, cmd_code cmd, item_tester tester,
54  int mode);
55 extern bool (*get_curse_hook)(int *choice, struct object *obj);
56 extern void (*get_panel_hook)(int *min_y, int *min_x, int *max_y, int *max_x);
57 extern bool (*panel_contains_hook)(unsigned int y, unsigned int x);
58 extern bool (*map_is_visible_hook)(void);
59 
60 bool get_string(const char *prompt, char *buf, size_t len);
61 int get_quantity(const char *prompt, int max);
62 bool get_check(const char *prompt);
63 bool get_com(const char *prompt, char *command);
64 bool get_rep_dir(int *dir, bool allow_none);
65 bool get_aim_dir(int *dir);
66 int get_spell_from_book(const char *verb, struct object *book,
67  const char *error, bool (*spell_filter)(int spell));
68 int get_spell(const char *verb, item_tester book_filter, cmd_code cmd,
69  const char *error, bool (*spell_filter)(int spell));
70 bool get_item(struct object **choice, const char *pmt, const char *str,
71  cmd_code cmd, item_tester tester, int mode);
72 bool get_curse(int *choice, struct object *obj);
73 void get_panel(int *min_y, int *min_x, int *max_y, int *max_x);
74 bool panel_contains(unsigned int y, unsigned int x);
75 bool map_is_visible(void);
76 
77 #endif /* INCLUDED_GAME_INPUT_H */
bool(* get_string_hook)(const char *prompt, char *buf, size_t len)
Definition: game-input.c:23
bool(* panel_contains_hook)(unsigned int y, unsigned int x)
Definition: game-input.c:38
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
int get_spell_from_book(const char *verb, struct object *book, const char *error, bool(*spell_filter)(int spell))
Get a spell from a specified book.
Definition: game-input.c:143
void get_panel(int *min_y, int *min_x, int *max_y, int *max_x)
Get the borders of the area the player can see (the "panel")
Definition: game-input.c:207
int(* get_spell_hook)(const char *verb, item_tester book_filter, cmd_code cmd, const char *error, bool(*spell_filter)(int spell))
Definition: game-input.c:32
int get_spell(const char *verb, item_tester book_filter, cmd_code cmd, const char *error, bool(*spell_filter)(int spell))
Get a spell from the player.
Definition: game-input.c:156
The struct command type is used to return details of the command the game should carry out...
Definition: cmd-core.h:188
bool get_curse(int *choice, struct object *obj)
Get a curse from an object.
Definition: game-input.c:195
bool(* get_rep_dir_hook)(int *dir, bool allow_none)
Definition: game-input.c:27
typedef int
Definition: libpng12/png.h:1135
void(* get_panel_hook)(int *min_y, int *min_x, int *max_y, int *max_x)
Definition: game-input.c:37
bool get_string(const char *prompt, char *buf, size_t len)
Prompt for a string from the user.
Definition: game-input.c:49
bool(* item_tester)(const struct object *)
Definition: object.h:507
bool(* get_aim_dir_hook)(int *dir)
Definition: game-input.c:28
static const char * prompt
Definition: ui-object.c:574
bool(* get_curse_hook)(int *choice, struct object *obj)
Definition: game-input.c:36
Object information, for a specific object.
Definition: object.h:393
bool get_com(const char *prompt, char *command)
Prompts for a keypress.
Definition: game-input.c:99
png_bytep buf
Definition: libpng12/png.h:2815
Handles the queueing of game commands.
bool(* map_is_visible_hook)(void)
Definition: game-input.c:39
bool map_is_visible(void)
Check to see if the map is currently shown.
Definition: game-input.c:229
int get_quantity(const char *prompt, int max)
Request a quantity from the user.
Definition: game-input.c:65
bool(* get_item_hook)(struct object **choice, const char *pmt, const char *str, cmd_code cmd, item_tester tester, int mode)
Definition: game-input.c:34
cmd_code
All valid game commands.
Definition: cmd-core.h:29
bool(* get_com_hook)(const char *prompt, char *command)
Definition: game-input.c:26
bool get_rep_dir(int *dir, bool allow_none)
Request a "movement" direction from the user.
Definition: game-input.c:116
bool get_aim_dir(int *dir)
Get an "aiming" direction from the user.
Definition: game-input.c:131
bool(* get_check_hook)(const char *prompt)
Definition: game-input.c:25
bool 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.
Definition: game-input.c:182
bool get_check(const char *prompt)
Verify something with the user.
Definition: game-input.c:83
int(* get_spell_from_book_hook)(const char *verb, struct object *book, const char *error, bool(*spell_filter)(int spell))
Definition: game-input.c:29
int(* get_quantity_hook)(const char *prompt, int max)
Definition: game-input.c:24
bool panel_contains(unsigned int y, unsigned int x)
Check to see if a map grid is in the panel.
Definition: game-input.c:217