/** * Handle character death */ void death_screen(void) { const region area = { 51, 2, 0, N_ELEMENTS(death_actions) }; /* Dump bones file */ make_bones(); /* Handle retirement */ if (p_ptr->total_winner) kingly(); /* Save dead player */ if (!old_save()) { msg_print("death save failed!"); message_flush(); } /* Get time of death */ #ifdef _WIN32_WCE { unsigned long fake_time(unsigned long *fake_time_t); fake_time(&death_time); } #else (void) time(&death_time); #endif /* You are dead */ print_tomb(); /* Hack - Know everything upon death */ death_knowledge(); /* Enter player in high score list */ enter_score(&death_time); /* Flush all input keys */ flush(); /* Flush messages */ msg_print(NULL); if (!death_menu) { death_menu = menu_new_action(death_actions, N_ELEMENTS(death_actions)); death_menu->flags = MN_CASELESS_TAGS; } menu_layout(death_menu, &area); do { menu_select(death_menu, 0); } while (!get_check("Do you want to quit? ")); }
/* * Handle character death */ void death_screen(void) { bool done = FALSE; const region area = { 51, 2, 0, N_ELEMENTS(death_actions) }; /* Retire in the town in a good state */ if (p_ptr->total_winner) { p_ptr->depth = 0; my_strcpy(p_ptr->died_from, "Ripe Old Age", sizeof(p_ptr->died_from)); p_ptr->exp = p_ptr->max_exp; p_ptr->lev = p_ptr->max_lev; p_ptr->au += 10000000L; display_winner(); } /* Get time of death */ (void)time(&death_time); print_tomb(); death_knowledge(); enter_score(&death_time); /* Flush all input and output */ flush(); message_flush(); /* Display and use the death menu */ if (!death_menu) { death_menu = menu_new_action(death_actions, N_ELEMENTS(death_actions)); death_menu->flags = MN_CASELESS_TAGS; } menu_layout(death_menu, &area); while (!done) { ui_event e = menu_select(death_menu, EVT_KBRD); if (e.type == EVT_KBRD) { if (e.key.code == KTRL('X')) break; } else if (e.type == EVT_SELECT) { done = get_check("Do you want to quit? "); } } /* Save dead player */ if (!savefile_save(savefile)) { msg("death save failed!"); message_flush(); } }
/* * Handle character death */ void death_screen(void) { const region area = { 51, 2, 0, N_ELEMENTS(death_actions) }; /* Retire in the town in a good state */ if (p_ptr->total_winner) { p_ptr->depth = 0; my_strcpy(p_ptr->died_from, "Ripe Old Age", sizeof(p_ptr->died_from)); p_ptr->exp = p_ptr->max_exp; p_ptr->lev = p_ptr->max_lev; p_ptr->au += 10000000L; display_winner(); } /* Save dead player */ if (!savefile_save(savefile)) { msg("death save failed!"); message_flush(); } /* Get time of death */ (void)time(&death_time); print_tomb(); death_knowledge(); enter_score(&death_time); /* Flush all input and output */ flush(); message_flush(); if (!death_menu) { death_menu = menu_new_action(death_actions, N_ELEMENTS(death_actions)); death_menu->flags = MN_CASELESS_TAGS; } menu_layout(death_menu, &area); do { menu_select(death_menu, 0); } while (!get_check("Do you want to quit? ")); }
/** * Create Spoiler files */ void do_cmd_spoilers(void) { if (!spoil_menu) { spoil_menu = menu_new_action(spoil_actions, N_ELEMENTS(spoil_actions)); spoil_menu->selections = lower_case; spoil_menu->title = "Create spoilers"; } screen_save(); clear_from(0); menu_layout(spoil_menu, &SCREEN_REGION); menu_select(spoil_menu, 0, false); screen_load(); }
/** * Display the options main menu. */ void do_cmd_options(void) { if (!option_menu) { /* Main option menu */ option_menu = menu_new_action(option_actions, N_ELEMENTS(option_actions)); option_menu->title = "Options Menu"; option_menu->flags = MN_CASELESS_TAGS; } screen_save(); clear_from(0); menu_layout(option_menu, &SCREEN_REGION); menu_select(option_menu, 0, false); screen_load(); }
/** * Handle character death */ void death_screen(void) { struct menu *death_menu; bool done = false; const region area = { 51, 2, 0, N_ELEMENTS(death_actions) }; /* Winner */ if (player->total_winner) { display_winner(); } /* Tombstone */ print_tomb(); /* Flush all input and output */ event_signal(EVENT_INPUT_FLUSH); event_signal(EVENT_MESSAGE_FLUSH); /* Display and use the death menu */ death_menu = menu_new_action(death_actions, N_ELEMENTS(death_actions)); death_menu->flags = MN_CASELESS_TAGS; menu_layout(death_menu, &area); while (!done) { ui_event e = menu_select(death_menu, EVT_KBRD, false); if (e.type == EVT_KBRD) { if (e.key.code == KTRL('X')) break; } else if (e.type == EVT_SELECT) { done = get_check("Do you want to quit? "); } } menu_free(death_menu); }
/** * Interact with "colors" */ static void do_cmd_colors(const char *title, int row) { screen_save(); clear_from(0); if (!color_menu) { color_menu = menu_new_action(color_events, N_ELEMENTS(color_events)); color_menu->title = title; color_menu->selections = lower_case; color_menu->browse_hook = colors_browse_hook; } menu_layout(color_menu, &SCREEN_REGION); menu_select(color_menu, 0, false); screen_load(); }
/** * Interact with "visuals" */ static void do_cmd_visuals(const char *title, int row) { screen_save(); clear_from(0); if (!visual_menu) { visual_menu = menu_new_action(visual_menu_items, N_ELEMENTS(visual_menu_items)); visual_menu->title = title; visual_menu->selections = lower_case; visual_menu->browse_hook = visuals_browse_hook; visual_menu->header = "To edit visuals, use the knowledge menu"; } menu_layout(visual_menu, &SCREEN_REGION); menu_select(visual_menu, 0, false); screen_load(); }
static void do_cmd_keymaps(const char *title, int row) { region loc = {0, 0, 0, 12}; screen_save(); clear_from(0); if (!keymap_menu) { keymap_menu = menu_new_action(keymap_actions, N_ELEMENTS(keymap_actions)); keymap_menu->title = title; keymap_menu->selections = lower_case; keymap_menu->browse_hook = keymap_browse_hook; } menu_layout(keymap_menu, &loc); menu_select(keymap_menu, 0, false); screen_load(); }