Functions | Variables
ui-game.h File Reference

Game management for the traditional text UI. More...

#include "cmd-core.h"
#include "game-event.h"

Go to the source code of this file.


void cmd_init (void)
 Initialise the command list. More...
unsigned char cmd_lookup_key (cmd_code lookup_cmd, int mode)
unsigned char cmd_lookup_key_unktrl (cmd_code lookup_cmd, int mode)
cmd_code cmd_lookup (unsigned char key, int mode)
void textui_process_command (void)
 Parse and execute the current command Give "Warning" on illegal commands. More...
errr textui_get_cmd (cmd_context context)
void check_for_player_interrupt (game_event_type type, game_event_data *data, void *user)
 Allow for user abort during repeated commands, running and resting. More...
void play_game (bool new_game)
 Play Angband. More...
void savefile_set_name (const char *fname, bool make_safe, bool strip_suffix)
 Set the savefile name. More...
void save_game (void)
 Save the game. More...
void close_game (void)
 Close up the current game (player may or may not be dead) More...


bool arg_wizard
char savefile [1024]
 Buffer to hold the current savefile name. More...

Detailed Description

Game management for the traditional text UI.

Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke Copyright (c) 2015 Nick McConnell

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Function Documentation

◆ check_for_player_interrupt()

void check_for_player_interrupt ( game_event_type  type,
game_event_data data,
void user 

Allow for user abort during repeated commands, running and resting.

This will only check during every 128th game turn while resting.

References cmd_get_nrepeats(), disturb(), EVENT_INPUT_FLUSH, event_signal(), EVT_NONE, inkey_ex(), inkey_scan, msg, player_is_resting(), player_upkeep::running, SCAN_INSTANT, turn, ui_event::type, and player::upkeep.

Referenced by ui_enter_world(), and ui_leave_world().

◆ close_game()

void close_game ( void  )

Close up the current game (player may or may not be dead)

Note that the savefile is not saved until the tombstone is actually displayed and the player has a chance to examine the inventory and such. This allows cheating if the game is equipped with a "quit without save" method. XXX XXX XXX

References cave, keypress::code, deactivate_randart_file(), death_knowledge(), death_screen(), ESCAPE, EVENT_INPUT_FLUSH, EVENT_LEAVE_GAME, EVENT_LEAVE_WORLD, EVENT_MESSAGE_FLUSH, event_signal(), handle_stuff(), inkey(), player::is_dead, term::mapped_flag, msg, OPT, predict_score(), prt(), save_game(), savefile, savefile_save(), screen_save_depth, signals_handle_tstp(), signals_ignore_tstp(), Term, and wipe_mon_list().

Referenced by handle_signal_simple(), and play_game().

◆ cmd_init()

void cmd_init ( void  )

Initialise the command list.

References i, cmd_info::key, command_list::len, command_list::list, and N_ELEMENTS.

Referenced by setup_tests(), and textui_init().

◆ cmd_lookup()

cmd_code cmd_lookup ( unsigned char  key,
int  mode 

◆ cmd_lookup_key()

unsigned char cmd_lookup_key ( cmd_code  lookup_cmd,
int  mode 

◆ cmd_lookup_key_unktrl()

unsigned char cmd_lookup_key_unktrl ( cmd_code  lookup_cmd,
int  mode 

References cmd_lookup_key(), and UN_KTRL.

◆ play_game()

void play_game ( bool  new_game)

◆ save_game()

void save_game ( void  )

◆ savefile_set_name()

void savefile_set_name ( const char *  fname,
bool  make_safe,
bool  strip_suffix 

◆ textui_get_cmd()

errr textui_get_cmd ( cmd_context  context)

References CTX_GAME, and textui_process_command().

Referenced by main().

◆ textui_process_command()

void textui_process_command ( void  )

Variable Documentation

◆ arg_wizard

bool arg_wizard

Referenced by main(), and start_game().

◆ savefile

char savefile[1024]