OSDN Git Service

Merge pull request #3569 from sikabane-works/release/3.0.0.88-alpha
[hengbandforosx/hengbandosx.git] / src / autopick / autopick-menu-data-table.cpp
1 /*!
2  * @brief 自動拾いのユーティリティ
3  * @date 2020/04/25
4  * @author Hourier
5  */
6
7 #include "autopick/autopick-menu-data-table.h"
8 #include "autopick/autopick-commands-table.h"
9 #include "autopick/autopick-keys-table.h"
10 #include "util/int-char-converter.h"
11
12 /*
13  * These MN_* preprocessor macros were formerly defined in
14  * autopick-editor-table.h.  Fold them in here to satisfy two requirements:
15  * 1) The platforms using configure/automake only preprocess .c files (.h
16  * files are not touched) with nkf to modify the encoding of Japanese
17  * characters.
18  * 2) The file scope initializer for menu_data requires constant expressions
19  * that can be evaluated at compile time.
20  */
21 #define MN_QUIT _("セーブ無しで終了", "Quit without save")
22 #define MN_SAVEQUIT _("セーブして終了", "Save & Quit")
23 #define MN_REVERT _("全ての変更を破棄", "Revert all changes")
24 #define MN_HELP _("ヘルプ", "Help")
25
26 #define MN_MOVE _("カーソル移動", "Move cursor")
27 #define MN_LEFT _("左          (←矢印キー)", "Left     (Left Arrow key)")
28 #define MN_DOWN _("下          (↓矢印キー)", "Down     (Down Arrow key)")
29 #define MN_UP _("上          (↑矢印キー)", "Up       (Up Arrow key)")
30 #define MN_RIGHT _("右          (→矢印キー)", "Right    (Right Arrow key)")
31 #define MN_BOL _("行の先頭", "Beginning of line")
32 #define MN_EOL _("行の終端", "End of line")
33 #define MN_PGUP _("上のページ  (PageUpキー)", "Page up  (PageUp key)")
34 #define MN_PGDOWN _("下のページ  (PageDownキー)", "Page down(PageDown key)")
35 #define MN_TOP _("1行目へ移動 (Homeキー)", "Top      (Home key)")
36 #define MN_BOTTOM _("最下行へ移動(Endキー)", "Bottom   (End key)")
37
38 #define MN_EDIT _("編集", "Edit")
39 #define MN_CUT _("カット", "Cut")
40 #define MN_COPY _("コピー", "Copy")
41 #define MN_PASTE _("ペースト", "Paste")
42 #define MN_BLOCK _("選択範囲の指定", "Select block")
43 #define MN_KILL_LINE _("行の残りを削除", "Kill rest of line")
44 #define MN_DELETE_CHAR _("1文字削除", "Delete character")
45 #define MN_BACKSPACE _("バックスペース", "Backspace")
46 #define MN_RETURN _("改行", "Return")
47
48 #define MN_SEARCH _("検索", "Search")
49 #define MN_SEARCH_STR _("文字列で検索", "Search by string")
50 #define MN_SEARCH_FORW _("前方へ再検索", "Search foward")
51 #define MN_SEARCH_BACK _("後方へ再検索", "Search backward")
52 #define MN_SEARCH_OBJ _("アイテムを選択して検索", "Search by inventory object")
53 #define MN_SEARCH_DESTROYED _("自動破壊されたアイテムで検索", "Search by destroyed object")
54
55 #define MN_INSERT _("色々挿入", "Insert...")
56 #define MN_INSERT_OBJECT _("選択したアイテムの名前を挿入", "Insert name of choosen object")
57 #define MN_INSERT_DESTROYED _("自動破壊されたアイテムの名前を挿入", "Insert name of destroyed object")
58 #define MN_INSERT_BLOCK _("条件分岐ブロックの例を挿入", "Insert conditional block")
59 #define MN_INSERT_MACRO _("マクロ定義を挿入", "Insert a macro definition")
60 #define MN_INSERT_KEYMAP _("キーマップ定義を挿入", "Insert a keymap definition")
61
62 #define MN_COMMAND_LETTER _("拾い/破壊/放置の選択", "Command letter")
63 #define MN_CL_AUTOPICK _("「 」 (自動拾い)", "' ' (Auto pick)")
64 #define MN_CL_DESTROY _("「!」 (自動破壊)", "'!' (Auto destroy)")
65 #define MN_CL_LEAVE _("「~」 (放置)", "'~' (Leave it on the floor)")
66 #define MN_CL_QUERY _("「;」 (確認して拾う)", "';' (Query to pick up)")
67 #define MN_CL_NO_DISP _("「(」 (マップコマンドで表示しない)", "'(' (No display on the large map)")
68
69 #define MN_ADJECTIVE_GEN _("形容詞(一般)の選択", "Adjective (general)")
70 #define MN_RARE _("レアな (装備)", "rare (equipment)")
71 #define MN_COMMON _("ありふれた (装備)", "common (equipment)")
72
73 #define MN_ADJECTIVE_SPECIAL _("形容詞(特殊)の選択", "Adjective (special)")
74 #define MN_BOOSTED _("ダイス目の違う (武器)", "dice boosted (weapons)")
75 #define MN_MORE_DICE _("ダイス目 # 以上の (武器)", "more than # dice (weapons)")
76 #define MN_MORE_BONUS _("修正値 # 以上の (指輪等)", "more bonus than # (rings etc.)")
77 #define MN_WANTED _("賞金首の (死体)", "wanted (corpse)")
78 #define MN_UNIQUE _("ユニーク・モンスターの (死体)", "unique (corpse)")
79 #define MN_HUMAN _("人間の (死体)", "human (corpse)")
80 #define MN_UNREADABLE _("読めない (魔法書)", "unreadable (spellbooks)")
81 #define MN_REALM1 _("第一領域の (魔法書)", "realm1 (spellbooks)")
82 #define MN_REALM2 _("第二領域の (魔法書)", "realm2 (spellbooks)")
83 #define MN_FIRST _("1冊目の (魔法書)", "first (spellbooks)")
84 #define MN_SECOND _("2冊目の (魔法書)", "second (spellbooks)")
85 #define MN_THIRD _("3冊目の (魔法書)", "third (spellbooks)")
86 #define MN_FOURTH _("4冊目の (魔法書)", "fourth (spellbooks)")
87
88 #define MN_NOUN _("名詞の選択", "Keywords (noun)")
89
90 /*
91  * Initialize the KEY_* constants declared in autopick-keys-table.h.  Do
92  * so using MKEY_* preprocessor macros to satisfy two requirements:
93  * 1) The platforms using configure/automake only preprocess .c files (.h
94  * files are not touched) with nkf to modify the encoding of Japanese
95  * characters.
96  * 2) Want to use some of the same strings as initializers for menu_data.
97  * To avoid explicitly repeating the strings while satisfying the requirement
98  * that the initializers be constant expressions that can be evaluated at
99  * compile time, define the MKEY_* preprocessor macros and use them for
100  * initializing the KEY_* constants and menu_data.
101  */
102 #define MKEY_ALL _("すべての", "all")
103 concptr KEY_ALL = MKEY_ALL;
104 #define MKEY_UNAWARE _("未判明の", "unaware")
105 concptr KEY_UNAWARE = MKEY_UNAWARE;
106 #define MKEY_UNIDENTIFIED _("未鑑定の", "unidentified")
107 concptr KEY_UNIDENTIFIED = MKEY_UNIDENTIFIED;
108 #define MKEY_IDENTIFIED _("鑑定済みの", "identified")
109 concptr KEY_IDENTIFIED = MKEY_IDENTIFIED;
110 #define MKEY_STAR_IDENTIFIED _("*鑑定*済みの", "*identified*")
111 concptr KEY_STAR_IDENTIFIED = MKEY_STAR_IDENTIFIED;
112 #define MKEY_COLLECTING _("収集中の", "collecting")
113 concptr KEY_COLLECTING = MKEY_COLLECTING;
114 #define MKEY_ARTIFACT _("アーティファクト", "artifact")
115 concptr KEY_ARTIFACT = MKEY_ARTIFACT;
116 #define MKEY_EGO _("エゴ", "ego")
117 concptr KEY_EGO = MKEY_EGO;
118 #define MKEY_GOOD _("上質の", "good")
119 concptr KEY_GOOD = MKEY_GOOD;
120 #define MKEY_NAMELESS _("無銘の", "nameless")
121 concptr KEY_NAMELESS = MKEY_NAMELESS;
122 #define MKEY_AVERAGE _("並の", "average")
123 concptr KEY_AVERAGE = MKEY_AVERAGE;
124 #define MKEY_WORTHLESS _("無価値の", "worthless")
125 concptr KEY_WORTHLESS = MKEY_WORTHLESS;
126 #define MKEY_RARE _("レアな", "rare")
127 concptr KEY_RARE = MKEY_RARE;
128 #define MKEY_COMMON _("ありふれた", "common")
129 concptr KEY_COMMON = MKEY_COMMON;
130 #define MKEY_BOOSTED _("ダイス目の違う", "dice boosted")
131 concptr KEY_BOOSTED = MKEY_BOOSTED;
132 #define MKEY_MORE_THAN _("ダイス目", "more than")
133 concptr KEY_MORE_THAN = MKEY_MORE_THAN;
134 #define MKEY_DICE _("以上の", "dice")
135 concptr KEY_DICE = MKEY_DICE;
136 #define MKEY_MORE_BONUS _("修正値", "more bonus than")
137 concptr KEY_MORE_BONUS = MKEY_MORE_BONUS;
138 #define MKEY_MORE_BONUS2 _("以上の", "")
139 concptr KEY_MORE_BONUS2 = MKEY_MORE_BONUS2;
140 #define MKEY_WANTED _("賞金首の", "wanted")
141 concptr KEY_WANTED = MKEY_WANTED;
142 #define MKEY_UNIQUE _("ユニーク・モンスターの", "unique monster's")
143 concptr KEY_UNIQUE = MKEY_UNIQUE;
144 #define MKEY_HUMAN _("人間の", "human")
145 concptr KEY_HUMAN = MKEY_HUMAN;
146 #define MKEY_UNREADABLE _("読めない", "unreadable")
147 concptr KEY_UNREADABLE = MKEY_UNREADABLE;
148 #define MKEY_REALM1 _("第一領域の", "first realm's")
149 concptr KEY_REALM1 = MKEY_REALM1;
150 #define MKEY_REALM2 _("第二領域の", "second realm's")
151 concptr KEY_REALM2 = MKEY_REALM2;
152 #define MKEY_FIRST _("1冊目の", "first")
153 concptr KEY_FIRST = MKEY_FIRST;
154 #define MKEY_SECOND _("2冊目の", "second")
155 concptr KEY_SECOND = MKEY_SECOND;
156 #define MKEY_THIRD _("3冊目の", "third")
157 concptr KEY_THIRD = MKEY_THIRD;
158 #define MKEY_FOURTH _("4冊目の", "fourth")
159 concptr KEY_FOURTH = MKEY_FOURTH;
160 #define MKEY_ITEMS _("アイテム", "items")
161 concptr KEY_ITEMS = MKEY_ITEMS;
162 #define MKEY_WEAPONS _("武器", "weapons")
163 concptr KEY_WEAPONS = MKEY_WEAPONS;
164 #define MKEY_FAVORITE_WEAPONS _("得意武器", "favorite weapons")
165 concptr KEY_FAVORITE_WEAPONS = MKEY_FAVORITE_WEAPONS;
166 #define MKEY_ARMORS _("防具", "armors")
167 concptr KEY_ARMORS = MKEY_ARMORS;
168 #define MKEY_MISSILES _("矢", "missiles")
169 concptr KEY_MISSILES = MKEY_MISSILES;
170 #define MKEY_DEVICES _("魔法アイテム", "magical devices")
171 concptr KEY_DEVICES = MKEY_DEVICES;
172 #define MKEY_LIGHTS _("光源", "lights")
173 concptr KEY_LIGHTS = MKEY_LIGHTS;
174 #define MKEY_JUNKS _("がらくた", "junk")
175 concptr KEY_JUNKS = MKEY_JUNKS;
176 #define MKEY_CORPSES _("死体や骨", "corpses or skeletons")
177 concptr KEY_CORPSES = MKEY_CORPSES;
178 #define MKEY_SPELLBOOKS _("魔法書", "spellbooks")
179 concptr KEY_SPELLBOOKS = MKEY_SPELLBOOKS;
180 #define MKEY_HAFTED _("鈍器", "hafted weapons")
181 concptr KEY_HAFTED = MKEY_HAFTED;
182 #define MKEY_SHIELDS _("盾", "shields")
183 concptr KEY_SHIELDS = MKEY_SHIELDS;
184 #define MKEY_BOWS _("弓", "bows")
185 concptr KEY_BOWS = MKEY_BOWS;
186 #define MKEY_RINGS _("指輪", "rings")
187 concptr KEY_RINGS = MKEY_RINGS;
188 #define MKEY_AMULETS _("アミュレット", "amulets")
189 concptr KEY_AMULETS = MKEY_AMULETS;
190 #define MKEY_SUITS _("鎧", "suits")
191 concptr KEY_SUITS = MKEY_SUITS;
192 #define MKEY_CLOAKS _("クローク", "cloaks")
193 concptr KEY_CLOAKS = MKEY_CLOAKS;
194 #define MKEY_HELMS _("兜", "helms")
195 concptr KEY_HELMS = MKEY_HELMS;
196 #define MKEY_GLOVES _("籠手", "gloves")
197 concptr KEY_GLOVES = MKEY_GLOVES;
198 #define MKEY_BOOTS _("靴", "boots")
199 concptr KEY_BOOTS = MKEY_BOOTS;
200
201 command_menu_type menu_data[MENU_DATA_NUM] = { { MN_HELP, 0, -1, EC_HELP }, { MN_QUIT, 0, KTRL('q'), EC_QUIT }, { MN_SAVEQUIT, 0, KTRL('w'), EC_SAVEQUIT },
202     { MN_REVERT, 0, KTRL('z'), EC_REVERT },
203
204     { MN_EDIT, 0, -1, -1 }, { MN_CUT, 1, KTRL('x'), EC_CUT }, { MN_COPY, 1, KTRL('c'), EC_COPY }, { MN_PASTE, 1, KTRL('v'), EC_PASTE },
205     { MN_BLOCK, 1, KTRL('g'), EC_BLOCK }, { MN_KILL_LINE, 1, KTRL('k'), EC_KILL_LINE }, { MN_DELETE_CHAR, 1, KTRL('d'), EC_DELETE_CHAR },
206     { MN_BACKSPACE, 1, KTRL('h'), EC_BACKSPACE }, { MN_RETURN, 1, KTRL('j'), EC_RETURN }, { MN_RETURN, 1, KTRL('m'), EC_RETURN },
207
208     { MN_SEARCH, 0, -1, -1 }, { MN_SEARCH_STR, 1, KTRL('s'), EC_SEARCH_STR }, { MN_SEARCH_FORW, 1, -1, EC_SEARCH_FORW },
209     { MN_SEARCH_BACK, 1, KTRL('r'), EC_SEARCH_BACK }, { MN_SEARCH_OBJ, 1, KTRL('y'), EC_SEARCH_OBJ }, { MN_SEARCH_DESTROYED, 1, -1, EC_SEARCH_DESTROYED },
210
211     { MN_MOVE, 0, -1, -1 }, { MN_LEFT, 1, KTRL('b'), EC_LEFT }, { MN_DOWN, 1, KTRL('n'), EC_DOWN }, { MN_UP, 1, KTRL('p'), EC_UP },
212     { MN_RIGHT, 1, KTRL('f'), EC_RIGHT }, { MN_BOL, 1, KTRL('a'), EC_BOL }, { MN_EOL, 1, KTRL('e'), EC_EOL }, { MN_PGUP, 1, KTRL('o'), EC_PGUP },
213     { MN_PGDOWN, 1, KTRL('l'), EC_PGDOWN }, { MN_TOP, 1, KTRL('t'), EC_TOP }, { MN_BOTTOM, 1, KTRL('u'), EC_BOTTOM },
214
215     { MN_INSERT, 0, -1, -1 }, { MN_INSERT_OBJECT, 1, KTRL('i'), EC_INSERT_OBJECT }, { MN_INSERT_DESTROYED, 1, -1, EC_INSERT_DESTROYED },
216     { MN_INSERT_BLOCK, 1, -1, EC_INSERT_BLOCK }, { MN_INSERT_MACRO, 1, -1, EC_INSERT_MACRO }, { MN_INSERT_KEYMAP, 1, -1, EC_INSERT_KEYMAP },
217
218     { MN_ADJECTIVE_GEN, 0, -1, -1 }, { MKEY_UNAWARE, 1, -1, EC_IK_UNAWARE }, { MKEY_UNIDENTIFIED, 1, -1, EC_IK_UNIDENTIFIED },
219     { MKEY_IDENTIFIED, 1, -1, EC_IK_IDENTIFIED }, { MKEY_STAR_IDENTIFIED, 1, -1, EC_IK_STAR_IDENTIFIED }, { MKEY_COLLECTING, 1, -1, EC_OK_COLLECTING },
220     { MKEY_ARTIFACT, 1, -1, EC_OK_ARTIFACT }, { MKEY_EGO, 1, -1, EC_OK_EGO }, { MKEY_GOOD, 1, -1, EC_OK_GOOD }, { MKEY_NAMELESS, 1, -1, EC_OK_NAMELESS },
221     { MKEY_AVERAGE, 1, -1, EC_OK_AVERAGE }, { MKEY_WORTHLESS, 1, -1, EC_OK_WORTHLESS }, { MN_RARE, 1, -1, EC_OK_RARE }, { MN_COMMON, 1, -1, EC_OK_COMMON },
222
223     { MN_ADJECTIVE_SPECIAL, 0, -1, -1 }, { MN_BOOSTED, 1, -1, EC_OK_BOOSTED }, { MN_MORE_DICE, 1, -1, EC_OK_MORE_DICE },
224     { MN_MORE_BONUS, 1, -1, EC_OK_MORE_BONUS }, { MN_WANTED, 1, -1, EC_OK_WANTED }, { MN_UNIQUE, 1, -1, EC_OK_UNIQUE }, { MN_HUMAN, 1, -1, EC_OK_HUMAN },
225     { MN_UNREADABLE, 1, -1, EC_OK_UNREADABLE }, { MN_REALM1, 1, -1, EC_OK_REALM1 }, { MN_REALM2, 1, -1, EC_OK_REALM2 }, { MN_FIRST, 1, -1, EC_OK_FIRST },
226     { MN_SECOND, 1, -1, EC_OK_SECOND }, { MN_THIRD, 1, -1, EC_OK_THIRD }, { MN_FOURTH, 1, -1, EC_OK_FOURTH },
227
228     { MN_NOUN, 0, -1, -1 }, { MKEY_WEAPONS, 1, -1, EC_KK_WEAPONS }, { MKEY_FAVORITE_WEAPONS, 1, -1, EC_KK_FAVORITE_WEAPONS },
229     { MKEY_ARMORS, 1, -1, EC_KK_ARMORS }, { MKEY_MISSILES, 1, -1, EC_KK_MISSILES }, { MKEY_DEVICES, 1, -1, EC_KK_DEVICES },
230     { MKEY_LIGHTS, 1, -1, EC_KK_LIGHTS }, { MKEY_JUNKS, 1, -1, EC_KK_JUNKS }, { MKEY_CORPSES, 1, -1, EC_KK_CORPSES },
231     { MKEY_SPELLBOOKS, 1, -1, EC_KK_SPELLBOOKS }, { MKEY_SHIELDS, 1, -1, EC_KK_SHIELDS }, { MKEY_BOWS, 1, -1, EC_KK_BOWS }, { MKEY_RINGS, 1, -1, EC_KK_RINGS },
232     { MKEY_AMULETS, 1, -1, EC_KK_AMULETS }, { MKEY_SUITS, 1, -1, EC_KK_SUITS }, { MKEY_CLOAKS, 1, -1, EC_KK_CLOAKS }, { MKEY_HELMS, 1, -1, EC_KK_HELMS },
233     { MKEY_GLOVES, 1, -1, EC_KK_GLOVES }, { MKEY_BOOTS, 1, -1, EC_KK_BOOTS },
234
235     { MN_COMMAND_LETTER, 0, -1, -1 }, { MN_CL_AUTOPICK, 1, -1, EC_CL_AUTOPICK }, { MN_CL_DESTROY, 1, -1, EC_CL_DESTROY }, { MN_CL_LEAVE, 1, -1, EC_CL_LEAVE },
236     { MN_CL_QUERY, 1, -1, EC_CL_QUERY }, { MN_CL_NO_DISP, 1, -1, EC_CL_NO_DISP },
237
238     { MN_DELETE_CHAR, -1, 0x7F, EC_DELETE_CHAR },
239
240     { nullptr, -1, -1, 0 } };