OSDN Git Service

[Refactor] #2221 confirm_command() の引数を調整した
[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 #include <string_view>
8
9 extern concptr keymap_act[KEYMAP_MODES][256];
10
11 extern bool use_menu;
12
13 extern COMMAND_CODE command_cmd;
14 extern COMMAND_ARG command_arg;
15 extern short command_rep;
16 extern DIRECTION command_dir;
17 extern int16_t command_see;
18 extern TERM_LEN command_gap;
19 extern int16_t command_wrk;
20 extern int16_t command_new;
21
22 class PlayerType;
23 class SpecialMenuContent;
24 class InputKeyRequestor {
25 public:
26     InputKeyRequestor(PlayerType *player_ptr, bool shopping);
27     void request_command();
28
29 private:
30     PlayerType *player_ptr;
31     bool shopping;
32     keymap_mode mode;
33     int base_y;
34     int base_x = 15;
35     int menu_num = 0;
36     int num = 0;
37     char command = 0;
38     int max_num = 0;
39     bool is_max_num_odd = false;
40     char sub_cmd = 0;
41
42     void input_command();
43     short get_command();
44     char inkey_from_menu();
45     bool process_repeat_num(short &cmd);
46     char input_repeat_num();
47     void process_command_command(short &cmd);
48     void process_control_command(short &cmd);
49     void change_shopping_command();
50     int get_caret_command();
51     void sweep_confirmation_equipments();
52     void confirm_command(std::optional<std::string_view> inscription, const int caret_command);
53
54     void make_commands_frame();
55     std::string switch_special_menu_condition(const SpecialMenuContent &special_menu);
56     int get_command_per_menu_num();
57     bool check_continuous_command();
58     bool check_escape_key(const int old_num);
59     bool process_down_cursor();
60     bool process_up_cursor();
61     void process_right_left_cursor();
62 };