OSDN Git Service

Merge pull request #2301 from habu1010/feature/check-source-format-on-buildtest-workflow
[hengbandforosx/hengbandosx.git] / src / io / input-key-requester.h
1 #pragma once
2
3 #include "game-option/keymap-directory-getter.h"
4 #include "system/angband.h"
5 #include <string>
6
7 extern concptr keymap_act[KEYMAP_MODES][256];
8
9 extern bool use_menu;
10
11 extern COMMAND_CODE command_cmd;
12 extern COMMAND_ARG command_arg;
13 extern short command_rep;
14 extern DIRECTION command_dir;
15 extern int16_t command_see;
16 extern TERM_LEN command_gap;
17 extern int16_t command_wrk;
18 extern int16_t command_new;
19
20 class ObjectType;
21 class PlayerType;
22 class SpecialMenuContent;
23 class InputKeyRequestor {
24 public:
25     InputKeyRequestor(PlayerType *player_ptr, bool shopping);
26     void request_command();
27
28 private:
29     PlayerType *player_ptr;
30     bool shopping;
31     keymap_mode mode;
32     int base_y;
33     int base_x = 15;
34     int menu_num = 0;
35     int num = 0;
36     char command = 0;
37     int max_num = 0;
38     bool is_max_num_odd = false;
39     char sub_cmd = 0;
40
41     void input_command();
42     short get_command();
43     char inkey_from_menu();
44     bool process_repeat_num(short &cmd);
45     char input_repeat_num();
46     void process_command_command(short &cmd);
47     void process_control_command(short &cmd);
48     void change_shopping_command();
49     int get_caret_command();
50     void sweep_confirmation_equipments();
51     void confirm_command(ObjectType &o_ref, const int caret_command);
52
53     void make_commands_frame();
54     std::string switch_special_menu_condition(const SpecialMenuContent &special_menu);
55     int get_command_per_menu_num();
56     bool check_continuous_command();
57     bool check_escape_key(const int old_num);
58     bool process_down_cursor();
59     bool process_up_cursor();
60     void process_right_left_cursor();
61 };