#include "util/int-char-converter.h"
#include "util/string-processor.h"
#include "view/display-messages.h"
-#include "view/display-player.h" // 暫定。後で消す.
+#include "view/display-player.h"
#include "world/world.h"
/*!
if (get_string(_("ファイル名: ", "File name: "), tmp, 80)) {
if (tmp[0] && (tmp[0] != ' ')) {
update_playtime();
- file_character(player_ptr, tmp, display_player);
+ file_character(player_ptr, tmp);
}
}
} else if (c == 'h') {
#include "core/stuff-handler.h"
#include "floor/floor-save.h"
#include "game-option/cheat-options.h"
+#include "io/files-util.h"
#include "io/input-key-acceptor.h"
#include "io/signal-handlers.h"
#include "io/uid-checker.h"
static void send_world_score_on_closing(PlayerType *player_ptr, bool do_send)
{
- if (send_world_score(player_ptr, do_send, display_player))
+ if (send_world_score(player_ptr, do_send))
return;
if (!get_check_strict(
print_tomb(player_ptr);
flush();
- show_death_info(player_ptr, display_player);
+ show_death_info(player_ptr);
term_clear();
if (check_score(player_ptr)) {
send_world_score_on_closing(player_ptr, do_send);
#include "grid/feature.h"
#include "grid/grid.h"
#include "info-reader/fixed-map-parser.h"
+#include "io/files-util.h"
#include "io/inet.h"
#include "io/input-key-acceptor.h"
#include "io/input-key-processor.h"
/* 町名消失バグ対策(#38205)のためここで世界マップ情報を読み出す */
parse_fixed_map(player_ptr, "w_info.txt", 0, 0, w_ptr->max_wild_y, w_ptr->max_wild_x);
- bool success = send_world_score(player_ptr, true, display_player);
+ bool success = send_world_score(player_ptr, true);
if (!success && !get_check_strict(player_ptr, _("スコア登録を諦めますか?", "Do you give up score registration? "), CHECK_NO_HISTORY)) {
prt(_("引き続き待機します。", "standing by for future registration..."), 0, 0);
(void)inkey();
#include "dungeon/dungeon.h"
#include "game-option/birth-options.h"
#include "game-option/game-play-options.h"
+#include "io/files-util.h"
#include "io/input-key-acceptor.h"
#include "io/report.h"
#include "io/signal-handlers.h"
* @param do_send 実際に転送ア処置を行うか否か
* @return 転送が成功したらTRUEを返す
*/
-bool send_world_score(PlayerType *current_player_ptr, bool do_send, display_player_pf display_player)
+bool send_world_score(PlayerType *current_player_ptr, bool do_send)
{
#ifdef WORLD_SCORE
if (!send_score || !do_send) {
prt(_("送信中..", "Sending..."), 0, 0);
term_fresh();
screen_save();
- auto successful_send = report_score(current_player_ptr, display_player);
+ auto successful_send = report_score(current_player_ptr);
screen_load();
if (!successful_send) {
return false;
#pragma once
-#include "io/files-util.h"
#include "system/angband.h"
class PlayerType;
-bool send_world_score(PlayerType *current_player_ptr, bool do_send, display_player_pf display_player);
+bool send_world_score(PlayerType *current_player_ptr, bool do_send);
errr top_twenty(PlayerType *current_player_ptr);
errr predict_score(PlayerType *current_player_ptr);
void race_legends(PlayerType *current_player_ptr);
* @param fff ファイルポインタ
* @return エラーコード
*/
-void make_character_dump(PlayerType *player_ptr, FILE *fff, display_player_pf display_player)
+void make_character_dump(PlayerType *player_ptr, FILE *fff)
{
char title[127];
put_version(title);
fprintf(fff, _(" [%s キャラクタ情報]\n\n", " [%s Character Dump]\n\n"), title);
- dump_aux_player_status(player_ptr, fff, display_player);
+ dump_aux_player_status(player_ptr, fff);
dump_aux_last_message(player_ptr, fff);
dump_aux_options(fff);
dump_aux_recall(fff);
#pragma once
#include "system/angband.h"
-#include "io/files-util.h"
class PlayerType;
-void make_character_dump(PlayerType *player_ptr, FILE *fff, display_player_pf display_player);
+void make_character_dump(PlayerType *player_ptr, FILE *fff);
#include "io-dump/player-status-dump.h"
+#include "view/display-player.h"
/*!
* @brief 画面番号を指定してダンプする
* @param player_ptr プレイヤーへの参照ポインタ
* @param fff ファイルポインタ
* @param display_player 画面表示へのコールバック
- * @param screen_num 画面番号
- * @param start_y
- * @param end_y
+ * @param mode 表示モード
+ * @param start_y ダンプの開始行数
+ * @param end_y ダンプの終了行数
* @param change_color バッファへ詰める文字の変更有無
*/
-static void dump_player_status_with_screen_num(
- PlayerType *player_ptr, FILE *fff, display_player_pf display_player,
- int screen_num, TERM_LEN start_y, TERM_LEN end_y, bool change_color)
+static void dump_player_status_with_screen_num(PlayerType *player_ptr, FILE *fff, int mode, TERM_LEN start_y, TERM_LEN end_y, bool change_color)
{
TERM_COLOR a;
char c;
char buf[1024];
- display_player(player_ptr, screen_num);
+ display_player(player_ptr, mode);
for (TERM_LEN y = start_y; y < end_y; y++)
{
TERM_LEN x;
* @brief プレイヤーのステータス表示をファイルにダンプする
* @param player_ptr プレイヤーへの参照ポインタ
* @param fff ファイルポインタ
- * @param display_player 画面表示へのコールバック
*/
-void dump_aux_player_status(PlayerType *player_ptr, FILE *fff, display_player_pf display_player)
+void dump_aux_player_status(PlayerType *player_ptr, FILE *fff)
{
- dump_player_status_with_screen_num(player_ptr, fff, display_player, 0, 1, 22, false);
- dump_player_status_with_screen_num(player_ptr, fff, display_player, 1, 10, 19, false);
+ dump_player_status_with_screen_num(player_ptr, fff, 0, 1, 22, false);
+ dump_player_status_with_screen_num(player_ptr, fff, 1, 10, 19, false);
fprintf(fff, "\n");
- dump_player_status_with_screen_num(player_ptr, fff, display_player, 2, 2, 22, true);
+ dump_player_status_with_screen_num(player_ptr, fff, 2, 2, 22, true);
fprintf(fff, "\n");
- dump_player_status_with_screen_num(player_ptr, fff, display_player, 3, 1, 18, true);
+ dump_player_status_with_screen_num(player_ptr, fff, 3, 1, 18, true);
fprintf(fff, "\n");
- dump_player_status_with_screen_num(player_ptr, fff, display_player, 4, 1, 19, true);
+ dump_player_status_with_screen_num(player_ptr, fff, 4, 1, 19, true);
fprintf(fff, "\n");
}
#pragma once
#include "system/angband.h"
-#include "io/files-util.h"
class PlayerType;
-void dump_aux_player_status(PlayerType *player_ptr, FILE *fff, display_player_pf display_player);
+void dump_aux_player_status(PlayerType *player_ptr, FILE *fff);
* Allow the "full" flag to dump additional info,
* and trigger its usage from various places in the code.
*/
-errr file_character(PlayerType *player_ptr, concptr name, display_player_pf display_player)
+errr file_character(PlayerType *player_ptr, concptr name)
{
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
return -1;
}
- make_character_dump(player_ptr, fff, display_player);
+ make_character_dump(player_ptr, fff);
angband_fclose(fff);
msg_print(_("キャラクタ情報のファイルへの書き出しに成功しました。", "Character dump successful."));
msg_print(nullptr);
extern concptr ANGBAND_DIR_XTRA;
class PlayerType;
-typedef void (*display_player_pf)(PlayerType *, int);
typedef void(*update_playtime_pf)(void);
-extern errr file_character(PlayerType *player_ptr, concptr name, display_player_pf display_player);
+extern errr file_character(PlayerType *player_ptr, concptr name);
extern errr get_rnd_line(concptr file_name, int entry, char *output);
void read_dead_file(char* buf, size_t buf_size);
* @param dumpbuf 伝送内容バッファ
* @return エラーコード
*/
-static errr make_dump(PlayerType *player_ptr, BUF *dumpbuf, display_player_pf display_player)
+static errr make_dump(PlayerType *player_ptr, BUF *dumpbuf)
{
char buf[1024];
FILE *fff;
}
/* 一旦一時ファイルを作る。通常のダンプ出力と共通化するため。 */
- make_character_dump(player_ptr, fff, display_player);
+ make_character_dump(player_ptr, fff);
angband_fclose(fff);
/* Open for read */
* @param player_ptr プレイヤーへの参照ポインタ
* @return 正常にスコアを送信できたらtrue、失敗時に送信を中止したらfalse
*/
-bool report_score(PlayerType *player_ptr, display_player_pf display_player)
+bool report_score(PlayerType *player_ptr)
{
auto *score = buf_new();
char personality_desc[128];
buf_sprintf(score, "killer: %s\n", player_ptr->died_from);
buf_sprintf(score, "-----charcter dump-----\n");
- make_dump(player_ptr, score, display_player);
+ make_dump(player_ptr, score);
if (screen_dump) {
buf_sprintf(score, "-----screen shot-----\n");
buf_append(score, screen_dump, strlen(screen_dump));
extern concptr screen_dump;
#ifdef WORLD_SCORE
-#include "io/files-util.h"
class PlayerType;
-bool report_score(PlayerType *player_ptr, display_player_pf display_player);
+bool report_score(PlayerType *player_ptr);
concptr make_screen_dump(PlayerType *player_ptr);
#endif
* core、files、view-mainwindowの参照禁止。コールバックで対応すること
*/
-#include "process-death.h"
+#include "player/process-death.h"
#include "core/asking-player.h"
#include "core/player-update-types.h"
#include "core/stuff-handler.h"
#include "floor/floor-town.h"
#include "game-option/game-play-options.h"
#include "inventory/inventory-slot-types.h"
+#include "io/files-util.h"
#include "io/input-key-acceptor.h"
#include "object/item-tester-hooker.h"
#include "object/item-use-flags.h"
#include "util/string-processor.h"
#include "view/display-inventory.h"
#include "view/display-messages.h"
+#include "view/display-player.h"
#include "world/world.h"
#define GRAVE_LINE_WIDTH 31
* @param player_ptr プレイヤーへの参照ポインタ
* @param file_character ステータスダンプへのコールバック
*/
-static void export_player_info(PlayerType *player_ptr, display_player_pf display_player)
+static void export_player_info(PlayerType *player_ptr)
{
prt(_("キャラクターの記録をファイルに書き出すことができます。", "You may now dump a character record to one or more files."), 21, 0);
prt(_("リターンキーでキャラクターを見ます。ESCで中断します。", "Then, hit RETURN to see the character, or ESC to abort."), 22, 0);
break;
screen_save();
- (void)file_character(player_ptr, out_val, display_player);
+ (void)file_character(player_ptr, out_val);
screen_load();
}
}
/*!
* @brief 自動的にプレイヤーステータスをファイルダンプ出力する
*/
-static void file_character_auto(PlayerType *player_ptr, display_player_pf display_player)
+static void file_character_auto(PlayerType *player_ptr)
{
time_t now_t = time(nullptr);
struct tm *now_tm = localtime(&now_t);
strnfmt(filename, sizeof(filename), "%s_Autodump_%s.txt", p_ptr->name, datetime);
screen_save();
- (void)file_character(player_ptr, filename, display_player);
+ (void)file_character(player_ptr, filename);
screen_load();
}
* @param player_ptr プレイヤーへの参照ポインタ
* @param display_player ステータス表示へのコールバック
*/
-void show_death_info(PlayerType *player_ptr, display_player_pf display_player)
+void show_death_info(PlayerType *player_ptr)
{
inventory_aware(player_ptr);
home_aware(player_ptr);
msg_erase();
if (auto_dump)
- file_character_auto(player_ptr, display_player);
+ file_character_auto(player_ptr);
- export_player_info(player_ptr, display_player);
- (*display_player)(player_ptr, 0);
+ export_player_info(player_ptr);
+ display_player(player_ptr, 0);
prt(_("何かキーを押すとさらに情報が続きます (ESCで中断): ", "Hit any key to see more information (ESC to abort): "), 23, 0);
if (inkey() == ESCAPE)
return;
#pragma once
-#include "io/files-util.h"
-
class PlayerType;
void print_tomb(PlayerType *player_ptr);
-void show_death_info(PlayerType *player_ptr, display_player_pf display_player);
+void show_death_info(PlayerType *player_ptr);