OSDN Git Service

Merge pull request #3569 from sikabane-works/release/3.0.0.88-alpha
[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 <optional>
6 #include <string>
7
8 extern concptr keymap_act[KEYMAP_MODES][256];
9
10 extern bool use_menu;
11
12 extern COMMAND_CODE command_cmd;
13 extern COMMAND_ARG command_arg;
14 extern short command_rep;
15 extern DIRECTION command_dir;
16 extern int16_t command_see;
17 extern TERM_LEN command_gap;
18 extern int16_t command_wrk;
19 extern int16_t command_new;
20
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 process_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(const std::optional<std::string> &inscription, 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 };