Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

src/messagefield.c File Reference


Detailed Description

Shows messages at the top of the screen.

Definition in file messagefield.c.

#include "crogue.h"
#include "export.h"

Go to the source code of this file.

Defines

#define MESSAGEFIELD_X   0
#define MESSAGEFIELD_Y   0
#define MESSAGEFIELD_ROWS   2
#define MESSAGEFIELD_HEIGHT   16
#define MESSAGEFIELD_WIDTH   SCREEN_WIDTH

Functions

void _UI_MF_savemsg (const char *msg)
 Stores a string to the message history.

void message (const char *format,...)
 Show text to the player.

void vmessage (const char *format, va_list args)
 Show text to the player with a va_list.

void UI_MF_clear (void)
 Clear the message line.

void UI_MF_history (void)
 Display the message history.

void UI_MF_sendmsg (const char *msg)
 Send a message string.

void UI_MF_wait (void)
 Give a -More- prompt.


Variables

draw_string_info MF_state
char message_buf [MESSAGEBUF_SIZE]


Define Documentation

#define MESSAGEFIELD_HEIGHT   16
 

Definition at line 29 of file messagefield.c.

Referenced by UI_MF_clear(), and UI_MF_sendmsg().

#define MESSAGEFIELD_ROWS   2
 

Definition at line 28 of file messagefield.c.

Referenced by UI_MF_clear().

#define MESSAGEFIELD_WIDTH   SCREEN_WIDTH
 

Definition at line 30 of file messagefield.c.

Referenced by UI_MF_clear(), and UI_MF_sendmsg().

#define MESSAGEFIELD_X   0
 

Definition at line 26 of file messagefield.c.

Referenced by UI_MF_clear(), and UI_MF_sendmsg().

#define MESSAGEFIELD_Y   0
 

Definition at line 27 of file messagefield.c.

Referenced by UI_MF_clear(), and UI_MF_sendmsg().


Function Documentation

void _UI_MF_savemsg const char *  msg  )  [static]
 

Stores a string to the message history.

Definition at line 103 of file messagefield.c.

References message_buf, and MESSAGEBUF_SIZE.

Referenced by vmessage().

void message const char *  format,
... 
 

Show text to the player.

This function works like printf, except that text goes to the message line. See documentation for 'printf' on how to make format strings. If the message is too long, it will automatically be wrapped and the player will be given a -More- prompt as needed.

See also:
vmessage

Definition at line 43 of file messagefield.c.

References vmessage().

Referenced by attack_tile(), auto_follow_connection(), award_high_score(), award_mark(), awardXP(), cast_spell(), cause_confusion(), confuse_monster(), die(), do_drop_item(), do_takeoff_item(), do_wear_item(), drop_item(), drop_multiple(), enchant_item(), end_game(), fix_rust(), follow_connection(), frleread(), give_item(), give_item_slip(), hotkey_item(), identify(), item_step(), learn_spell(), list_discoveries(), load_level(), manip_door(), monst_anger(), monst_attack_plr(), monst_attack_type(), monst_swing_monst(), monst_takedamage(), monstmove(), pickup(), plr_attack(), plr_mod_stat(), plr_move(), plr_moveto(), plr_restore_stat(), plr_run(), plr_search(), plr_walk(), potion_hit_extra_heal(), potion_hit_full_heal(), potion_hit_heal(), potion_hit_sickness(), potion_numbness_expire(), prompt(), prompt_dir(), prompt_letter(), refresh_spell(), remove_expired_timers(), removecurses(), restore_game(), rust_inventory(), scare_monster_force(), spell_adrenaline(), spell_adrenaline_expire(), spell_adrenaline_low(), spell_confusion(), spell_gain_strength(), spell_heal(), spell_shield(), study_book(), study_spell(), takeoff_item(), takeoff_multiple(), throw_item(), throw_item_from_menu(), throw_readied_item(), timepass(), tool_holysymbol(), top_item(), UI_TF_Scroll(), use_item(), wear_item(), and wear_multiple().

void UI_MF_clear void   ) 
 

Clear the message line.

Definition at line 75 of file messagefield.c.

References clear_line, clear_string(), draw_string_info::curRow, draw_string_info::curX, Graph_ClearRect(), MESSAGEFIELD_HEIGHT, MESSAGEFIELD_ROWS, MESSAGEFIELD_WIDTH, MESSAGEFIELD_X, MESSAGEFIELD_Y, MF_state, OPTION_FONTSIZE, world::options, and w.

Referenced by draw(), initialize(), UI_Dialog_Default(), UI_MF_wait(), and vmessage().

void UI_MF_history void   ) 
 

Display the message history.

Definition at line 123 of file messagefield.c.

References draw_string(), full_redraw(), Graph_ClrScr(), message_buf, MESSAGEBUF_SIZE, OPTION_FONTSIZE, world::options, read_char(), SCREEN_HEIGHT, SCREEN_WIDTH, and w.

Referenced by plr_move().

void UI_MF_sendmsg const char *  msg  ) 
 

Send a message string.

This function is used internally by message; it shows a string in the status line, wrapping and -More-'ing as needed. Note, however, that it does not support format specifiers or extra arguments like printf and message do. This function should not be called directly - instead, call message.

See also:
message

Definition at line 152 of file messagefield.c.

References draw_string_info::curX, draw_string(), MESSAGEFIELD_HEIGHT, MESSAGEFIELD_WIDTH, MESSAGEFIELD_X, MESSAGEFIELD_Y, MF_state, OPTION_FONTSIZE, world::options, and w.

Referenced by UI_MF_wait(), and vmessage().

void UI_MF_wait void   ) 
 

Give a -More- prompt.

Displays "-More-", then waits for the user to press a key and clears the message line.

Definition at line 173 of file messagefield.c.

References read_char(), UI_MF_clear(), and UI_MF_sendmsg().

void vmessage const char *  format,
va_list  args
 

Show text to the player with a va_list.

This function works like vprintf, meaning it takes its arguments in the form of a va_list and otherwise acts like printf.

See also:
message

Definition at line 56 of file messagefield.c.

References _UI_MF_savemsg(), world::interrupt, world::messagevis, UI_MF_clear(), UI_MF_sendmsg(), and w.

Referenced by message().


Variable Documentation

char message_buf[MESSAGEBUF_SIZE] [static]
 

Definition at line 99 of file messagefield.c.

Referenced by _UI_MF_savemsg(), and UI_MF_history().

draw_string_info MF_state [static]
 

Definition at line 33 of file messagefield.c.

Referenced by UI_MF_clear(), and UI_MF_sendmsg().


Generated on Thu May 20 13:12:13 2004 for CalcRogue by doxygen 1.3.6