OSDN Git Service

Merge pull request #1248 from sikabane-works/release/3.0.0Alpha30
[hengbandforosx/hengbandosx.git] / src / birth / birth-util.cpp
1 #include "birth/birth-util.h"
2 #include "cmd-io/cmd-gameoption.h"
3 #include "core/show-file.h"
4 #include "main/sound-of-music.h"
5 #include "system/game-option-types.h"
6 #include "term/screen-processor.h"
7
8 /*!
9  * @brief プレイヤー作成を中断して変愚蛮怒を終了する
10  */
11 void birth_quit(void)
12 {
13     quit(NULL);
14 }
15
16 /*!
17  * @brief 指定されたヘルプファイルを表示する / Show specific help file
18  * @param creature_ptr プレーヤーへの参照ポインタ
19  * @param helpfile ファイル名
20  */
21 void show_help(player_type* creature_ptr, concptr helpfile)
22 {
23     screen_save();
24     (void)show_file(creature_ptr, true, helpfile, NULL, 0, 0);
25     screen_load();
26 }
27
28 void birth_help_option(player_type *creature_ptr, char c, birth_kind bk)
29 {
30     concptr help_file;
31     switch (bk) {
32     case BK_RACE:
33         help_file = _("jraceclas.txt#TheRaces", "raceclas.txt#TheRaces");
34         break;
35     case BK_CLASS:
36         help_file = _("jraceclas.txt#TheClasses", "raceclas.txt#TheClasses");
37         break;
38     case BK_REALM:
39         help_file = _("jmagic.txt#MagicRealms", "magic.txt#MagicRealms");
40         break;
41     case BK_PERSONALITY:
42         help_file = _("jraceclas.txt#ThePersonalities", "raceclas.txt#ThePersonalities");
43         break;
44     case BK_AUTO_ROLLER:
45         help_file = _("jbirth.txt#AutoRoller", "birth.txt#AutoRoller");
46         break;
47     default:
48         help_file = "";
49         break;
50     }
51
52     if (c == '?') {
53         show_help(creature_ptr, help_file);
54     } else if (c == '=') {
55         screen_save();
56         do_cmd_options_aux(creature_ptr, OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Options ((*)) affect score"));
57         screen_load();
58     } else if (c != '2' && c != '4' && c != '6' && c != '8')
59         bell();
60 }